3 Replies Latest reply on Apr 18, 2011 8:43 AM by Wolf-Dieter Fink

    EJB - Deploy problem - Not found in Dispatcher

    G K Newbie

      Hello community,

       

      my english isnt very well, but i try to explain my little BIG problem

       

      I try to deploy my EJB 3.0 in JBoss 5.1 and everytime I get the same Exception when i start my client program :

       

       

      javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException]
          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 Main.main(Main.java:28)
      Caused by: java.lang.reflect.UndeclaredThrowableException
          at $Proxy0.createProxyBusiness(Unknown Source)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:158)
          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)
          ... 4 more
      Caused by: org.jboss.aop.NotFoundInDispatcherException: Object with oid: ProxyFactory/OpenFlow/AccountService/OpenFlow/AccountService/remote was not found in the Dispatcher
          at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:85)
          at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
          at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)
          at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
          at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
          at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
          at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
          at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:211)
          at org.jboss.remoting.Client.invoke(Client.java:1724)
          at org.jboss.remoting.Client.invoke(Client.java:629)
          at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:72)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
          at $Proxy0.createProxyBusiness(Unknown Source)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:158)
          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)
          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 Main.main(Main.java:28)
          at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:72)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
          ... 11 more
      

       

       

      I checked my logfiles to be assured that everything is okay with my ejb:

       

       

          OpenFlow/AccountService/remote - EJB3.x Default Remote Business Interface
          OpenFlow/AccountService/remote-com.openflow.account.AccountServiceRemote - EJB3.x Remote Business Interface
          OpenFlow/AccountService/local - EJB3.x Default Local Business Interface
          OpenFlow/AccountService/local-com.openflow.account.AccountServiceLocal - EJB3.x Local Business Interface
      

       

      Here is my Client program:

       

       

      import java.util.Properties;
      
      import javax.naming.Context;
      import javax.naming.InitialContext;
      import javax.naming.NameClassPair;
      import javax.naming.NamingEnumeration;
      
      import com.openflow.account.AccountServiceRemote;
      
      
      public class Main {
      
          /**
           * @param args
           */
          public static void main(String[] args) {
              // TODO Auto-generated method stub
              Properties properties = new Properties();
              properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              properties.put("java.naming.factory.url.pkgs","=org.jboss.naming:org.jnp.interfaces");
              properties.put("java.naming.provider.url","localhost:1099");
      
              Context context;
                      try
                      {
                           context = new InitialContext(properties);
      //                     showJndiContext(context, "", "");
                           AccountServiceRemote as = (AccountServiceRemote) context.lookup("OpenFlow/AccountService/remote");
                           System.out.println("PFERTI");
                      } catch(Exception e ){
                          e.printStackTrace();
                      }
          }
      
          public static void showJndiContext( Context ctx, String name, String space )
             {
                if( null == name  ) name  = "";
                if( null == space ) space = "";
                try {
                   NamingEnumeration<NameClassPair> en = ctx.list( name );
                   while( en != null && en.hasMoreElements() ) {
                      String delim = ( name.length() > 0 ) ? "/" : "";
                      NameClassPair ncp = en.next();
                      System.out.println( space + name + delim + ncp );
                      if( space.length() < 40 )
                         showJndiContext( ctx, ncp.getName(), "    " + space );
                   }
                } catch( javax.naming.NamingException ex ) {
                   // Normalerweise zu ignorieren
                }
          }
      }
      

       

      I invested a lot of time to solve this problem, but til now....nothing changed

       

      I hope you can help me as far as possible

       

      best regards

       

      GK