Re: javaspace error - transaction

John McClain <[email protected]> Tue, 17 Mar 2009 15:15:59 -0400
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
I think your problem is that you have mahalo.jar in your client's 
classpath. This causes the codebase of the transactions to get lost. 
This presentation tries to explain what is (probably) going on :

    https://user-jwfmcclain.dev.java.net/codebase/codebase.htm

This presentation is from a long time ago before Jini introduced 
net.jini.loader.pref.PreferredClassLoader, generally 
PreferredClassLoader makes this sort of problem go away, but in the 
context of eclipse you may need to take some additional steps to make 
sure the PreferredClassLoader is used by the client.
 
SUBSCRIBE JAVASPACES-USERS Anonymous wrote:
> Hi all,
>
> I have the following exception in my program...
>
> java.rmi.ServerException: RemoteException in server thread; nested exception is:
> java.rmi.UnmarshalException: unmarshalling method/arguments; nested
> exception is:
> java.lang.ClassNotFoundException:
> com.sun.jini.mahalo.TxnMgrProxy$ConstrainableTxnMgrProxy
> at
> net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:644)
> at com.sun.jini.jeri.internal.runtime.ObjectTable$6.run(ObjectTable.java:597)
> at net.jini.export.ServerContext.doWithServerContext(ServerContext.java:103)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch0(ObjectTable.java:595)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.access$700(ObjectTable.java:212)
> at com.sun.jini.jeri.internal.runtime.ObjectTable$5.run(ObjectTable.java:568)
> at
> com.sun.jini.start.AggregatePolicyProvider$6.run(AggregatePolicyProvider.java:527)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:565)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:540)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$RD.dispatch(ObjectTable.java:778)
> at
> net.jini.jeri.connection.ServerConnectionManager$Dispatcher.dispatch(ServerConnectionManager.java:148)
> at com.sun.jini.jeri.internal.mux.MuxServer$2.run(MuxServer.java:244)
> at
> com.sun.jini.start.AggregatePolicyProvider$5.run(AggregatePolicyProvider.java:513)
> at java.security.AccessController.doPrivileged(Native Method)
> at com.sun.jini.jeri.internal.mux.MuxServer$1.run(MuxServer.java:241)
> at com.sun.jini.thread.ThreadPool$Worker.run(ThreadPool.java:136)
> at java.lang.Thread.run(Thread.java:619)
> at
> com.sun.jini.jeri.internal.runtime.Util.__________EXCEPTION_RECEIVED_FROM_SERVER__________(Util.java:108)
> at
> com.sun.jini.jeri.internal.runtime.Util.exceptionReceivedFromServer(Util.java:101)
> at
> net.jini.jeri.BasicInvocationHandler.unmarshalThrow(BasicInvocationHandler.java:1303)
> at
> net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:832)
> at
> net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659)
> at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
> at com.sun.jini.outrigger.$Proxy2.write(Unknown Source)
> at com.sun.jini.outrigger.SpaceProxy2.write(SpaceProxy2.java:296)
> at myxml.main(myxml.java:48)
> Caused by: java.rmi.UnmarshalException: unmarshalling method/arguments;
> nested exception is:
> java.lang.ClassNotFoundException:
> com.sun.jini.mahalo.TxnMgrProxy$ConstrainableTxnMgrProxy
> at
> net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:619)
> at com.sun.jini.jeri.internal.runtime.ObjectTable$6.run(ObjectTable.java:597)
> at net.jini.export.ServerContext.doWithServerContext(ServerContext.java:103)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch0(ObjectTable.java:595)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.access$700(ObjectTable.java:212)
> at com.sun.jini.jeri.internal.runtime.ObjectTable$5.run(ObjectTable.java:568)
> at
> com.sun.jini.start.AggregatePolicyProvider$6.run(AggregatePolicyProvider.java:527)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:565)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:540)
> at
> com.sun.jini.jeri.internal.runtime.ObjectTable$RD.dispatch(ObjectTable.java:778)
> at
> net.jini.jeri.connection.ServerConnectionManager$Dispatcher.dispatch(ServerConnectionManager.java:148)
> at com.sun.jini.jeri.internal.mux.MuxServer$2.run(MuxServer.java:244)
> at
> com.sun.jini.start.AggregatePolicyProvider$5.run(AggregatePolicyProvider.java:513)
> at java.security.AccessController.doPrivileged(Native Method)
> at com.sun.jini.jeri.internal.mux.MuxServer$1.run(MuxServer.java:241)
> at com.sun.jini.thread.ThreadPool$Worker.run(ThreadPool.java:136)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException:
> com.sun.jini.mahalo.TxnMgrProxy$ConstrainableTxnMgrProxy
> 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:307)
> at
> net.jini.loader.pref.PreferredClassLoader.loadClass(PreferredClassLoader.java:922)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> net.jini.loader.pref.PreferredClassProvider.loadClass(PreferredClassProvider.java:613)
> at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138)
> at net.jini.io.MarshalInputStream.resolveClass(MarshalInputStream.java:296)
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
> at com.sun.jini.jeri.internal.runtime.Util.unmarshalValue(Util.java:221)
> at
> net.jini.jeri.BasicInvocationDispatcher.unmarshalArguments(BasicInvocationDispatcher.java:1049)
> at
> net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:599)
> ... 17 more
>
>
>
> I am using jini2_1 service and eclipse to run the javaspace program. I have
> already added the jar files like mahalo,reggie .. in Java Build path of my
> program. But still I am getting CLASS NOT FOUND EXCEPTION...
> com.sun.jini.mahalo.TxnMgrProxy$ConstrainableTxnMgrProxy
>
>
> I tried to debug the program, the thing which I felt suspicious is following:
>
> In my program the JAVASPACE service is running properly. I am using
> lookupdiscovery mechanism in jini. The lookup discovery mechanism is having
> a class Listener that implements DiscoveryListener and proxy generated by
> lookup() method inside discovered() method
>
> _proxy=lus.lookup(_template);
>
> template = >ServiceTemplate object
> lus = >ServiceRegistrar object
>
> After
> JavaSpace space=SpaceLocator.getSpace();
>
> JAVASPACE PROXY(space) = com.sun.jini.outrigger.ConstrainableSpaceProxy2 for
> 909c299b-f355-4aca-aa7d-dd61f76c75bf (through
> Proxy[OutriggerServer,BasicInvocationHandler[BasicObjectEndpoint[12d482de-3914-4217-b607-6c67f796081b,TcpEndpoint[192.168.38.202:2257]]]])
>
>
>
>
> After
> Transaction txn=TxnManager.createTxn(60000);
>
> txn has value(TRANSACTION
> PROXY)=net.jini.core.transaction.server.ServerTransaction
> [manager=com.sun.jini.mahalo.TxnMgrProxy$ConstrainableTxnMgrProxy@619dbfcc,
> id=-706526335749167748]
>
> Here when I compared the returned values------ txn proxy does'nt have a
> tcpendpoint specified, may be this is the reason why the class not found
> EXCEPTION occuring..
>
> How I can solve this problem...?
>
> ===========================================================================
> To unsubscribe, send email to [email protected] and include in the body
> of the message "signoff JAVASPACES-USERS".  For general help, send email to
> [email protected] and include in the body of the message "help".
>
> To view past JAVASPACES-USERS postings, please see:
> http://archives.java.sun.com/archives/javaspaces-users.html
>   

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html