[
http://jira.jboss.com/jira/browse/JBAS-3703?page=comments#action_12347714 ]
Tom Elrod commented on JBAS-3703:
----------------------------------
Change made to cast to Serializable instead of RemoteStub for
https://svn.jboss.org/repos/jbossas/branches/Branch_4_2 for
org.jboss.invocation.jrmp.server.JRMPInvoker.
Does this not need to done for JBossAS 5 as well?
Update JRMPInvoker to not cast exported object to RemoteStub
------------------------------------------------------------
Key: JBAS-3703
URL:
http://jira.jboss.com/jira/browse/JBAS-3703
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Remoting
Affects Versions: JBossAS-4.0.3 SP1, JBossAS-4.0.4.GA
Reporter: Scott M Stark
Assigned To: Tom Elrod
Fix For: JBossAS-4.2.0.CR1
If one runs with the jdk5 java.rmi.server.ignoreStubClasses dynamic stub override to
force the server to generate stubs for exported objects, the JRMPInvoker fails to start
with the following exception:
[starksm@succubus bin]$ run.sh -D-Djava.rmi.server.ignoreStubClasses=true
=========================================================================
...
11:55:52,477 WARN [ServiceController] Problem starting service
jboss:service=invoker,type=jrmp
java.lang.ClassCastException: $Proxy13
at org.jboss.invocation.jrmp.server.JRMPInvoker.exportCI(JRMPInvoker.java:437)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.startService(JRMPInvoker.java:359)
at
org.jboss.invocation.jrmp.server.JRMPInvoker$1.startService(JRMPInvoker.java:136)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
The reason is that the code creating the remote object is explictly casting the export
result to a RemoteStub:
protected void exportCI() throws Exception
{
this.invokerStub = (RemoteStub) UnicastRemoteObject.exportObject
(this, rmiPort, clientSocketFactory, serverSocketFactory);
}
even though the public contract for this stub only requires a Serializable instance. The
type of the invokerStub should just be relaxed to Serializable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira