Issue 2 in srmi: ClassCastException if used -jar argument.

3 views
Skip to first unread message

codesite...@google.com

unread,
Dec 25, 2007, 6:03:38 AM12/25/07
to srmi...@googlegroups.com
Issue 2: ClassCastException if used -jar argument.
http://code.google.com/p/srmi/issues/detail?id=2

New issue report by mohammad.nabil.h:
What steps will reproduce the problem?
0. Be sure to let the CLASSPATH environment variable equal to
/somedir/SRMI.jar and to /srmibasedir. So that the RMI registry can see
both of them.

1. Run server using " java -ea -cp
.:SRMI.jar:lib/tools.jar:lib/log4j-1.2.14.jar:lib/javassist.jar:lib/bcel-5.2.jar
-Djava.system.class.loader=SRMI.Tests.SRMIClassLoader -jar SRMI.jar
server". Given that SRMI.Tests.Test is the main class.

2. Run client using "java -ea -cp
.:SRMI.jar:lib/tools.jar:lib/log4j-1.2.14.jar:lib/javassist.jar:lib/bcel-5.2.jar
-Djava.system.class.loader=SRMI.Tests.SRMIClassLoader -jar SRMI.jar client"

What is the expected output? What do you see instead?
The expected output is having the client print "i've been called". What I
see instead is an exception that MyClient_clienside_rmistub_adapter.java:13
ClassCastException to SRMI.Tests.MyClient_generated_interface.

Workaround?
instead of "-jar SRMI.jar" use "SRMI.Tests.Test" be sure SRMI.jar is in the
class path.

Cause?
The Proxy class generated by RMI must be loaded using the same loader that
loaded SRMI.Tests.MyClient_generated_interface. For some reason, using the
-jar option makes this don't happen. But using the direct class name, and
not -jar option, makes that happen.


Issue attributes:
Status: Accepted
Owner: mohammad.nabil.h
Labels: Type-Defect Priority-Critical Milestone-Release1.0 Component-Logic

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Dec 25, 2007, 6:46:39 AM12/25/07
to srmi...@googlegroups.com
Issue 2: ClassCastException if used -jar argument.
http://code.google.com/p/srmi/issues/detail?id=2

Comment #1 by mohammad.nabil.h:
(No comment was entered for this change.)


Issue attribute updates:
Status: Fixed

codesite...@google.com

unread,
Dec 25, 2007, 6:46:39 AM12/25/07
to srmi...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages