2 Replies Latest reply on Oct 10, 2009 2:36 AM by pushpak1981

    EJB client cannot Load Remote EJB

    pushpak1981 Novice

      Hi,

      We have deployed stateless EJB3 in JBoss 5.0 AS. We have written an Junit class which Does an JNDI Lookup for the EJB. But it is not able to load the remote EJB Object. We are getting following Error.

      java.lang.NullPointerException
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:444)
      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:56)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
      at org.jboss.remoting.Client.invoke(Client.java:1634)
      at org.jboss.remoting.Client.invoke(Client.java:548)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
      at $Proxy3.invoke(Unknown Source)
      at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
      at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
      at $Proxy2.addTransaction(Unknown Source)

      Any help would be highly appreciated.

      Thanks.

        • 1. Re: EJB client cannot Load Remote EJB
          jaikiran pai Master

          Which exact version of JBoss AS5? And please post the relevant code of the bean and the client lookup.

          While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

          • 2. Re: EJB client cannot Load Remote EJB
            pushpak1981 Novice

            For Doing an Lookup we are using the following code:

            Properties p = new Properties();
            p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
            p.put("java.naming.provider.url","jnp://localhost:1099/");
            p.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

            InitialContext ctx = new InitialContext(p);
            IAbc ref = (IAbc)ctx.lookup("TransactionBean/remote");

            ref.addTransaction(persistenceObject);

            We are doing an persistence into Database using JPA.