4 Replies Latest reply: Jan 22, 2013 10:54 AM by JN JNC RSS

    EJB3 jndi lookup failed on JBOSS EAP only due to ProxyFactory not bound

    Kevin Yuan Newbie

      Hi,

       

      My tests don't have problem with JBOSS 5.1.0 GA community version, it only happens on ENTERPRISE APPLICATION PLATFORM, tests failed during ejb3 sessionbean JNDI lookup, see message below:

       

      <error message="Could not dereference object" type="javax.naming.NamingException">javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Exception while trying to locate proxy factory in JNDI, at key ProxyFactory/eclipselink-advanced-field-access-model/TestRunner/TestRunner]
      at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareClient(JUnitTestCase.java:480)
      at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:455)
      Caused by: java.lang.RuntimeException: Exception while trying to locate proxy factory in JNDI, at key ProxyFactory/eclipselink-advanced-field-access-model/TestRunner/TestRunner
      at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getProxyFactoryFromJNDI(ProxyObjectFactory.java:235)
      at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:153)
      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
      at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
      at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
      Caused by: javax.naming.NameNotFoundException: ProxyFactory not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getProxyFactoryFromJNDI(ProxyObjectFactory.java:226)
      </error>

       

      So does anyone know what's the real problem? Is there any special configuration for EAP version?

       

      Thanks.

        • 1. Re: EJB3 jndi lookup failed on JBOSS EAP only due to ProxyFactory not bound
          Carlo de Wolf Master

          Hi Kevin,

           

          Any questions regarding Enterprise Application Platform should be filed through our customer support portal. Your EAP subscription entitles you to full support of all technologies included.

           

          Please file your issue there. You can find the customer support portal here: https://www.redhat.com/apps/support/.

           

          Thanks,

           

          Carlo

          • 2. Re: EJB3 jndi lookup failed on JBOSS EAP only due to ProxyFactory not bound
            Michael O'Brien Newbie

            Issue resolved,

             

            >Use a 3-part (app_name/bean_name/remote) or (app_name/remote-bean_name/qualified_bean_name) EJB JNDI lookup instead of a 2 part (without the app_name prefix)

             

            >The JBoss EAP server registers the following name
            2010-03-22 11:07:33,326 INFO  [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] (HDScanner) Binding the following Entries in Global JNDI:

            TestRunner - EJB3.x Default Remote Business Interface
            eclipselink-advanced-field-access-model/TestRunner/remote-org.eclipse.persistence.testing.framework.server.TestRunner - EJB3.x Remote Business Interface

            2010-03-22 11:07:39,797 INFO  [STDOUT] (WorkerThread#0[127.0.0.1:62483]) [EL Info]: 2010-03-22 11:07:39.797--ServerSession(4488512)--EclipseLink, version: Eclipse Persistence Services - 2.1.0.qualifier

             

            >Use the name "eclipselink-advanced-field-access-model/TestRunner/remote-org.eclipse.persistence.testing.framework.server.TestRunner" in the JNDI context lookup to get an EJB @Remote @Stateless session bean $Proxy.

             

            >Note: the name can also be "eclipselink-advanced-field-access-model/TestRunner/remote" if @Remote on the remote interface and @Stateless defaults are used without overrides.


            >see

            http://wiki.eclipse.org/EclipseLink/Bugs/305331

             

             

            thank you
            /michael
            http://www.eclipselink.org

            • 4. Re: EJB3 jndi lookup failed on JBOSS EAP only due to ProxyFactory not bound
              JN JNC Newbie

              Hi,

               

              I have to deploy an application within various application server environments depending on customer environment. I successfully deploy the application in jBoss 4.2.3, 5.1 and 7.1 final.

              I would like to have some "unit-integration" tests to valid my deployment  as fast as I can and test remote EJB invocation and JMS deployment.

               

              I got same issue when trying to invoke a remote EJB deployed within a ear file in JBoss 5.1 from a junit test.

              It doesn't matter which  3-part pattern I use (app_name/bean_name/remote) or (app_name/remote-bean_name/qualified_bean_name).

               

              Please note this test is working fine when I deploy this EAR file in jBoss 4.2.3.

              I didn't try with jBoss 7.1 yet.

               

              jvax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Exception while trying to locate proxy factory in JNDI, at key ProxyFactory/MY_EAR/MyBean/MY_EAR/MyBean/remote]

              ...

              Caused by: java.lang.RuntimeException: Exception while trying to locate proxy factory in JNDI, at key ProxyFactory/MY_EAR/MyBean/MY_EAR/MyBean/remote

              ...

              at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getProxyFactoryFromJNDI(ProxyObjectFactory.java:249)
              at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:157)
              at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
              at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
              at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
              ... 28 more
              Caused by: javax.naming.NameNotFoundException: ProxyFactory not bound
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
              at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

               

              I thought about a classloading issue regarding jboss client jar but it doesn't seems to be the case as I got same issue when changing my test to follow Carlo's classloading tip.

               

              http://wolf-71.blogspot.fr/2010/02/et-phone-home.html

               

              If I change my test to use this classloading mechanism I got an extra exception

               

              java.lang.ClassCastException: org.jboss.jms.client.JBossConnectionFactory cannot be cast to javax.jms.ConnectionFactory
              at JBossServerTest.testCALLATJMSCall(JBossServerTest.java:206)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)

               

              Any suggestion would be appreciated.

              Cheers