8 Replies Latest reply on Jan 17, 2011 11:18 AM by jsmadja

    EJBContainer doesn't deploy my SessionBean

    jsmadja

      Hi everybody,

       

      I'm trying to execute a simple JUnit Test Case with a stateless session bean. There is no problem when I deploy this jar in glassfish or in Jboss 6.

      But, when I try to execute my test, the Jboss EJBContainer starts fine and my SessionBean failed to deploy.

       

      Here the details :

       

      My container initialization :

       

      @BeforeClass

          public static void initJBoss() throws NamingException {

              container = EJBContainer.createEJBContainer();

              context = container.getContext();

              service = (IPersonService) context.lookup("PersonService/local");

          }

       

      My session bean definition :

       

      @Stateless

      @Local

      public class PersonService implements IPersonService {

       

          @PersistenceContext

          EntityManager em;

       

          public Person create(Person person) {

              em.persist(person);

              return person;

          }

      ....

      }

       

      And now, the errors (no difference when I'm running through Eclipse or Maven 3) :

       

      javax.ejb.EJBException: java.lang.reflect.InvocationTargetException

          at org.jboss.ejb3.embedded.impl.standalone.JBossStandaloneEJBContainerProvider.createEJBContainer(JBossStandaloneEJBContainerProvider.java:134)

          at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:97)

          at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:79)

          at com.xebia.ejbcontainer.service.PersonServiceTest.initJBoss(PersonServiceTest.java:29)

          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:597)

          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

          at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)

          at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)

          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)

          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)

          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:597)

          at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)

          at $Proxy0.invoke(Unknown Source)

          at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)

          at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)

          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

      Caused by: 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:597)

          at org.jboss.ejb3.embedded.impl.standalone.JBossStandaloneEJBContainerProvider.createEJBContainer(JBossStandaloneEJBContainerProvider.java:122)

          ... 25 more

      Caused by: javax.ejb.EJBException: org.jboss.embedded.api.DeploymentException: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      DEPLOYMENTS MISSING DEPENDENCIES:

        Deployment "jboss.ejb3:application=cla,module=cla,component=PersonService,service=EjbEncFactory" is missing the following dependencies:

          Dependency "jboss.naming:application=cla,component=PersonService,module=cla" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=cla,component=PersonService,module=cla' **")

        Deployment "jboss.j2ee:jar=classes,name=PersonService,service=EJB3" is missing the following dependencies:

          Dependency "jboss.ejb3:application=cla,component=PersonService,module=cla,service=EjbEncFactory" (should be in state "Installed", but is actually in state "Described")

          Dependency "org.jboss.ejb.bean.instantiator/cla/cla/PersonService" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'org.jboss.ejb.bean.instantiator/cla/cla/PersonService' **")

        Deployment "jboss.j2ee:jar=classes,name=PersonService,service=EJB3,type=nointerface-view-jndi-binder" is missing the following dependencies:

          Dependency "jboss.j2ee:jar=classes,name=PersonService,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")

        Deployment "jboss.j2ee:jar=classes,name=PersonService,service=EJB3_endpoint" is missing the following dependencies:

          Dependency "jboss.j2ee:jar=classes,name=PersonService,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")

       

      DEPLOYMENTS IN ERROR:

        Deployment "org.jboss.ejb.bean.instantiator/cla/cla/PersonService" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.jboss.ejb.bean.instantiator/cla/cla/PersonService' **

        Deployment "jboss.naming:application=cla,component=PersonService,module=cla" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.naming:application=cla,component=PersonService,module=cla' **

        Deployment "jboss.ejb3:application=cla,component=PersonService,module=cla,service=EjbEncFactory" is in error due to the following reason(s): Described

       

       

      Any idea ? What is the /cla/cla/PersonService thing ?