4 Replies Latest reply on Jun 18, 2007 5:15 AM by Colin Chapman

    a problem in jboss-4.2.0GA

    hu yiping Newbie

      first,run -c all,i can see that CounterBean is deployed successfully in the following:
      09:44:04,046 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jbo
      ss.ejb3.stateless.StatelessContainer
      09:44:04,078 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=count
      er.jar,name=CounterBean,service=EJB3 with dependencies:
      09:44:05,406 INFO [EJBContainer] STARTED EJB: com.jboss.ejb3.CounterBean ejbNam
      e: CounterBean

      09:44:05,687 INFO [EJB3Deployer] Deployed: file:/E:/jboss-4.2.0.GA/server/all/d
      eploy/counter.jar
      second,my client code is in the following:

      import javax.naming.Context;
      import javax.naming.InitialContext;
      import javax.naming.NamingException;

      import com.jboss.ejb3.RemoteCounter;

      public class Client {

      public Client() {
      super();
      // TODO Auto-generated constructor stub
      }

      /**
      * @param args
      */
      public static void main(String[] args) {
      // TODO Auto-generated method stub
      Context ctx = null;
      try
      {

      ctx = new InitialContext();
      RemoteCounter counter = (RemoteCounter) ctx.lookup("counter/remote");
      System.out.println(counter);
      counter.add(10);
      System.out.println("the number:" + counter.getNumber());

      }
      catch (NamingException e)
      {
      e.printStackTrace();
      }
      }

      }

      third,run client class,and the result is in the following.the blue section is client counterbean instance that is printed in the client program :
      jboss.j2ee:jar=counter.jar,name=CounterBean,service=EJB3
      Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
      at $Proxy0.add(Unknown Source)
      at Client.main(Client.java:28)
      Caused by: java.lang.Exception: Can not make remoting client invocation due to not being connected to server.
      at org.jboss.remoting.Client.invoke(Client.java:1555)
      at org.jboss.remoting.Client.invoke(Client.java:530)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
      ... 2 more


      help me,please.
      thanks a lot