UnMarshalled Exception

Hi I'm getting the following error when running my Server App:
RemoteException occurred in server thread; nested exception is:
        java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
        java.lang.ClassNotFoundException: DAO.dataAccessObjectthe DAO class dataAccessObject is the following code: -
* To change this template, choose Tools | Templates
* and open the template in the editor.
import java.sql.*;
import com.sun.rowset.CachedRowSetImpl;
import java.rmi.*;
public interface dataAccessObject extends Remote{
    public String generateConnectionString() throws RemoteException,customErrorPropogation ;
    public String getUserPassword(String username) throws RemoteException,customErrorPropogation  ;
    public void ExecuteDML(String username, String sql) throws RemoteException  ;
    public CachedRowSetImpl executeQuery(String username, String sql) throws RemoteException  ;
    public String executeSingleValueString(String username, String sql) throws RemoteException  ;
    public int executeSingleValueNumber(String username, String sql) throws RemoteException ;
    public Date executeSingleValueDate(String username, String sql) throws RemoteException  ;
}The Server code is: -
* To change this template, choose Tools | Templates
* and open the template in the editor.
package remoteservice;
import java.rmi.registry.LocateRegistry.*;
import java.rmi.registry.*;
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
import DAO.*;
* @author Administrator
public class DataAccessLayer {
  public static void main(String[] args) {
        Registry registry;
        try
            registry =  LocateRegistry.getRegistry();
        DataAccessObjectImpl dao = new DataAccessObjectImpl();
        dataAccessObject stub = (dataAccessObject) UnicastRemoteObject.exportObject(dao,8100);
        registry.bind("DAO", stub);
        System.out.println("Done");
        catch (Exception e)
             System.out.println("error: "+e.getMessage());
}If the dataAccessObjectImpl class would be of use please let me know and i will provide it although it takes up more room then this post can handle (with the other classes)
Thanks In Advance

I just stumbled upon the solution.
By changing my server code registry code to read
* To change this template, choose Tools | Templates
* and open the template in the editor.
package remoteservice;
import java.rmi.registry.LocateRegistry.*;
import java.rmi.registry.*;
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
import DAO.*;
* @author Administrator
public class DataAccessLayer {
  public static void main(String[] args) {
        Registry registry;
        try
            LocateRegistry.createRegistry(8100);
            registry =  LocateRegistry.getRegistry(8100);
        DataAccessObjectImpl dao = new DataAccessObjectImpl();
        dataAccessObject stub = (dataAccessObject) UnicastRemoteObject.exportObject(dao,8100);
        registry.bind("DAO", stub);
        System.out.println("Done");
        catch (Exception e)
             System.out.println("error: "+e.getClass());
}Edited by: InnerDemonJ on Mar 30, 2009 3:00 PM

Similar Messages

  • Strange unmarshalling exception when starting RMI server

