Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3703

Update JRMPInvoker to not cast exported object to RemoteStub

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBossAS-4.2.0.CR1
    • JBossAS-4.0.3 SP1, JBossAS-4.0.4.GA
    • Remoting
    • None
    • Documentation (Ref Guide, User Guide, etc.), Compatibility/Configuration

    Description

      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.

      Attachments

        Activity

          People

            tom.elrod_jira Tom Elrod (Inactive)
            starksm64 Scott Stark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: