3 Replies Latest reply on Jun 10, 2010 8:57 AM by Johannes Mueller

    jboss-5.1.0.GA + ejb3-tutorials\source\entity = NameNotFoundException

    Johannes Mueller Newbie

      Hi everyone,

       

      I am new to the world of application servers and EJB and read through the jboss ejb3 tutorials: http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html_single/index.html

      Everything worked fine when deploying and running the examples stateless and stateful with ant.

      But now I face the following Problem when trying to run entity from a clean server:

       

       

      Me@JoeWin /cygdrive/c/Programme/jboss-5.1.0.GA/source/entity
      $ ant run
      Buildfile: C:\Programme\jboss-5.1.0.GA\source\entity\build.xml

      prepare:

      compile:
          [javac] C:\Programme\jboss-5.1.0.GA\source\entity\build.xml:52: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to
      false for repeatable builds

      ejbjar:
           [copy] Copying 1 file to C:\Programme\jboss-5.1.0.GA\server\default\deploy

      run:
           [java] Exception in thread "main" javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException]
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
           [java]     at org.jboss.tutorial.entity.client.Client.main(Client.java:42)
           [java] Caused by: java.lang.reflect.UndeclaredThrowableException
           [java]     at $Proxy0.createProxyBusiness(Unknown Source)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.session.stateful.StatefulSessionProxyObjectFactory.getProxy(StatefulSessionProxyObjectFactory.java:64)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:158)
           [java]     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
           [java]     ... 4 more
           [java] Caused by: java.lang.ClassNotFoundException: org.jboss.tutorial.stateful.bean.ShoppingCart
           [java]     at org.jboss.remoting.serialization.ClassLoaderUtility.loadClass(ClassLoaderUtility.java:103)
           [java]     at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:86)
           [java]     at java.lang.Class.forName0(Native Method)
           [java]     at java.lang.Class.forName(Class.java:247)
           [java]     at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveProxyClass(ObjectInputStreamWithClassLoader.java:253)
           [java]     at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
           [java]     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
           [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
           [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           [java]     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
           [java]     at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:119)
           [java]     at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
           [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
           [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           [java]     at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           [java]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           [java]     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
           [java]     at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:238)
           [java]     at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:138)
           [java]     at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:123)
           [java]     at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:1220)
           [java]     at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:850)
           [java]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:1724)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:629)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:72)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
           [java]     at $Proxy0.createProxyBusiness(Unknown Source)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.session.stateful.StatefulSessionProxyObjectFactory.getProxy(StatefulSessionProxyObjectFactory.java:64)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:158)
           [java]     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
           [java]     at org.jboss.tutorial.entity.client.Client.main(Client.java:42)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:72)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
           [java]     ... 11 more
           [java] Java Result: 1

      BUILD SUCCESSFUL
      Total time: 9 seconds

      Johannes Müller@JoeWin /cygdrive/c/Programme/jboss-5.1.0.GA/source/entity
      $ ant run
      Buildfile: C:\Programme\jboss-5.1.0.GA\source\entity\build.xml

      prepare:

      compile:
          [javac] C:\Programme\jboss-5.1.0.GA\source\entity\build.xml:52: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to
      false for repeatable builds

      ejbjar:

      run:
           [java] Exception in thread "main" javax.naming.NameNotFoundException: remote not bound
           [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
           [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
           [java]     at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
           [java]     at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
           [java]     at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           [java]     at java.lang.reflect.Method.invoke(Method.java:597)
           [java]     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
           [java]     at sun.rmi.transport.Transport$1.run(Transport.java:159)
           [java]     at java.security.AccessController.doPrivileged(Native Method)
           [java]     at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
           [java]     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
           [java]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
           [java]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
           [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
           [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
           [java]     at java.lang.Thread.run(Thread.java:619)
           [java]     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
           [java]     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
           [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
           [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
           [java]     at org.jboss.tutorial.entity.client.Client.main(Client.java:42)
           [java] Java Result: 1

      BUILD SUCCESSFUL
      Total time: 8 seconds

       

      I noticed that some NameNotFound exceptions occure sometimes even with examples that worked before. I guess this is due to the slowness of my PC. Probably the Application is still not deployed and ant already tries to run it on the server, but, as I said, I am just guessing there.

      So the second Exception occurs all the time now, no matter how often I try to run it.

       

      It would be kind if you could help me to correct the problem.

      Thanks a lot,

      Johannes