    I've run into a strange problem when running my RMI server. It worked fine yesterday, though I made a few changes since then, none of those changes should cause this to happen, as far as I know.
    Here's the exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: pub.interfaces.ClientIface
    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)
    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.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at priv.server.TCMaster.<init>(TCMaster.java:97)
    at priv.server.TCMaster.main(TCMaster.java:71)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: pub.interfaces.ClientIface
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
    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)
    Caused by: java.lang.ClassNotFoundException: pub.interfaces.ClientIface
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
    at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    ... 9 more
    pub.interfaces.ClientIface is in the SAME directory as the RMI server class! What could be causing this?
    NOTE: I'm running this on Redhat Linux 9, jdk 1.5.0_04.

    Usually an unmarshalling exception is caused by the classes not matching up on the server & client end. The classes are there I think, because otherwise it would have thrown a classnotfound exception instead. Can you try actually copying and pasting the classes either from the server to the client or vice versa? I've had weird issues where sometimes the compiler compiles the same class differently in different locations, so your safest bet is to make sure the client & server classes (that you're passing as arguments & returning from the server) are identical.
    Good luck!

  • ClassNotFound , Unmarshalling Exceptions

    My RMI class gives
    ClassNotFound Class.forName("com.mysql.jdbc.Driver");
    UnMarshalling Exception
    I use MySQL
    My project is 3 tire.
    Applet --> Servlet --> RMI --> JDBC
    Plz someone help me to resolve this issue.

    Are you sure that both the client/server are running on java ?
    If yes,
    Check for the list of exposed RMI services and the classes used by them on the port you are using.
    com.mysql.jdbc.Driver must be available for RMI commn

  • I am getting strange exception Unmarshall exception

    Please anybody tell me the solution, I am working on the JSF based web project, it communicates to the RMI server through the tomcat. When I run this project it works fine in the window environment. When I want to shift my application to the Linux, there also it works like charm if I run the RMI server from the Netbeans when ever I run the RMI server in the shell it shows an exception that is
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.net.MalformedURLException: no protocol: /home/naveen/vahan/_build/server/classes/vahanserver/:/home/naveen/vahan/_build/common/classes/vahancommon/
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    So please provide the solution for this problem I am not able to find any results in the Google also......
    Edited by: JNaveen on Oct 31, 2008 3:09 PM

    when I run the same code from the netbeans it works when ever I run the from the Linux shell I am getting the error, I wrote the command like this to call the application
    java -cp $CLASSPATH -Djava.rmi.server.codebase=$CODEBASE -Djava.security.policy=$POLICYFILE nic.rto.vahan.server.main.VahanServerApp
    before this line I am exporting all the required libraries into the CLASSPATH, So please tell me the solution without hesitating..
    ERROR:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.net.MalformedURLException: no protocol: /home/naveen/vahan/_build/server/classes/vahanserver/:/home/naveen/vahan/_build/common/classes/vahancommon/
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    Thanks

  • CLASSPATH, rmiregistry, unmarshalling exceptions and more !!

    Hi all,
    I am close to getting a very simple RMI example to work.
    Basically, this is what I have:
    On one PC, I have both the client and the server. One command prompt downloads the stub from the apache webserver directory. To do this, I use two command prompts/windows: in one, I say "set CLASSPATH="
    and then "rmiregistry". Then in the next command prompt, I do a
    "java -Djava.rmi.codebase=http://localhost/ Djava.security.policy=policy HelloImpl" (NB: policy is a simply, allow-access-to-all policy).
    In another window, I cd into my client directory and do "java -Djava.security.policy=policy -Djava.security.manager HelloClient"
    - this DOES work! Hurrah!
    But it I try and do the same thing, so that the server side part of
    this RMI link is on a remote Sun machine, so that I am calling it from
    a PC, I get "StubNotFoundException". Note that the Sun machine has no CLASSPATHs set, and I get the above exception if I launch rmiregistry and "java -D.....etc." from different directories. If I start them off from the same directory (containing the *.class, stubs/skels and policy files), I get the message that "my object is bound in the registry"...but then I can't download the stub from the server!
    The problem seems to be the definition of Classpaths as, apart from the remote nature of this second try, everything seems to be fine.

    Done that, mate. Sorry it didn't work.
    I've tried a few experiments with my Sun as the server
    and my PC as the client. In this case, even though the client
    gives the usual unmarshalled error, I have put logs of logging calls
    in my Java launcher call on the server. This is what I get:
    elt@joint-elt:~/src/SunsExample$ java -Djava.rmi.server.codebase=http://10.16.58.7:80/ -Djava.security.policy=policy -Djava.rmi.server.logCalls=TRUE -D java.security.manager -Dsun.rmi.server.logLevel=VERBOSE -Dsun.rmi.loader.logLevel=VERBOSE -D,sun.rmi.server.exceptionTrace=TRUE HelloImpl
    Nov 19, 2003 1:37:58 PM sun.rmi.server.UnicastServerRef
    computeMethodHash
    FINER: main: string used for method hash: "sayHello()Ljava/lang/String;"
    Nov 19, 2003 1:37:58 PM sun.rmi.server.UnicastRef newCall
    FINE: main: get connection
    Nov 19, 2003 1:37:58 PM sun.rmi.server.UnicastRef newCall
    FINER: main: create call context
    Nov 19, 2003 1:37:58 PM sun.rmi.server.UnicastRef invoke
    FINER: main: execute call
    Nov 19, 2003 1:37:58 PM sun.rmi.server.UnicastServerRef logCall
    FINER: RMI TCP Connection(1)-10.16.58.7: [10.16.58.7: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(1)-10.16.58.7: name = "[Ljava.rmi.server.ObjID;", codebase = ""
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: (thread context class loader: sun.misc.Launcher$AppClassLoader@169e11)
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: class "[Ljava.rmi.server.ObjID;" found via codebase, defined by null
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(1)-10.16.58.7: name = "java.rmi.server.ObjID", codebase = ""
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: (thread context class loader: sun.misc.Launcher$AppClassLoader@169e11)
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: class "java.rmi.server.ObjID" found via codebase, defined by null
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(1)-10.16.58.7: name = "java.rmi.server.UID", codebase = ""
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: (thread context class loader: sun.misc.Launcher$AppClassLoader@169e11)
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: class "java.rmi.server.UID" found via codebase, defined by null
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(1)-10.16.58.7: name = "java.rmi.dgc.Lease", codebase = ""
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: (thread context class loader: sun.misc.Launcher$AppClassLoader@169e11)
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: class "java.rmi.dgc.Lease" found via codebase, defined by null
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(1)-10.16.58.7: name = "java.rmi.dgc.VMID", codebase = ""
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: (thread context class loader: sun.misc.Launcher$AppClassLoader@169e11)
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: class "java.rmi.dgc.VMID" found via codebase, defined by null
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(1)-10.16.58.7: name = "[B", codebase = ""
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: (thread context class loader: sun.misc.Launcher$AppClassLoader@169e11)
    Nov 19, 2003 1:37:58 PM sun.rmi.server.LoaderHandler loadClass
    FINER: RMI TCP Connection(1)-10.16.58.7: class "[B" found via codebase, defined by null
    Nov 19, 2003 1:37:58 PM sun.rmi.server.UnicastRef done
    FINE: main: free connection (reuse = true)
    HelloServer bound in registry
    <NB: I get no more calls after I try to run the client machine, download the stub, or try to, etc.)
    If this helps, please let me know!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • File marshalling and unmarshalling exception

    Hello All,
    I just want to know that if I have an object which is serialized and another object which is not serialized then it is mandatory to serialize that object in the current example
    For example
    ArrayList is serialized by default.
    So can this particular example run.
    class ABC {
    void go(){
    ArrayList a = new ArrayList();
    a.add(new ABC());
    Do I need to serialize ABC also ?.
    Thanks and regards,
    Sachin

    Why it has to be serialize. If ArrayList is
    serializable then can't it hold the ABC object with
    it ?. It can hold it but it can't serialize it.
    The concept is dead simple really. If you want to Serialize a class then it must implement Serializable. It doesn't matter what the class is inside of or how many classes you have or anything else. Each and every class you want to serialize must implement Serializable.
    Means seems I am confused with serialization.
    Does anyone have a good tutorial on serialization ?.I don't think you really need a tutorial for a straightforward concept like this but http://java.sun.com/docs/books/tutorial/essential/io/providing.html

  • Possible fix for Stubnotfound exception

    It seems like a lot of people are getting errors like
    "Unmarshalling exception", "Classnotfound....Stub", where the generated stubs are not being found by the registry, even though they're clearly there.
    I played around with this, and I thought I'd explain a fix I figured out.
    I tried placing RMIregistry.exe in the same directory as my class files, and in some weird cases, it still gave problems.
    Apparently, java's RMI package allows you to create a registry internally. This would avoid the problem of getting the rmiregistry and your class files to recognize each other.
    Here's what my server code's main method looks like:
    int PORT=1099;
    String servicename="DAservice";
    Registry reg = LocateRegistry.createRegistry(PORT);
    reg.rebind(servicename, server);
    Notice that I'm rebinding using what's returned by createRegistry, not Naming. This requires importing rmi.registry.*
    'server' is a new instance of this class.
    Weird, but on the client end, I had to still use Naming:
    serverurl = "//localhost/DAservice";
    DataAcquisitionService remoteObject = (DataAcquisitionService)Naming.lookup(serverurl);
    where DataAcquisitionService is the name of the interface that the server implements.
    I tried getRegistry, but that gave problems, so Naming works better on the client!
    I didn't have to mess with any of the Djava stuff. I did use both the skel & stub classes (run rmic with the -vcompat option), and I made sure that these class files were in the same directory as my other class files.
    It's weird...I don't understand why I was having problems running Naming.rebind() on the server--it worked in some cases but not on others. That's why I feel that actually creating the registry is better, since everything's handled internally by java. It also saves you the trouble of having to start up the registry before running the server, and you don't need to unbind...when the server stops, so does the registry.
    Anyone have thoughts on Naming vs. LocateRegistry.createRegistry()?

    This is the bad way of doing your job. Consider the situation that you are building large distributed application. How would you place the rmiregistry.exe within the same directory where you classes are? Instead you have to pass the appropriate parameters to your java application at runtime. The parameters you have to feed up are:
    1)java.rmi.server.codebase � This property specifies the locations from which classes that are published by this JVM (for example: stub classes, custom classes that implement the declared return type of a remote method call, or interfaces used by a proxy or stub class) may be downloaded. The value of this property is a string in URL format (or a space-separated list of URLs in 1.2 and later) that will be the codebase annotation for all classes loaded from the CLASSPATH of (and subsequently marshalled by) this JVM.
    2) java.security.policy � specifies the file where you define your application's security policy
    3) rmi.server.hostname � The value of this property represents the host name string that should be associated with remote stubs for locally created remote objects, in order to allow clients to invoke methods on the remote object. In 1.1.7 and later, the default value of this property is the IP address of the local host, in "dotted-quad" format.
    I gave a short hello world example utilizing the above parameters in http://forum.java.sun.com/thread.jspa?threadID=637782&tstart=0
    Ferad Zyulkyarov

  • Unmarshalling Error, badly need to understand.

    Hi all !
    I have a problem I've been trying to solve for some time now. I really really really need help on this !!!
    Have a bean (stateless session) which I call from a servlet (well, a dependent class of my servlet). I can ping the bean (it has the ping() method which return "pong") and it answers properly. But if I need my bean to return a dependent object, then I get an unmarshall exception.
    So here are the details of my implementation. I wil try to give as much details as possible.
    1 - My stateless session bean is called SMbs bean, with according home and remote interfaces.
    2 - The bean container is Inprise AppServer 4.1.1
    3 - The servlet engine is Jakarta Tomkat 4.0 (Catalina).
    4 - All the classes used by the servlet are in jakarta\...\web-app\web-inf\lib
    5 - The bean used dependent classes that are in the package zbapi. These classes, in turn, use classes in the package zbprot. The zbprot package is in the lib directory of my ejbcontainer. The zbapi package is not in my container since the needed classes should be deployed with the bean.
    6 - The client bean is in the jakarte\...\web-app\web-inf\lib directory.
    So :
    The SMbs bean returns a MetaDataImpl which is in the ZBApi package. If I call the ping() method of my bean, it returns the string "pong" properly. But if I call getMetaData() which should return a MetaDataImpl instance (implementing MetaData),
    I get the error :
    java.rmi.MarshalException: CORBA MARSHAL 0[Error unmarshaling value [Could not g
    et class for repository id = RMI:com.zerobase.api.scenarios.data.MbsMetaDataImpl
    :71DA8BE7F971128]]
    So what am I doing wrong ?
    I found a way to make this work :
    If I put the ZBAPI package AND the DEPLOYED jar in my jakarta\lib dir (which is not the same as web-app...), then I can do whatever I want with the bean. However, this is not a clean solution. I think that all my jar files should be in the web-app\... directory, not in the webserver's main lib directory...
    I really need help on this, I know it has been adressed some time ago but the answer didn't help me...
    Maxime Poulin.

    Well, here is what I've got. I will just describe what I have (and seems relevant). Afterward, I answer your questions :
    So just to recap. The bean has the method public Tester getTest(). Tester is an interface and is in the package com.zb.api.data . TesterImpl implements Tester and is in the same package. If the bean method is public TesterImpl getTest(), everything works, but if it returns a Tester, then it crashes.
    In the deployed jar, both the class and the interface are present. (In Inprise's EJB Container). In Tomcat (client side), the com.zb.api.data package is in the lib directory of my web-app (...\webapp\web-inf\lib). My client app can use it at will. In this dir, I also have the bean client jar. However, when it is created, the client jar does not contain the TesterImpl if the bean method returns a Tester. I have to add it manually.
    Anyways, seems to me that everything is at the right place : the client side can access both the class and the interface, the ejb container accesses to these classes as well, the jars are of the same version... There is really something strange about this all.
    So :
    How do your client know how to handle the returned object ?[Max] : The client know it will receive a Tester implementor. Tester and TesterImpl are available to the client.
    Do you keep the implementation in the client jar[Max] : Yes, but if my bean returns a Tester (instead of TesterImpl), then TesterImpl is not in the client jar and I have to add it manually. (You mean the EJB Client Jar right ?)
    Otherwise, do you have som kind of code base to download from?[Max] : No... Err, I do not know about that... What is it ?
    Thank you very very much for your reply ! You seem to be more confortable than me with EJBs ! Hopefully, a solution to this will be found !
    M.

  • New problem from unmarshalling

    I have been encountering problem with unmarshalling when trying to run my RMI server. After reading many of the similar problem threads, I've changed the way running "rmiregistry". Now, I unset CLASSPATH before running rmiregistry before running my Server.
    I still get the usual unmarshalling exception
    C:\java\projects\rmi_ex2>myRMIServer
    C:\java\projects\rmi_ex2>java -Djava.security.policy=wideopen.policy -Djava.rmi.
    server.codebase=file:/c:/java/projects/rmi_ex2/ myRMIServer
    Exception occurred: java.rmi.ServerException: Server RemoteException; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is: java.lang.ClassNotFoundException: myRMIImpl_Stub
    But I also get this from the rmiregistry window
    C:\java\projects\rmi_ex2>rmiregistry
    security properties not found. using defaults.
    Default cache directory c:\j2sdk1.4.1\jcache not found. JAR caching disabled.
    MimeTable.load: file = c:\j2sdk1.4.1\lib\content-types.properties, java.io.FileN
    otFoundException: c:\j2sdk1.4.1\lib\content-types.properties
    java.io.FileNotFoundException: c:\j2sdk1.4.1\lib\content-types.properties
    at java.io.FileInputStream.<init>(FileInputStream.java:56)
    at java.io.FileInputStream.<init>(FileInputStream.java:75)
    at sun.net.www.MimeTable.load(MimeTable.java:212)
    at sun.net.www.MimeTable.<init>(MimeTable.java:43)
    at sun.net.www.MimeTable.getDefaultTable(MimeTable.java:52)
    at sun.net.www.protocol.file.FileURLConnection.connect(Compiled Code)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
    nection.java:162)
    at sun.net.www.protocol.http.HttpURLConnection.openConnectionCheckRedire
    cts(Compiled Code)
    at sun.applet.AppletClassLoader.loadClass(Compiled Code)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:630)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:226)
    at sun.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:152)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
    a:90)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
    :711)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:225)
    at java.io.ObjectInputStream.inputObject(Compiled Code)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:344)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:225)
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:98
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:164)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:154)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Compiled Code)
    at sun.rmi.transport.tcp.TCPTransport.run(Compiled Code)
    at java.lang.Thread.run(Thread.java:466)
    Any tips, ideas would be greatly appreciated as I have spend days on this problem!
    Ku

    Hi,
    you should try to use:
    1) Server
    java -Djava.security.policy=wideopen.policy
    -Djava.rmi.server.codebase=file:c:\java\projects\rmi_ex2\
    myRMIServer
    2) Client
    java -Djava.security.policy=wideopen.policy
    -Djava.rmi.server.codebase=file:c:\java\project\rmi_ex2\
    RMIClient
    Bye
    Filippo

  • Exception whilst consuming a Webservice!

    Hi,
    I am new to webservices. I consume a webservice and while testing the created proxy i am getting an excpetion like this.
    SoapFaultCode:1 JAXB unmarshalling exception: Unable to create an instance of de.te****************blw.v2.MeldungType; neste
    d exception is javax.xml.bind.UnmarshalException: Unable to create an instance of de.te****************blw.v2.MeldungType-
    +with linked exception: [java.lang.InstantiationException]+
    The type meldung type was of type abstract="true" in the xsd as shown below.
    {color:#ff0000}<xsd:complexType name="MeldungType" abstract="true">
    <xsd:annotation>
    <xsd:documentation>
    Abstrakter Basistyp f&uuml;r alle Meldungen. Jeder Meldungstyp ist in einer eigenen Ableitung definiert.
    </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="Meldungsnummer" type="bt:MeldungsnummerType">
    <xsd:annotation>
    </xsd:sequence>
    </xsd:complexType>
    {color}{color:#000000}In the service call i used a type derived from it ie. one which extends from the MeldungType.
    Could this be a problem in getting the above exception.
    Comments requested.
    Regards
    Sandeep{color}

    I think you had hitted a bug here.
    In order to address the issue apply patch from Bug 17246737.Steps to download and apply the patch are listed below:
    Go to MOS and search for the bug 17246737
    1) Log onto My Oracle Support.
    2) Click on the "Patches & Updates" tab.
    3) Click on "Patch Name, Number (the default).
    4) For the "Patch Name or Number" type in the patch number (for example: 17246737).
    5) Choose the "Platform" or (Select the default which is "Select up to 5" for any platforms)
    6) Hit Search.
    Thanks
    Ranjan

  • JAXB - Unexpected end of element {} - UnmarshalException Exception

    Hi
    I am using Jaxb 1.0 Beta on AIX an I am getting javax.xml.bind.UnmarshalException exception when I try to unmarshall XML document. XML document and schema are valid ( I generated both using XML spy )
    Interestingly, the code works fine on windows 2000 but when I put the jar ,XML schema and xml document on unix it throws Unmarshall exception.
    Here's what I am trying to do.
    Code :
    JAXBContext jc =
    JAXBContext.newInstance( context,
    new com.xyz.retail.app.points.pgp.JAXBClassLoader());
    if(jc != null)
         System.out.println("Got the context");
    else
         System.out.println("Error in getting context");
    System.out.println("");
    // create an Unmarshaller
    Unmarshaller u = jc.createUnmarshaller();
    System.out.println("Created the Unmarshaller");
    System.out.println("");
    // Unmarshal securities document into Java content tree
    SecurityInfo securityInfo =
         (SecurityInfo)u.unmarshal( new FileInputStream( secFile ) );
    System.out.println("Unmarshaled the Document");
    System.out.println("");
    Schema :
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by Yogesh
    -->
    <xs:schema targetNamespace="http://www.xyz.com/retail/app/points/pgp/util"
    xmlns="http://www.xyz.com/retail/app/points/pgp/util" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="SecurityInfo" type="SecurityInfoType"/>
    <xs:complexType name="SecurityInfoType">
    <xs:sequence>
    <xs:element ref="AirlinePartners"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="AirlinePartners">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="AirlinePartner" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="AirlinePartner">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="CardType" type="xs:string"/>
    <xs:element name="Description" type="xs:string" minOccurs="0"/>
    <xs:element name="TPrivate" type="xs:string"/>
    <xs:element name="TPassphrase" type="xs:string"/>
    <xs:element name="APublic" type="xs:string"/>
    <xs:element name="PlainText" type="xs:string"/>
    <xs:element name="CypherText" type="xs:string"/>
    <xs:element name="TKeyExpiry" type="xs:date" min
    Occurs="0"/>
    <xs:element name="AKeyExpiry" type="xs:date" min
    Occurs="0"/>
    </xs:sequence>
    </xs:complexType>
    /xs:element>
    </xs:schema>
    XML File :
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by Yogesh
    -->
    <!--Sample XML file generated by XMLSPY v5 rel. 2 U (http://www.xmlspy.com)-->
    <SecurityInfo xmlns="http://www.xyz.com/retail/app/points/pgp/util"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
    "http://www.xyz.com/retail/app/points/pgp/util /home/lcards/temp/APSecInfo.xsd">
    <AirlinePartners>
    <AirlinePartner>
    <CardType>x</CardType>
    <Description>some card</Description>
    <TPrivate>/home/lcards/temp/sachin.asc</TPrivate>
    <TPassphrase>worldcup2003</TPassphrase>
    <APublic>/home/lcards/temp/sunil.asc</APublic>
    <PlainText>/home/lcards/files/outbox/x</PlainText>
    <CypherText>/home/lcards/files/outbox/x</CypherText>
    <TKeyExpiry>2005-08-15</TKeyExpiry>
    <AKeyExpiry>2005-08-15</AKeyExpiry>
    </AirlinePartner>
    <AirlinePartner>
    <CardType>y</CardType>
    <Description>Another card</Description>
    <TPrivate>/home/lcards/temp/kapil.asc</TPrivate>
    <TPassphrase>worldcup1983</TPassphrase>
    <APublic>/home/lcards/temp/dilip.asc</APublic>
    <PlainText>/home/lcards/files/outbox/y</PlainText>
    <CypherText>/home/lcards/files/outbox/y</CypherText>
    <TKeyExpiry>2005-08-15</TKeyExpiry>
    <AKeyExpiry>2005-08-15</AKeyExpiry>
    </AirlinePartner>
    </AirlinePartners>
    </SecurityInfo>
    Output:
    Got the context
    Created the Unmarshaller
    DefaultValidationEventHandler: [ERROR]: Unexpected end of element {}:CardType
    javax.xml.bind.UnmarshalException: Unexpected end of element {}:CardType
    at com.sun.xml.bind.unmarshaller.UnreportedException.createUnmarshalExce
    ption(UnreportedException.java:59)
    at com.sun.xml.bind.unmarshaller.SAXUnmarshallerHandlerImpl.reportAndThr
    ow(SAXUnmarshallerHandlerImpl.java:406)
    at com.sun.xml.bind.unmarshaller.SAXUnmarshallerHandlerImpl.endElement(S
    AXUnmarshallerHandlerImpl.java:108)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
    n Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
    Dispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
    known Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(Unmarshaller
    Impl.java:139)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnm
    arshallerImpl.java:129)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnm
    arshallerImpl.java:166)
    at com.xyz.retail.app.points.pgp.APSecurityInfoFactory.getAPSecInfo
    (APSecurityInfoFactory.java:102)
    at com.xyz.retail.app.points.pgp.EncryptAndSign.init(EncryptAndSign
    .java:183)
    at com.xyz.retail.app.points.pgp.EncryptAndSign.encrypt(EncryptAndS
    ign.java:581)
    at com.xyz.retail.app.points.pos.CreateExportFiles.main(CreateExpor
    tFiles.java:149)
    Inside readKeys()
    java.lang.NullPointerException
    at com.xyz.retail.app.points.pgp.EncryptAndSign.readKeys(EncryptAnd
    Sign.java:215)
    at com.xyz.retail.app.points.pgp.EncryptAndSign.encrypt(EncryptAndS
    ign.java:583)
    at com.xyz.retail.app.points.pos.CreateExportFiles.main(CreateExpor
    tFiles.java:149)
    Inside buildCypherTextFileName()
    java.lang.NullPointerException
    at com.xyz.retail.app.points.pgp.EncryptAndSign.buildCypherTextFile
    Name(EncryptAndSign.java:311)
    at com.xyz.retail.app.points.pgp.EncryptAndSign.encrypt(EncryptAndS
    ign.java:667)
    at com.xyz.retail.app.points.pos.CreateExportFiles.main(CreateExpor
    tFiles.java:149)
    Exception in Main method
    Thanks in advance for any help.
    Yogesh.

    I'm having error. I'm using the lastest JWSDP (1.3) with JDK 1.4.2
    Here is my XML file:
    <?xml version="1.0"?>
    <dataQA>
    <table name="ELECTORAL_DISTRICT" >
    <rules>
    <rule number="1.1" description="Check if we have 301 EDs" >
    <query result="301" >
         <sql>SELECT COUNT(ED_ID) FROM ELECTORAL_DISTRICT</sql>
    </query>
    </rule>
    <rule number="1.3" description="All fields must be populated" >
    <query result="0" >
    <sql>SELECT COUNT(ED_ID) FROM ELECTORAL_DISTRICT WHERE ED_CODE IS NULL OR ED_NAMEE IS NULL OR ED_NAMEF IS NULL</sql>
    </query>
    </rule>
    </rules>
    <reports>
    <report number="1.4" name="Listing of EDs" file="ed_list" format="HTML" >
         <column name="ED_ID" label="ID" ></column>
         <column name="ED_CODE" label="Code" ></column>
         <column name="ED_NAMEE" label="English Name" ></column>
         <column name="ED_NAMEF" label="French Name" ></column>
         <column name="PRVNC_ID" label="Province ID" ></column>
    </report>
    </reports>
    </table>
    </dataQA>
    And my shema:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="dataQA" type="DataQAType"/>
    <xsd:complexType name="DataQAType">
    <xsd:sequence>
    <xsd:element name="table" type="TableType" minOccurs="1" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="TableType">
    <xsd:sequence>
    <xsd:element name="rules" type="RulesType" />
    <xsd:element name="reports" type="ReportsType" />
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:string" />
    </xsd:complexType>
    <xsd:complexType name="RulesType">
    <xsd:sequence>
    <xsd:element name="rule" minOccurs="1" maxOccurs="unbounded" >
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="query" type="QueryType" />
    </xsd:sequence>
    <xsd:attribute name="number" type="xsd:string" />
         <xsd:attribute name="description" type="xsd:string" />
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ReportsType">
    <xsd:sequence>
    <xsd:element name="report" minOccurs="1" maxOccurs="unbounded" >
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="column" type="ColumnType" minOccurs="1" maxOccurs="unbounded" />
    <xsd:element name="condition" type="xsd:string" />
    </xsd:sequence>
    <xsd:attribute name="number" type="xsd:string" />
    <xsd:attribute name="name" type="xsd:string" />
    <xsd:attribute name="file" type="xsd:string" />
    <xsd:attribute name="format" type="xsd:string" />
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ColumnType">
    <xsd:attribute name="name" type="xsd:string" />
    <xsd:attribute name="label" type="xsd:string" />
    </xsd:complexType>
    <xsd:complexType name="QueryType">
    <xsd:sequence>
    <xsd:element name="sql" type="xsd:string" />
    </xsd:sequence>
    <xsd:attribute name="result" type="xsd:string" />
    </xsd:complexType>
    </xsd:schema>
    I get the following exception:
    DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:report
    Location: line 23 of file:/D:/Revise2.5/DataQA/config/test.xml
    javax.xml.bind.UnmarshalException: Unexpected end of element {}:report
    I'm currenlty in the processing of writting parser with DOM since I haven't found the yet. Is this a bug or I'm doing something wrong.
    Thanks in advance for the reply,
    - N. Thomassin

  • Intermittent Unmarshal / ClassNotFound exceptions in 6.1sp1

    Our application is a fairly straightforward web/ejb app with 6 stateless session
    beans, everything deployed in a .ear file.
    In our domain log file we're seeing intermittent unmarshalling exceptions whose
    root causes are ClassNotFoundExceptions. These are always when the EJBs throw
    a checked exception to the web app. However, it does not happen every time the
    EJBs throw an exception of a particular type. In fact, most of the time there
    is no problem - the web app gets the exception unmarshalled just fine and logs/displays
    the accompanying info just fine. I can look at the timestamps in the domain log
    file and our app log file and see within a minute either way of each other exceptions
    that unmarshalled fine and one or two that had the problem. If I had to guess,
    the unmarshal problem happens perhaps 1 out of every 25 times, maybe less.
    Any ideas on why this would be happening? It's a problem because our code (rightly,
    IMO) treats those unmarshal exceptions as serious problems, rendering a "Call
    the Help Desk" message.
    Thanks,
    Donnie

    Our application is a fairly straightforward web/ejb app with 6 stateless session
    beans, everything deployed in a .ear file.
    In our domain log file we're seeing intermittent unmarshalling exceptions whose
    root causes are ClassNotFoundExceptions. These are always when the EJBs throw
    a checked exception to the web app. However, it does not happen every time the
    EJBs throw an exception of a particular type. In fact, most of the time there
    is no problem - the web app gets the exception unmarshalled just fine and logs/displays
    the accompanying info just fine. I can look at the timestamps in the domain log
    file and our app log file and see within a minute either way of each other exceptions
    that unmarshalled fine and one or two that had the problem. If I had to guess,
    the unmarshal problem happens perhaps 1 out of every 25 times, maybe less.
    Any ideas on why this would be happening? It's a problem because our code (rightly,
    IMO) treats those unmarshal exceptions as serious problems, rendering a "Call
    the Help Desk" message.
    Thanks,
    Donnie

  • How to add exactly 2 NON XML caracters at the end of a SOAP body

    Hello all I am trying to add two (and only two) extra non xml caracters "AA" at the END of a SOAP body using the JAXWS handlers as so:
    HTTP/1.1 200 OK
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 131
    Content-Length: 131
    Server: Jetty(7.x.y-SNAPSHOT)
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>
    AA
    The problem is that if you try to add them to the SOAP body (see code below) you get a XML Unmarshalling exception. If I add "AA" as a soap attachment I get MORE than 2 caracters after the SOAP body (which I don't want)
    Here is the my SOAPHandler code :
    @Override
    public boolean handleMessage(SOAPMessageContext mc) {
    if (Boolean.TRUE.equals(mc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) {
    try {
    SOAPMessage message = context.getMessage()
    String stringSoapMessage= getMsgAsString(message);
    stringSoapMessage += "ss";
    message.getSOAPPart().setContent((Source) new StreamSource(new ByteArrayInputStream(msg.getBytes())));
    message.saveChanges();
    context.setMessage(message);
    } catch (Exception e1) {
    return true;
    public String getMsgAsString(SOAPMessage message) throws SOAPException {
    String msg = null;
    try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    message.writeTo(baos);
    msg = baos.toString();
    } catch (Exception e) {
    e.printStackTrace();
    return msg;
    so my question is this: is there any way to add exactly 2 non xml caracters at the end of the soap body using jaxws handlers ? I have spent several weeks on this so it is not an easy question...
    Thanks,
    Fred.

    Yes I have done it using CFX interceptors. But the runtime dependencies needed were too big for this particular use. I mean having to use these:
    apache/cxf/cxf-bundle/2.6.0/cxf-bundle-2.6.0.jar
    org/apache/neethi/neethi/3.0.2/neethi-3.0.2.jar                    
    wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar
    /org/codehaus/woodstox/wstx-asl/3.2.4/wstx-asl-3.2.4.jar
    org/apache/ws/xmlschema/xmlschema-core/2.0.2/xmlschema-core-2.0.2.jar
    org/mortbay/jetty/jetty-util/6.0.2/jetty-util-6.0.2.jar
    org/eclipse/jetty/jetty-util/7.5.4.v20111024/jetty-util-7.5.4.v20111024.jar
    org/apache/geronimo/specs/geronimo-servlet_2.5_spec/1.1.2/geronimo-servlet_2.5_spec-1.1.2.jar
    org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.7.1/geronimo-javamail_1.4_spec-1.7.1.jar
    org/apache/geronimo/specs/geronimo-servlet_3.0_spec/1.0/geronimo-servlet_3.0_spec-1.0.jar
    org/eclipse/jetty/jetty-http/7.5.4.v20111024/jetty-http-7.5.4.v20111024.jar
    org/eclipse/jetty/jetty-server/7.5.4.v20111024/jetty-server-7.5.4.v20111024.jar
    org/eclipse/jetty/jetty-io/7.5.4.v20111024/jetty-io-7.5.4.v20111024.jar
    org/eclipse/jetty/jetty-continuation/7.5.4.v20111024/jetty-continuation-7.5.4.v20111024.jar
    to add two caracters at the end of a soap message seems like over kill. If this is the only way to do this then i'll do it this way but it just seems like the implementation of the JAXWS API in JDK 6 seems inches away from being able to do this no ?
    Thanks for the replies,
    Fred

  • Error Consuming a webservice from ABAP

    Hi all,
      I am consuming an external webservice from abap. I created teh proxy using WSDl file. While testing teh service its giving an exception like this-
    "JAXB unmarshalling exception: Unable to create an instance of de.*******v2.MeldungType; nested exception is javax.xml.bind.UnmarshalExcept
    ion: Unable to create an instance of de.****.MeldungType# - with linked exception:#[java.lang.InstantiationException]"
    With a soapfaultcode: 1..
    can any one help out in arriving at teh reason for this..
    Regards
    Sandeep

    I've seen lots of unmarshalling errors whilst trying to consume web services via Web Dynpro Java...  Usually, it was due to an inconsistency between the WSDL file being used and the underlying web service definition.  It might be worth checking the WSDL you are using is correct and up to date, in case the underlying service interface has changed.
    Also worth checking if you have any simple boolean type parameters defined as part of the service interface - they have to have a value assigned when you call the service and cannot be null.
    HTH.

  • RMI UnmarshalException Occurs after some time

    Hi,
    I have a client server application that talks via rmi. My client saves data to a server or gets data by passing in parameters that include string, boolean and a Hashtable. The data is saved and retrieved many times. However, after some time, the RMI can't even find the method. That is, the client calls a method and I get a unmarshalling exception from the client, basically stating that it can't find the method.
    Here is the method in my interface, the method in question is the override method, the getLast works fine all the time:
    public interface Admin extends Remote
         Hashtable getLast(Hashtable setLashtHash) throws RemoteException;
    //override method can query or set a new data in the form of a hashtable. It return a Hashtable or null
         Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException;
    Here's the implementation of override:
         synchronized public Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException
              try{
              if(setNew)
                   if(newOverride!=null)
                   System.out.println("Saving override hash, entries=" + newOverride.size());
                   overrideHash=newOverride;
              else if(getOverrideHash)
                   if(overrideHash!=null)
                   System.out.println("Getting override hash entries=" + overrideHash.size());
                   return overrideHash;
              else
                   if(getLast)
                        if(overrideHash==null)
                             System.out.println("override hash is null");
                             return null;
                        OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
                        if(os.last!=null)
                             System.out.println("Last price for ticker " + ticker + " is=" +os.last);
                             Float last=os.last;
                             return last;
                        return null;
                   else if(getPrevious)
                        if(overrideHash==null)
                             return null;
                        OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
                        if(os.previous!=null)
                             Float previous=os.previous;
                             return previous;
                        return null;
         }catch(Exception e)
              System.out.println("Unknown Exception caught in override function");
              e.printStackTrace();
              return null;
    Here is the exception, please help.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: invalid method hash
    java.rmi.UnmarshalException: invalid method hash
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
    n Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at AdminImpl_Stub.override(Unknown Source)
    at StocksTable$12.run(stockstable.java:481)
    Please help,
    Thanks Steve

    By the way, this is how my server calls the client:
    Hashtable otable=(Hashtable)a1.override(false,new String(""),true,false,false,new Hashtable());

Maybe you are looking for

  • MAC MINI late 2012 running slow on Yosemite.

    here is the  Entre check but I am not sure how to read it ... do I just need to Upgrade Ram? The Mac Hasn't been the same since I tried to install open frameworks,  I could get it to run so uninstalled, but after upgrading to Yosemite its been runnin

  • Re Installing Photoshop on my computer

    I had a trial version of Photoshop and just bought the Cloud subscription.  I had not seen the upgrade to license so when it would not download I thought i needed to delete the trial version.  Now i can't get it to download - how do i get it back on

  • Pictures from LR to I-movie...HELP, please! :)

    Hi all. First post here. You seem to all be so helpful that I know I will get a quick reply! I know I can't export photos from Lightroom into I-movie, but that I drag them into it, right?  So, 2 important questions regarding that:  1)  How do I highl

  • User defined aerospace functions/icons

    Im looking to see if anyone knows of user defined (?) aerospace icons/functinos. I'd like to represent column/wheel inputs and flap/elevator/aileron outputs with representative icons (e.g surface i.e flap icons instead of just waveform graphs). Does

  • Does anyone work here? Photoshop Elements 10 still not loading. No response from Adobe :(

    This is the error message I get - in case anyone's interested. Adobe has to have the worst Customer service I've ever come across - because it's non existent. Microsoft Visual C++ Runtime Library Runtime Error! Program: C:\Program Files (x... This ap