2 Replies Latest reply on Apr 13, 2007 8:35 PM by Dimitris Andreadis

    EJB 3 deployment on JBoss 4.0.3

    Naveen Verma Newbie

      Dear All,

      I am new to EJB 3.0. I created a Hello EJB 3.0. I am using the JBoss Eclipse IDE 3.1.2 and jboss-EJB-3.0_RC5-PFD.zip for EJB3 support on JBoss 4.0.3.
      For deployement, I created the jar of Remote Interface + Stateless session bean and the client. The code is attached with this mail.

      When I deploy the jar file, i am getting the following exception.

      Please help.

      ----------------------------
      //HelloWorldBean.java
      ----------------------------
      package com.ebw.ejb3;

      import javax.ejb.Remote;
      import javax.ejb.Stateless;

      public @Stateless @Remote class HelloWorldBean implements HelloWorld {
      public void sayHello(String name) {
      if (name == null) {
      System.out.println("I am NULL but EJB 3 is working");
      } else {
      System.out.println("Hello "+name);
      }
      }
      }

      ----------------
      HelloWorld
      ----------------
      package com.ebw.ejb3;

      import javax.ejb.Remote;

      @Remote
      public interface HelloWorld {
      public void sayHello(String name);
      }


      --------------------------------
      HelloWorldClient
      --------------------------------
      package com.ebw.client;

      import java.util.Hashtable;

      import javax.annotation.EJB;
      import javax.naming.InitialContext;

      import com.ebw.ejb3.HelloWorld;

      public class HelloWorldClient {

      private @EJB static HelloWorld helloWorld;

      public static void main(String[] arg) {
      try {

      HelloWorldClient client = new HelloWorldClient();
      client.testMe(arg);
      } catch (Exception e) {
      e.printStackTrace();
      }
      }

      public void testMe(String[] arg) {
      try {
      System.out.println("helloWorld=" + helloWorld + "\n");
      helloWorld.sayHello(arg[0]);
      } catch (Exception e) {
      e.printStackTrace();
      }
      }

      }


      -------------------------
      Error on deployement
      -------------------------

      17:24:33,937 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,jar=ejb3project.jar,name=HelloWorldBean
      java.lang.reflect.InvocationTargetException
      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:585)
      at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:97)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:428)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy69.start(Unknown Source)
      at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:76)
      at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:414)
      at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:463)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:428)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy27.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:365)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
      at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
      at org.jboss.ejb3.session.BaseSessionProxyFactory.getEjbMetaData(BaseSessionProxyFactory.java:90)
      at org.jboss.ejb3.session.BaseSessionProxyFactory.setEjb21Objects(BaseSessionProxyFactory.java:61)
      at org.jboss.ejb3.stateless.StatelessRemoteProxyFactory.createProxy(StatelessRemoteProxyFactory.java:162)
      at org.jboss.ejb3.stateless.BaseStatelessProxyFactory.start(BaseStatelessProxyFactory.java:64)
      at org.jboss.ejb3.stateless.StatelessRemoteProxyFactory.start(StatelessRemoteProxyFactory.java:85)
      at org.jboss.ejb3.ProxyDeployer.start(ProxyDeployer.java:85)
      at org.jboss.ejb3.SessionContainer.start(SessionContainer.java:85)
      at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:80)
      ... 79 more
      17:24:33,937 INFO [EJB3Deployer] Deployed: file:/D:/jboss-4.0.3/server/all/deploy/ejb3project.jar
      17:24:33,953 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EJB3,jar=ejb3project.jar,name=HelloWorldBean
      State: FAILED
      Reason: java.lang.reflect.InvocationTargetException

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,jar=ejb3project.jar,name=HelloWorldBean
      State: FAILED
      Reason: java.lang.reflect.InvocationTargetException