[jboss-jira] [JBoss JIRA] Created: (JBAS-3703) Update JRMPInvoker to not cast exported object to RemoteStub

Scott M Stark (JIRA) jira-events at jboss.com
Tue Sep 26 15:05:41 EDT 2006


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.4.GA, JBossAS-4.0.3 SP1
            Reporter: Scott M Stark
         Assigned To: Tom  Elrod
             Fix For: JBossAS-4.0.6.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 at 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

        



More information about the jboss-jira mailing list