"java.rmi.UnmarshalException: error unmarshalling" at Applet with RMI comm.

Hello,
I am trying to make an Applet work with an RMI server, but i keep getting the same exception again and again whatever i do.
More specifically, i get the following :
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
     java.net.MalformedURLException: unknown protocol: c
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at server.ClientDemo.initGUI(ClientDemo.java:100)
     at server.ClientDemo.<init>(ClientDemo.java:85)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
     at java.lang.reflect.Constructor.newInstance(Unknown Source)
     at java.lang.Class.newInstance0(Unknown Source)
     at java.lang.Class.newInstance(Unknown Source)
     at sun.applet.AppletPanel.createApplet(Unknown Source)
     at sun.applet.AppletPanel.runLoader(Unknown Source)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Caused by: java.net.MalformedURLException: unknown protocol: c
     at java.net.URL.<init>(Unknown Source)
     at java.net.URL.<init>(Unknown Source)
     at java.net.URL.<init>(Unknown Source)
     at sun.rmi.server.LoaderHandler.pathToURLs(Unknown Source)
     at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
     at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
     at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
     at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
     at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
     at java.io.ObjectInputStream.readClassDesc(Unknown Source)
     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
     at java.io.ObjectInputStream.readObject0(Unknown Source)
     at java.io.ObjectInputStream.readObject(Unknown Source)
     ... 13 more
The exeption is thrown at the following line :
               remoteReference = (RMIServer) registry.lookup(RMIServer.REGISTRY_NAME);
This is the code of the server which seems to be running ok:
if(System.getSecurityManager()==null)
               System.setSecurityManager(new SecurityManager());
          registry = LocateRegistry.createRegistry(1099);
          RMIServer sr=(RMIServer) UnicastRemoteObject.exportObject(new ServerDemo(),1099);
          registry.rebind(RMIServer.REGISTRY_NAME, sr);
and the client:
registry = LocateRegistry.getRegistry("localhost");
remoteReference = (RMIServer) registry.lookup(RMIServer.REGISTRY_NAME);
Thank you in advance
Alex
Forgot to mention that i am setting the security policy and codebase programmatically:
System.setProperty("java.security.policy","C:\\Users\\Alex\\workspace\\Demo\\grantall.policy");
          System.setProperty("java.rmi.server.codebase","C:\\Users\\Alex\\workspace\\Demo\\bin");
Edited by: Alkon on May 15, 2008 4:31 PM

I edited the code that sets the security and i am now getting the following error, again at the lookup:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
     java.io.EOFException
     at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
     at sun.rmi.server.UnicastRef.invoke(Unknown Source)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at server.ClientDemo.initGUI(ClientDemo.java:101)
     at server.ClientDemo.<init>(ClientDemo.java:91)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
     at java.lang.reflect.Constructor.newInstance(Unknown Source)
     at java.lang.Class.newInstance0(Unknown Source)
     at java.lang.Class.newInstance(Unknown Source)
     at sun.applet.AppletPanel.createApplet(Unknown Source)
     at sun.applet.AppletPanel.runLoader(Unknown Source)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
     at java.io.DataInputStream.readByte(Unknown Source)
     ... 15 more

Similar Messages

  • New @ RMI need help with  java.rmi.UnmarshalException: error unmarshalling

    Hi @ all out there,
    I'm new with Java RMI and have to write a EventSystem for an college project where clients can subscribe to a topic and get notified when someone publishes a message to the subscribed topic.
    At server-side I have a class called EventSystem that provides methods for subscribing and unsubscribing from topics, and also for posting messages (for publishers).
    To subscribe i thought that the client must specify the topic and also itself ( means that a client calls in this way: obj.subscribe("mytopic", this).
    The EventSystem handles a list of all clients, and whenever a new message is posted it goes trough all clients and invokes the handleMessage(String msg) method that all Clients have to provide.
    On my local machine without RMi this concept works just great.
    I now tried to get it working using RMI , but I get the following Exception when starting the client (the server starts fine) :
    Looking up for rmiregistry at 138.232.248.22:1099
    Subscriber exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:336)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
            at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
            at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
            at $Proxy0.subscribe(Unknown Source)
            at SubscriberImpl.main(SubscriberImpl.java:48)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:293)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:713)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1733)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
            at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:290)
            ... 9 more
    Caused by: java.io.InvalidClassException: SubscriberImpl; class invalid for deserialization
            at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:587)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
            ... 13 moreI googled now for 2 hours but can't resolve the problem alone. As far as I can understand I have to serialize Objects that I want to send to the server, right?
    So how can i do this? I've never used serialization till now.
    any ideas how to solve this problem?
    greets from italy and sorry for my very weak english
    bd_italy

    A class has been modified after deployment. Stop the Registry, clean, recompile, and redeploy.

  • JSP client in RMI system - java.rmi.UnmarshalException: error unmarshalling

    Hi,
    Im developing a login part for a distributed airline reservation system using JSP as the client but while executing the jsp, the error that is being catched is :
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: AirlineImpl_Stub (no security manager: RMI class loader disabled)
    Here are my codes:
    //Interface - Airline.java
    package Air;
    import java.rmi.*;
    public interface Airline extends Remote
         public int CheckUname(String username) throws RemoteException;
    }//implementation - AirlineImpl.java
    import java.net.*;
    import java.io.*;
    import java.sql.*;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class AirlineImpl extends UnicastRemoteObject implements Airline
         public AirlineImpl() throws RemoteException
              super();
         public int CheckUname(String username) throws RemoteException
              try
                   int UnameCount = 0;
                   String xxx = "eaglebeta";
                   if(username.equals(xxx)
                        UnameCount++;
                   return UnameCount;
              catch (Exception e3)
                   System.out.println("Error: " + e3);
                   return 0;
    }//Server - AirlineServer.java
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class AirlineServer
         public static void main(String arg[])
              try
                   Airline myAirline = new AirlineImpl();
                   Naming.rebind("Airline", myAirline);
                   System.out.println();
                   System.out.println("************************************");
                   System.out.println(" >>> Airline Reservation System <<< ");
                   System.out.println("    >>> Server is Listening! <<<    ");
                   System.out.println("************************************");
                   System.out.println();
              catch (RemoteException e)
                   //System.out.println("Error: " + e);
                   System.out.println("RMI Registry is not active!");
                   System.out.println("Activate RMI Registry and retry!");
                   System.out.println("Bye bye, exiting...");
              catch (java.net.MalformedURLException e)
                   //System.out.println("URL Error: "+ e);
                   System.out.println("URL Malformed!");
                   System.out.println("Bye bye, exiting...");
    }//JSP client - newuser.jsp
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page import="java.rmi.*, javax.servlet.*" %>
    <%@ page import="java.util.*, java.lang.*, java.io.*, Air.Airline" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#99CCFF">
    <%
    Object Airline = null;
    try
    Airline Air = (Airline)Naming.lookup("rmi://localhost/Airline");
    String Name = "eaglebeta";
    if(Air.CheckUname(Name)>0)
         %>
              Username already exists, choose another name
         <%
    else
         %>
         <%=Name%>
         <%
    catch (Exception e1)
    %>
    <%=e1%>
    <%
    %>
    </body>
    </html>The server, implementation, interface and stub are in a folder named "Airline Server" located on my desktop.
    The interface and stub again are in another folder named "Air" located in the "classes\Air" directory which is located in the tomcat 5.5 installation directory!
    The JSP client is located in the "Root" folder in the tomcat 5.5 installation derectory!
    1. I start the registry in the "Airline Server" folder by typing rmiregistry
    2. Load the Airline Server - java AirlineServer
    3. Call the jsp - http://localhost/newuser.jsp
    And i get the following error:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: AirlineImpl_Stub (no security manager: RMI class loader disabled)
    Please help me to solve this problem!

    When I am including security manager in my JSP code, the browser just get blank without any display
    if(System.getSecurityManager() == null)
         System.setProperty("java.security.policy", "java.policy");
        System.setSecurityManager(new RMISecurityManager());
    }Please, someone solve my problem! Im realy stuck and I don't know how to proceed! Provide me with a solution or any tutorial that would help me...

  • Java.rmi.UnmarshalException: error unmarshalling arguments;

    Hi!
    I'm a newbe with rmi, and I try to use a test program, from Thinking in Java:
    ITiempoPerfecto.java
    package c15.rmi;
    import java.rmi.*;
    interface ITiempoPerfecto extends Remote {
         long obtenerTiempoPerfecto() throws RemoteException;
    TiempoPerfecto.java
    package c15.rmi;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.net.*;
    public class TiempoPerfecto extends UnicastRemoteObject implements ITiempoPerfecto {
         public long obtenerTiempoPerfecto () throws RemoteException {
              return System.currentTimeMillis();
         public TiempoPerfecto() throws RemoteException {
               super();
         public static void main(String[] args) throws Exception {
              System.setSecurityManager(new RMISecurityManager());
              TiempoPerfecto tp=new TiempoPerfecto();
              Naming.bind("//localhost/TiempoPerfecto",tp);
              System.out.println("Preparado para dar la hora");
    }and
    MostrarTiempoPerfecto.java
    package c15.rmi;
    import java.rmi.*;
    import java.rmi.registry.*;
    public class MostrarTiempoPerfecto {
         public static void main(String[] args) throws Exception {
              System.setSecurityManager( new RMISecurityManager());
              ITiempoPerfecto t=(ITiempoPerfecto)Naming.lookup("//localhost/TiempoPerfecto");
              for (int i=0;i<10;i++)
                   System.out.println("Tiempo perfecto: "+t.obtenerTiempoPerfecto());
    }I compile all the files normally.
    Later I do:
    rmiregistry &
    rmic c15.rmi.TiempoPerfecto(This only generate the file TiempoPerfecto_Stub.class, it's ok?)
    Without warnings or errors. But when I try to create a server object
    java c15/rmi/TiempoPerfectoI obtain this:
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.lang.ClassNotFoundException: c15.rmi.TiempoPerfecto_Stub
            at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
            at sun.rmi.transport.Transport$1.run(Transport.java:153)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
            at java.lang.Thread.run(Thread.java:595)
    .......What is the mistake? What may I do to run this programs?
    Thank you!

    You must change your current directory to your class path (EX: java c15/rmi/TiempoPerfecto) then execute command remiregistry.

  • UnmarshalException: error unmarshalling return, java.io.StreamCorruptedExce

    I am developing an application with Jonas and my environment is as follows:
    -Jonas 4.0.0
    -Tomcat 5.0.19 standalone (my web app uses the remote interfaces).
    -I have amongst others those three jars in my web-inf/lib directory:
         *test_guide.jar(my ejb jar)
         *ejb-2_1-api.jar(from jonas)
         *client.jar(from jonas)
    I come across the following error:
    javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested e
    xception is:
            java.io.StreamCorruptedException]
            at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:92)
            at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:98)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at com.softwareag.test_guide.web.util.PGServiceLocator.getRemoteHome(PGServiceLocator.java:82)
            at com.softwareag.test_guide.web.temp.PGSearch.executeNewSearch(PGSearch.java:25)
            at com.softwareag.test_guide.web.temp.PGSearchManagedBean.newSearchAction(PGSearchManagedBean.java:29)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at net.sourceforge.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:113)
            at net.sourceforge.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:65)
            at javax.faces.component.UICommand.broadcast(UICommand.java:109)
            at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:84)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:142)
            at net.sourceforge.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:254)
            at net.sourceforge.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:85)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:97)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
            at java.lang.Thread.run(Thread.java:534)
    Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.io.StreamCorruptedException
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
            at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:88)
            ... 41 more
    Caused by: java.io.StreamCorruptedException
            at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2347)
            at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380)
            at java.io.ObjectInputStream$BlockDataInputStream.skipBlockData(ObjectInputStream.java:2285)
            at java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1795)
            at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1772)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
            ... 43 more
    com.softwareag.test_guide.web.util.PGServiceLocatorException
            at com.softwareag.test_guide.web.util.PGServiceLocator.getRemoteHome(PGServiceLocator.java:92)
            at com.softwareag.test_guide.web.temp.PGSearch.executeNewSearch(PGSearch.java:25)
            at com.softwareag.test_guide.web.temp.PGSearchManagedBean.newSearchAction(PGSearchManagedBean.java:29)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at net.sourceforge.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:113)
            at net.sourceforge.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:65)
            at javax.faces.component.UICommand.broadcast(UICommand.java:109)
            at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:84)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:142)
            at net.sourceforge.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:254)
            at net.sourceforge.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:85)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:97)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
            at java.lang.Thread.run(Thread.java:534)
    package com.softwareag.test_guide.web.temp;
    import java.rmi.RemoteException;
    import java.util.List;
    import com.softwareag.test_guide.TransferObjects.PGQueryTO;
    import com.softwareag.test_guide.web.util.PGFactory;
    * @author Julien Martin
    public class PGSearchManagedBean {
         private String category;
         private List postcodes;
         private String name;
         private boolean commentsExist;
         private String sortOrderCriterion;
         private int minimumNote;
              public String newSearchAction() throws RemoteException { //TODO: Remove that
                   System.out.println("----------within new search action--------------");
                   PGQueryTO query = PGFactory.getQueryInstance(this);
                   PGSearch search = PGFactory.getSearchInstance();
                   String results = search.executeNewSearch(query);
                   return results;
         public String nextAction() throws RemoteException { //TODO: Remove that
              PGSearch search = PGFactory.getSearchInstance();
              String issue = search.next();
              return issue;
         public String previousAction() throws RemoteException { //TODO: Remove that
              PGSearch search = PGFactory.getSearchInstance();
              String issue = search.previous();
              return issue;
         public String getCategory() {
              return category;
         public boolean getCommentsExist() {
              return commentsExist;
         public int getMinimumNote() {
              return minimumNote;
         public String getName() {
              return name;
         public List getPostcodes() {
              return postcodes;
         public String getSortOrderCriterion() {
              return sortOrderCriterion;
         public void setCategory(String string) {
              category = string;
         public void setCommentsExist(boolean bool) {
              commentsExist = bool;
         public void setMinimumNote(int i) {
              minimumNote = i;
         public void setName(String string) {
              name = string;
         public void setPostcodes(List list) {
              postcodes = list;
         public void setSortOrderCriterion(String string) {
              sortOrderCriterion = string;
    package com.softwareag.test_guide.web.util;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Properties;
    import javax.ejb.EJBHome;
    import javax.ejb.EJBLocalHome;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    * @author Julien Martin
    public class PGServiceLocator {
         private InitialContext initialContext;
         private Map cache;
         private Properties props;
         private static PGServiceLocator _instance;
         static {
              try {
                   _instance = new PGServiceLocator();
              } catch (PGServiceLocatorException se) {
                   System.err.println(se);
                   se.printStackTrace(System.err);
         private PGServiceLocator() throws PGServiceLocatorException {
              try {
                   props = new Properties();
                   props.put(Context.INITIAL_CONTEXT_FACTORY,PGConstants.INITIAL_CONTEXT_FACTORY);
                   props.put(Context.PROVIDER_URL,PGConstants.PROVIDER_URL);
                   props.put(Context.SECURITY_PRINCIPAL,PGConstants.SECURITY_PRINCIPAL);
                   props.put(Context.SECURITY_CREDENTIALS,PGConstants.SECURITY_CREDENTIALS);
                   initialContext = new InitialContext(props);
                   cache = Collections.synchronizedMap(new HashMap());
              } catch (NamingException ne) {
                   //throw new PGServiceLocatorException(ne);
                   throw new PGServiceLocatorException();
              } catch (Exception e) {
                   //throw new PGServiceLocatorException(e);
                   throw new PGServiceLocatorException();
         static public PGServiceLocator getInstance() {
              return _instance;
         public EJBLocalHome getLocalHome(String jndiHomeName) throws PGServiceLocatorException {
              EJBLocalHome localHome = null;
              try {
                   if (cache.containsKey(jndiHomeName)) {
                        localHome = (EJBLocalHome) cache.get(jndiHomeName);
                   } else {
                        localHome = (EJBLocalHome) initialContext.lookup(jndiHomeName);
                        cache.put(jndiHomeName, localHome);
              } catch (NamingException nex) {
                   //throw new PGServiceLocatorException(nex);
                   throw new PGServiceLocatorException();
              } catch (Exception ex) {
                   //throw new PGServiceLocatorException(ex);
                   throw new PGServiceLocatorException();
              return localHome;
         public EJBHome getRemoteHome(String jndiHomeName, Class homeClassName) throws PGServiceLocatorException {
              EJBHome remoteHome = null;
              try {
                   if (cache.containsKey(jndiHomeName)) {
                        remoteHome = (EJBHome) cache.get(jndiHomeName);
                   } else {
                        Object objref = initialContext.lookup(jndiHomeName);
                        Object obj = PortableRemoteObject.narrow(objref, homeClassName);
                        remoteHome = (EJBHome) obj;
                        cache.put(jndiHomeName, remoteHome);
              } catch (NamingException nex) {
                   //throw new PGServiceLocatorException(nex);
                   System.out.println("-----------------");
                   nex.printStackTrace();
                   System.out.println("-----------------");
                   throw new PGServiceLocatorException();
              } catch (Exception ex) {
                   //throw new PGServiceLocatorException(ex);
                   throw new PGServiceLocatorException();
              return remoteHome;
    package com.softwareag.test_guide.web.temp;
    import java.rmi.RemoteException;
    import java.util.List;
    import javax.ejb.CreateException;
    import com.softwareag.test_guide.TransferObjects.PGQueryTO;
    import com.softwareag.test_guide.searchEngineEJB.PGSearchEngineListHandlerException;
    import com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandler;
    import com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerHome;
    import com.softwareag.test_guide.web.util.PGServiceLocator;
    import com.softwareag.test_guide.web.util.PGServiceLocatorException;
    import com.softwareag.test_guide.web.util.PGSessionUtil;
    * @author Julien Martin
    public class PGSearch {
         public String executeNewSearch(PGQueryTO query) throws RemoteException { //TODO: remove that exception
              try {
                   //We retrieve the local home object
                   //keep/PGSearchEngineValueListHandlerLocalHome pGSearchEngineHome = (PGSearchEngineValueListHandlerLocalHome) PGServiceLocator.getInstance().getLocalHome("PGSearchEngineValueListHandlerEJBHome_L");
                   PGSearchEngineValueListHandlerHome pGSearchEngineHome = (PGSearchEngineValueListHandlerHome) PGServiceLocator.getInstance().getRemoteHome("PGSearchEngineValueListHandlerEJBHome", PGSearchEngineValueListHandlerHome.class);
                   //We obtain a local interface object from the local home object
                   //keep/PGSearchEngineValueListHandlerLocal pGSearchEngine = pGSearchEngineHome.create();
                   PGSearchEngineValueListHandler pGSearchEngine = pGSearchEngineHome.create();
                   //We put the local interface into the session for later use
                   PGSessionUtil.putSearchEngineEJBIntoSession(pGSearchEngine);
                   //We execute the search
                   boolean containsResults = pGSearchEngine.executeSearch(query);
                   System.out.println("------containsResults------->" + containsResults);
                   //If the search does return results,
                   //1. We fetch the first n elements
                   //2. We put the results into the session
                   //3. We return the following String
                   if (containsResults) {
                        List firstResults = pGSearchEngine.getNextElements(0, 15);
                        PGSessionUtil.putResultsListIntoSession(firstResults);
                        return "displayResults";
                   //If the search does not return results, we return the following String
                   else {
                        return "noResults";
              } catch (CreateException e) {
                   e.printStackTrace();
                   return null;
              } catch (PGServiceLocatorException e) {
                   e.printStackTrace();
                   return null;
              } catch (PGSearchEngineListHandlerException e) {
                   e.printStackTrace();
                   return null;
         public String next() {
              try {
                   //PGSearchEngineValueListHandlerLocal pGSearchEngine = PGSessionUtil.getSearchEngineEJBFromSession();
                   PGSearchEngineValueListHandler pGSearchEngine = PGSessionUtil.getSearchEngineEJBFromSession();
                   List list = pGSearchEngine.getNextElements(15, 20);
                   if (!list.isEmpty()) {
                        return "displayResults";
                   } else {
                        return "endOfResults";
              } catch (RemoteException e) {
                   // TODO Remove that
                   e.printStackTrace();
                   return null;
         public String previous() {
              try {
                   //PGSearchEngineValueListHandlerLocal pGSearchEngine = PGSessionUtil.getSearchEngineEJBFromSession();
                   PGSearchEngineValueListHandler pGSearchEngine = PGSessionUtil.getSearchEngineEJBFromSession();
                   List list = pGSearchEngine.getPreviousElements(15, 20);
                   if (!list.isEmpty()) {
                        return "displayResults";
                   } else {
                        return "endOfResults";
              } catch (RemoteException e) {
                   // TODO Remove that
                   e.printStackTrace();
                   return null;
    }Can anybody help please?
    Thanks in advance,
    Julien Martin.

    Do you use the same version of JDK in EJB container and EJB client ?

  • UnmarshalException:error unmarshalling return;nested exception ClassNotFoun

    Hi,
    I have written a client for an enterprise application. The client communicates with the application using APIs provided by the application that internally make RMI calls to the application server.
    I am getting the following error when the client invokes a remote method.
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: <a.b.c.MyClass>
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:169)The class 'a.b.c.MyClass' is included in the client JAR as well as in the server installation directory. The classes in this directory will be added by server into its classpath automatically. The client and server are running on the same machine but have different classpaths.
    The remote method uses class 'a.b.c.MyClass' in both input parameter and return type.
    This method returns a list of objects found as specified by the input parameters. The input parameter and the result both use the 'a.b.c.MyClass'.
    The code is able to make the call, the server processes the call, but it is failing wihle returning the result. I am not able to understand why it is failing for Unmarshalling the class that it has already (marshalled) used while sending the input parameters.
    The code was working fine previously. I am not able to find out what has made it not working.
    Waiting for your valuable help.
    Providing the complete stack trace for reference
        java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: <package.class>
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:169)
        at wt.method.MethodServerImpl_Stub.invoke(Unknown Source)
        at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:616)
        at wt.fc.PersistenceManagerFwd.find(PersistenceManagerFwd.java:215)
        at ... Client call stack
        at AppSide_Connector.BusObjJavaInterface.poll(BusObjJavaInterface.java:584)
        at AppSide_Connector.AppCalls.poll(AppCalls.java:192)
        at AppSide_Connector.AgentBusinessObjectManager.poll(AgentBusinessObjectManager.java:717)
        at AppSide_Connector.AppPolling.poll(AppPolling.java:310)
        at AppSide_Connector.AppPolling.doPollingContinuousWait(AppPolling.java:574)
        at AppSide_Connector.AppPolling.run(AppPolling.java:137)
        at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.ClassNotFoundException: <package.class>
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:219)
        at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:558)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at wt.fc.QueryResult$ChunkedExternalization.readObject(QueryResult.java:449)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at wt.fc.QueryResult.readExternal(QueryResult.java:156)
        at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at wt.method.MethodResult.readExternal(MethodResult.java:144)
        at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:146)
        ... 15 moreRegards,
    jsk1

    did you get the answer, can you share that, am stuck with similar problem
    My remote call returns an object of some pojo which is generated from the class in a jar file. I get this exception
    Client exception: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: com.xx.fir.xxxx.entity.Crdxx (no security manager: RMI class loader disabled)
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: com.xx.fir.xxxx.entity.Crdxx (no security manager: RMI class loader disabled)
    Also my ant traget:
    <java classname="com.xxx.cache.CacheServiceEndPoint" fork="yes">
    <jvmarg value="-Djava.rmi.server.codebase=file:/${build}/classes/ file:/${lib}/{color:#ff0000}hibernate-credit.jar{color}" />{color:#ff0000} jar file where the pojo resides
    {color}<jvmarg value="-Djava.security.policy=C:/workspace/Cache/policy.all" />
    thx in advance

  • Java Class not found when starting applet with ip address

    Hi @all,
    we use Application Server 10gR2 with Java 1.6.0_20 and we start the applet with an JNLP File.
    When I use the url http://lhhap03/forms/java the applet starts as it should. But when I change the entry to http://192.168.17.208/forms/java i get the error:
    Exception in thread "thread applet-oracle.forms.engine.Main-1" java.lang.NoClassDefFoundError: org/apache/regexp/RE
    Now I´m a little bit confused why i can´t use the ip address instead of the dns name from the server?
    Which config I have to change that i can get the access to jar libraries with the Ip - Address
    Best regards
    thomas

    Problem Solved, I put many environment variables  in the .bash_profile file, the CLASS_PATH will overwrite the weblogic server's classpath during startup.
    Remove them and restart server solved my problem.

  • Error in  bibean applet with latest  JRE

    We have bi bean application developed using Applet It works fine with
    JRE 1.5 or earlier JRE version but when I access same thing in PC that has JRE 1.5.0_09 it gives XML error
    <Line 5, Column 21>: XML-20123: (Fatal Error) '>' Missing from end tag.
    <Line 5, Column 21>: XML-20100: (Fatal Error) Expected 'EOF'.
    java.lang.NullPointerException
         at oracle.dss.persistence.persistencemanager.server.PersistenceManagerSupport.loadFactoryFromXML(PersistenceManagerSupport.java:359)
         at oracle.dss.persistence.persistencemanager.server.PersistenceManagerSupport.<init>(PersistenceManagerSupport.java:157)
         at oracle.dss.persistence.persistencemanager.server.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:88)
         at oracle.dss.persistence.persistencemanager.server.InitPersistenceManagerFactory.getInitialContext(InitPersistenceManagerFactory.java:36)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at javax.naming.directory.InitialDirContext.<init>(Unknown Source)
         at oracle.dss.persistence.persistencemanager.server.InitialPersistenceManager.<init>(InitialPersistenceManager.java:105)
         at oracle.dss.connection.server.drivers.persistence.PersistenceConnectionDriverImpl.connect(PersistenceConnectionDriverImpl.java:150)
         at oracle.dss.connection.server.ConnectionImpl.connect(ConnectionImpl.java:285)
         at oracle.dss.connection.client.Connection.connect(Connection.java:425)
         at oracle.dss.connection.client.Connection.connect(Connection.java:342)
         at oracle.dss.metadataManager.client.MetadataManager.setConnectionObjects(MetadataManager.java:4235)
         at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:924)
         at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:840)
         at oracle.dss.datautil.client.XMLManagerFactory.createQueryManager(XMLManagerFactory.java:196)
         at oracle.dss.datautil.client.ManagerFactoryImpl.lookupQueryManager(ManagerFactoryImpl.java:178)
         at oracle.dss.datautil.client.ManagerFactoryImpl.lookupMetadataManager(ManagerFactoryImpl.java:221)
         at oracle.dss.datautil.client.ManagerFactoryImpl.lookupManager(ManagerFactoryImpl.java:128)
         at edsl.olap.BIView.getMetadataManager(BIView.java:436)
         at edsl.olap.BIView.openView(BIView.java:565)
         at edsl.olap.BIView.jbInit(BIView.java:123)
         at edsl.olap.BIView.init(BIView.java:112)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    BIBeans version 10.1.2.0.1 is certified only with Sun JRE:
    1.3.1_11
    1.4.1_04
    1.4.2_03

  • Error while test applet with jcwde simulator using netbeans

    i make applet using netbeans 6.5.. i have compile class and i get no error and results *.class but while I use netbeans service on Javacard simulator.. while I try to connect with entry aid applet i have an error.
    this is error log
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    + +
    + Cannot connect to simulator. Cause: Exception during creating JavaCardSimulatorAdapter +
    + +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    why this error is happened ?
    thank for your attention.. :D
    By Roni
    Edited by: ronized on Apr 18, 2009 6:35 AM

    Hi,
    As per this part of the trace:
    Exception in SAP Application Integrator occured: Application URL &\#39;:///sap(ZT1KVXBWektldldTeV9QQXBXRjNaWTRBLS1OZmRvZzBRWWY2QmN0WThNUmgqdUlRLS0=)/bc/gui/sap/its/webgui&\#39; is not valid! Please check the protocol and host entries for system &\#39;sapdev&\#39;. at ...
    You can clearly see that the system object 'sapdev' is not configured correctly/at all - you are trying to launch transaction iView
    (WEBGUI) and in order to do so you should configure the 'internet transaction server' category of the system  object
    with the hostname of the ITS server.
    Generally the template is
    <System.Access.ITS.protocol>://<System.Access.ITS.hostname>/sap<ESID>/bc/gui/sap/its/webgui?\....
    So that's why you got
    Please check the protocol and host entries for system ..

  • "Error in Java Launcher. Error while launching program with JVM" when I run dnConfig on a windows instance of AWS

    Hi,
    I've installed Oracle EDQ on an AWS Windows 2008 instance. I installed "EDQ 12.1.3 Quick-Start". The installation went through without a hitch. The Oracle EDQ Application Server, Oracle EDQ Config Store and Oracle EDQ Results Store services are running. However when I run dnConfig to change the 32 bit JVM to the 64 bit version, I get the above error.
    Can anyone help resolve this issue?
    Warm regards
    Feroze Arif

    Hi Feroze,
    A word of warning. You shouldn't be trying to change the bitness whilst the services are running. This will cause you a whole world of problems.
    regards,
    Nick

  • FR error java.rmi.UnmarshalException using grid

    Hello,
    I started using Hyperion Financial Reporting on remote machine and now i installed it on my machine.
    Everything was ok during the installation process. Then i tryed to create a new report with a new grid. When i click on button, FR gives me the following error:
    ; nested exception is:
      java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
      java.io.InvalidClassException: com.hyperion.reporting.graphics.GridObject; local class incompatible: stream classdesc serialVersionUID = -1288366423950156093, local class serialVersionUID = -5245705824007679661
    Can someone explains to me what can i do you to resolve this error?
    During my experiences, it gives me this error only when a report have a grid or when i try to create one.

    I have seen this before where there was a mismatch of versions of FR between server and client, what version/patch are you running?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Java.rmi.UnmarshalException:error

    hi,
    A rmi program does not work on my pc but it worked on others pc there are three programs ie RMIServer.java which is the server application ,RMIClient.java which is the client application and RMIInterface.java which has two methods which are remote all these programs gets compiled but while running it from the dos prompt it gives these errors:
    RemoteException occured in serverthread;nested exception is:java.rmi.UnmarshalException:error unmarshalling arguments;nested exception is:java.lang.ClassNotFoundException:RMIServer_stub
    what is the problem how does it work on others pc and not on mine how should i handle these exception what are the reasons for its occurrance please help

    It might help to start the rmiregistry from the directory where your class files are stored.
    In this case the rmiregistry adds its working directory to its codebase.
    Just keep in mind that the rmiregistry works in a similar fashion to the javac compiler & needs to be able to find the _Stub & _Skel class files.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • UnmarshalException while using prop  java.rmi.server.ignoreStubClasses=true

    I have created a test program to check the behaviour of setting the java.rmi.server.ignoreStubClasses property to true on the server side and not setting this flag on the client side.
    This requirement is due to updation of an already running system, with stubs to a new version without stubs, without shutting down the system.
    The files used by me are given below.
    File Hello.java
    package example.hello;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Hello extends Remote {
    String sayHello() throws RemoteException;
    File Server.java
    package example.hello;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.server.UnicastRemoteObject;
    public class Server implements Hello {
    public Server() {}
    public String sayHello() {
    return "Hello, world!";
    public static void main(String args[]) {
    try {
    LocateRegistry.createRegistry(1099);
    Server obj = new Server();
    Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
    // Bind the remote object's stub in the registry
    Registry registry = LocateRegistry.getRegistry();
    registry.bind("Hello", stub);
    System.err.println("Server ready");
    catch (Exception e)
    System.err.println("Server exception: " + e.toString());
    e.printStackTrace();
    File Client.java
    package example.hello;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    public class Client {
    private Client() {}
    public static void main(String[] args) {
    String host = (args.length < 1) ? null : args[0];
    try {
    Registry registry = LocateRegistry.getRegistry(host);
    Hello stub = (Hello) registry.lookup("Hello");
    String response = stub.sayHello();
    System.out.println("response: " + response);
    } catch (Exception e) {
    System.err.println("Client exception: " + e.toString());
    e.printStackTrace();
    First I run file Server.java using the following script (server.bat)
    java -Djava.rmi.server.ignoreStubClasses=true -classpath .; example.hello.Server
    pause
    Then the client is run using the following script (client.bat)
    java -classpath .; example.hello.Client 132.186.96.210
    pause
    While running the client, the following exception is obtained.
    Client exception: java.rmi.ServerException: RemoteException occurred in server thread; nested except
    java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at example.hello.Client.main(Client.java:52)
    Caused by: java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:243)
    ... 6 more
    I am not able to figure out why this thing is happening, If i also set the property java.rmi.server.ignoreStubClasses=true on the client side everything goes fine. But this I can't do. I can't set the property on the client side as the system is up and already running.
    I am using JDK version 1.5.0_06. Same exception comes under JDK 6.0
    Any help will be highly appreciated.

    I think this is a bug. When you exported the Registry from your server JVM it was also exported with java.rmi.server.ignoreStubClasses=true, but the Registry bootstrap at the client requires the 1.1 stub protocol for compatiblity reasons so you got this error. I would report this on the Bug Parade.
    You could get around it by setting java.rmi.server.ignoreStubClasses after exporting the Registry.
    BTW java.rmi.server.ignoreStubClasses isn't supposed to do anything at the client whether true or false so you can cut your testing space in half.

  • RemoteException: java.rmi.UnmarshalException in jdk 1.4.2

    i'm implementing an RMI over the jdk 1.4.2 (can't do it in the 1.5 or 1.6) i've seen this topic [http://forum.java.sun.com/thread.jspa?threadID=370196&messageID=1808449] but it didn't help me, or i'm doing something wrong...
    i know the RMI code is ok because it runs on java 1.6 (with the automatic generation of stubs and skeletons) but when i change the platform to 1.4 it throws the exception:
    RemoteException: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: servidor.MensageiroImpl_Stub
    the VM is configured to use the -Djava.security.policy=C:\Projecto\Policy\permissions.policy both in the client and server
    please help me :S i've been burning my head with this for 3 days
    i leave my code here:
    The interface:
    package rmiinterface;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Mensageiro extends Remote {
        public void sendMsg(String msg) throws RemoteException;
        public String readMsg() throws RemoteException;
    }the implementation:
    package servidor;
    import rmiinterface.Mensageiro;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class MensageiroImpl extends UnicastRemoteObject implements Mensageiro {
        public MensageiroImpl() throws RemoteException {
            super();
        public void sendMsg(String msg) throws RemoteException {
            System.out.println(msg);
        public String readMsg() throws RemoteException {
            return "This is not a Hello World! message";
    }the server:
    package servidor;
    import rmiinterface.Mensageiro;
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    public class MensageiroServer {
        public MensageiroServer() {
            System.setSecurityManager(new RMISecurityManager());
            try {
                Mensageiro m = new MensageiroImpl();
                java.rmi.registry.LocateRegistry.createRegistry(1099);
                System.out.println("RMI registry successfully initiated");
                Naming.rebind("MensageiroService", m);
                System.out.println("Servidor Online");
            } catch (Exception e) {
                System.out.println("Trouble: " + e.getMessage());
        public static void main(String[] args) {
            new MensageiroServer();
    }and the client:
    package cliente;
    import rmiinterface.Mensageiro;
    import java.rmi.RMISecurityManager;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.rmi.NotBoundException;
    import java.net.MalformedURLException;
    public class MensageiroClient {
        public MensageiroClient() {
        public static void main(String args[]) {
            System.setSecurityManager(new RMISecurityManager());
            try {
                Mensageiro m = (Mensageiro) Naming.lookup("//localhost/MensageiroService");
                System.out.println(m.readMsg());
                m.sendMsg("Hello World!");
            } catch (MalformedURLException e) {
                System.out.println();
                System.out.println("MalformedURLException: " + e.toString());
            } catch (RemoteException e) {
                System.out.println();
                System.out.println("RemoteException: " + e.toString());
            } catch (NotBoundException e) {
                System.out.println();
                System.out.println("NotBoundException: " + e.toString());
            } catch (Exception e) {
                System.out.println();
                System.out.println("Exception: " + e.toString());
    }NOTE: my IDE is Netbeans 6.1. and the client and server are in diffrent projects
    thanks in advance
    Best Regards,
    Carlos Daniel Ribeiro

    the stub and the skeleton are being generated, and they are there, in the server project! i don't know why the class defs for the stub filearen't downloded by the client project...I don't know why you think they will be downloaded. They won't be, unless you're using the codebase feature. The client needs the remote interface and the stub on its classpath, and all classes that the remote interface depends on, and so on recursively until closure. You have to do something about that.
    It works under 1.6 because it doesn't need the stub at all.

  • Please help, I am having java.rmi.UnmarshalException.

    First I would like to show you the interface code i want to implement, following is the code.
    package bis.opencontrol.opcconnector;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import javax.swing.tree.*;
    public interface ReceiveNodeInterface extends Remote
    DefaultMutableTreeNode getRootNode(String x) throws RemoteException;
    The server class which implements this interface is as follows...
    package bis.opencontrol.opcconnector;
    public class RMIServiceToSendNodesHierarchy extends java.rmi.server.UnicastRemoteObject implements ReceiveNodeInterface
    public DefaultMutableTreeNode getRootNode(String x) throws RemoteException
    System.out.println(x);
    return(TimerToGetNodesHierarchy.getRootNode());
    public RMIServiceToSendNodesHierarchy() throws RemoteException
    try
    thisAddress= (InetAddress.getLocalHost()).toString();
    catch(Exception e)
    throw new RemoteException("can't get inet address.");
    thisPort = 1099;
    System.out.println("Starting RMI service at address = "+thisAddress+" and PortNo = "+thisPort);
    System.getProperties().setProperty("java.security.policy", "wideopen.policy");
    if(System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    try
    registry = LocateRegistry.createRegistry(thisPort);
    registry.rebind("RMIServiceToSendNodesHierarchy", this);
    The client class which will send request to server is as follows...
    package tagbrowser;
    public class TagBrowser extends javax.swing.JFrame
    ReceiveNodeInterface rmiServer;
    public TagBrowser() throws MalformedURLException
    getRootNodeIntoTree();
    void getRootNodeIntoTree() throws MalformedURLException
    String text = "Please, send us the root node.";
    try
    registry = LocateRegistry.getRegistry(serverAddress, 1099);
    String[] list = registry.list();
                   if( list == null )
                        throw new RemoteException( "list == null" );
    else
    for (int k=0; k < list.length; k++)
    System.out.println("registry" + k + ": " + list[k].toString());
    System.getProperties().setProperty("java.security.policy", "wideopen.policy");
    if(System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    rmiServer = (ReceiveNodeInterface)(registry.lookup("RMIServiceToSendNodesHierarchy"));
    rootNode = rmiServer.getRootNode(text);
    catch(RemoteException e){
    e.printStackTrace();
    catch(NotBoundException e){
    e.printStackTrace();
    Well, when I run this rmi client application I get this following error...
    registry0: RMIServiceToSendNodesHierarchy
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: bis.opencontrol.opcconnector.ReceiveNodeInterface
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at tagbrowser.TagBrowser.getRootNodeIntoTree(TagBrowser.java:126)
    at tagbrowser.TagBrowser.<init>(TagBrowser.java:39)
    at tagbrowser.Main.main(Main.java:19)
    Caused by: java.lang.ClassNotFoundException: bis.opencontrol.opcconnector.ReceiveNodeInterface
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    ... 4 more
    BUILD SUCCESSFUL (total time: 1 second)

    System.out.println("Starting RMI service at address = "+thisAddress+" and PortNo = "+thisPort);That's not true unless you call super(1099) inside this constructor. So at this point you are printing misleading information.
    System.getProperties().setProperty("java.security.policy", "wideopen.policy");
    if(System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    }You normally don't need a security manager in an RMI server. You can delete all this.
    package tagbrowser;I would expect to see either import bis.opencontrol.opcconnector.* or import bis.opencontrol.opcconnector.ReceiveNodeInterface here. So there is clearly something wrong with your project structure. I suspect you have copied ReceiveNodeInterface from the server package to the client. That isn't valid. The remote interface is the same at both client and server.
    I am having java.rmi.UnmarshalExceptionWell, actually you are having java.lang.ClassNotFoundException: bis.opencontrol.opcconnector.ReceiveNodeInterface
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    due to the error described above. This also implies that bis.opencontrol.opcconnector.ReceiveNodeInterface needs to be available to the client via its classpath, i.e. usually via the same JAR that the client classes are in.

Maybe you are looking for

  • How to  get  a value  from  SARTRE

    hI , I have a requirment, wherein I need to get the value of a field of SARTRE table. How can I get the field value of the table from SARTRE.. Thank u, Bharani

  • Spotlight does't find everything in Mail.app

    Morning. If I want to find something in Mail.app and type the searches item into the search field of Mail.app, not all items containing the string will be found. But if I search for the same item with the system wide Spotlight search I find it. What

  • I'm missing makepkg.conf

    Well, I accidentally deleted /etc/makepkg.conf, and I don't find a sample anywhere. How do I generate a new one?

  • Any ideas? In the history may iPad never crashed but after updating to iOS 5 it crashed every 30 minutes, and browsing is very slow

    Any ideas? In the history may iPad never crashed but after updating to iOS 5 it crashed every 30 minutes, and browsing is very slowAny ideas? In the history may iPad never crashed but after updating to iOS 5 it crashed every 30 minutes, and browsing

  • Skinny Msg Server CPU Peak

    Hi there, I have some problems in a Cisco UC540 with "Skinny Msg Server" having some CPU peaks. During peak all services are unavailable (calls, intermet access, etc. - this UC540 is our internet gateway):   100