Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMI problem: if I invoke a method that return class....

4 views
Skip to first unread message

Antonio Monetti

unread,
Mar 4, 2002, 11:06:59 AM3/4/02
to
I have a client that include an old stub class X_stub. I have modified a
server class X, that generates stub class X_stub, adding new methods. If
I invoke server method that return indefinite type, like int, client and
server work properly but if I invoke a method that return a class an
exception appear:

java.lang.NullPointerException
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at SynchroManager_Stub.getUploadFTServer(Unknown Source)

I compiled client using jdk 1.2 and I compile server using jdk 1.3. Is
there a solution? Thanks

Antonio

Chris Sargent

unread,
Mar 5, 2002, 4:08:47 AM3/5/02
to
RMI can be a pain at the best of times, so I'd recompile both ends
with the same JDK if I was you.

Also, the exception is being thrown by the server - you posted the
stack trace at the client end. Unfortunately the server exception
doesn't get passed over the RMI boundary, just it's message. You need
to check what caused the exception in the server first I think.

A good technique is to create a new exception class that 'nests'
potential server exceptions so you can display the stack trace of
both. Search for 'nested exceptions' on javaworld.

- sarge

Antonio Monetti

unread,
Mar 6, 2002, 9:29:48 AM3/6/02
to
Thank you for you suggestion but I have solved the problem enabling rmi
debug on rmi server and client side (see sun.rmi properties on
java.sun.com site). Rmi debug print messagges and stack trace on
System.err and if you set logLevel to VERBOSE you can see all operations.

Antonio

0 new messages