1 Reply Latest reply on Aug 10, 2006 7:09 PM by Pasta Fan

    NullPointerException looking up EJB

    Pasta Fan Newbie

      My Stateless SessionBean successfully deployed with IIOP invoker,
      can be looked up from a Servlet or standalone Java-Client,
      and the Object returned is a "org.omg.stub.javax.ejb._EJBHome_Stub",
      toString() returns its IOR (correct).

      But trying to PortableRemoteObject.narrow() it to its Home-Interface returns null, even following the steps mentioned at http://www.jbossgroup.com/index.html?module=bb&op=viewtopic&p=3932015

      The Properties I pass to my Client:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=jnp://localhost:1099
      java.naming.factory.url.pkgs=org.jboss.naming.client
      j2ee.clientName=my_client
      java.rmi.server.codebase=http://localhost:8083
      java.security.policy=.\client.policy


      Included JARs:
      - My_EJB_Interfaces.jar
      - jbossall-client.jar
      - jboss-iiop.jar


      My deploy\dynclassloader-service.xml (Have enabled DownloadServerClasses)
      <server>
       <mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
       name="jboss.rmi:type=RMIClassLoader">
       <attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
       <attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
       </mbean>
      
       <mbean code="org.jboss.web.WebService"
       name="jboss:service=WebService">
       <attribute name="Port">8083</attribute>
       <attribute name="DownloadServerClasses">true</attribute>
       <attribute name="Host">${jboss.bind.address}</attribute>
       <attribute name="BindAddress">${jboss.bind.address}</attribute>
       <depends optional-attribute-name="ThreadPool"
       proxy-type="attribute">jboss.system:service=ThreadPool</depends>
       </mbean>
      </server>


      JBoss starts without any errors/warnings

      Environment:
      - JBoss 4.0.4GA (Installer - checked "all")
      - Java 1.5
      - Windows XP SP2


      As a (poor) workarround I can put the rmic-generated Stubs to Classpath,
      so lookup(jndi) returns me a "mypackage._MyBeanHome_Stub" and works fine.
      So I assume there must be an error obtaining the Stubs dynamically via RMIClassLoaderService!?