9 Replies Latest reply on Jul 5, 2007 3:47 AM by ashutosh sri

    Exception got in deployment of EJB3 .ear

    ashutosh sri Newbie

      Hi All ,
      I am using ejb3 along with JBoss 4.2.0 , Java5 and Oracle Toplink as the persistence provider and Oracle 10g . After having deployed my datasource successfully , when I deploy my ear file , I get this error :
      Please help me out .



      11:17:51,078 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=persist.jar
      java.lang.RuntimeException: No container configured with name 'Stateless Bean''
      at org.jboss.ejb3.Ejb3AnnotationHandler.getStatelessContainer(Ejb3AnnotationHandler.java:249)
      at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:145)
      at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:468)
      at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:424)
      at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:405)
      at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:366)
      at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:321)
      at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:330)
      at org.jboss.system.ServiceController.create(ServiceController.java:273)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy33.create(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:492)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:73)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy34.create(Unknown Source)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)

        • 1. Re:  Exception got in deployment of EJB3 .ear
          William DeCoste Apprentice

          Make sure you have ejb3-interceptors-aop.xml in the deploy directory - that is where the "Stateless Bean" container or domain configuration is defined.

          • 2. Re:  Exception got in deployment of EJB3 .ear
            ashutosh sri Newbie

            Hi ,
            I already have this xml in the deploy directory , do I need to edit this file. Please revert back.

            Regards

            • 3. Re:  Exception got in deployment of EJB3 .ear
              William DeCoste Apprentice

              No, you should not have to modify that file unless you want to change the default bean configuration or create a custom config. Are there any exceptions when you start the app server?

              • 4. Re:  Exception got in deployment of EJB3 .ear
                ashutosh sri Newbie

                No , there are no exceptions when I start up the sever . I have packed an entity bean along with the stateless bean in a single jar . I didint get any error when there was a single stateless bean and I were to make a call also o it successfully , but since the time I have packed it with the entity bean I am unable to even deploy the ear. Do you have any pointers about it.


                Regards

                • 5. Re:  Exception got in deployment of EJB3 .ear
                  William DeCoste Apprentice

                  Can you look at the whole log file and see what the original exception is? The exception you posted indicates a problem with the EJB3 config, but if the SLSB deploys on it's own, there must be another problem. What does your entity bean and persistence.xml look like?

                  • 6. Re:  Exception got in deployment of EJB3 .ear
                    ashutosh sri Newbie

                    Hi ,
                    Thanks a ton for the kind effort that you are putting up.
                    I am now stuck as every time it wont throw up the same message . This time when I made deploy the ear it threw up this message :


                    2:39:15,218 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=sample123.ear,jar=persist.jar,unitName=testApp
                    12:39:16,187 INFO [STDOUT] [TopLink Warning]: 2007.07.05 12:39:16.125--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.Employee. The class is ignored.
                    12:39:16,187 INFO [STDOUT] [TopLink Warning]: 2007.07.05 12:39:16.187--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.FirstSessionBean. The class is ignored.


                    Later when I made a call then the there was no problem in call from Servlet to the stateless bean but when it moved over to the entity bean further , it just seemed to blow out :


                    12:42:35,640 ERROR [STDERR] java.lang.RuntimeException: url = [file:/C:/jboss-4.2.0.GA/server/default/tmp/persist.jar]
                    12:42:35,640 ERROR [STDERR] at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getClassNamesFromURL(PersistenceUnitProcessor.java:272)
                    12:42:35,640 ERROR [STDERR] at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.buildClassSet(PersistenceUnitProcessor.java:181)
                    12:42:35,640 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:124)
                    12:42:35,640 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:226)
                    12:42:36,203 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:242)
                    12:42:36,203 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initializeFromMain(JavaSECMPInitializer.java:278)
                    12:42:36,203 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.getJavaSECMPInitializer(JavaSECMPInitializer.java:81)
                    12:42:36,203 ERROR [STDERR] at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:119)
                    12:42:36,203 ERROR [STDERR] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
                    12:42:36,203 ERROR [STDERR] at src.FirstSessionBean.sayHello(FirstSessionBean.java:21)
                    12:42:36,203 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    12:42:36,203 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    12:42:36,203 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    12:42:36,203 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                    12:42:36,203 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:79)
                    12:42:36,203 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:70)
                    12:42:36,218 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                    12:42:36,218 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
                    12:42:36,218 ERROR [STDERR] at $Proxy71.sayHello(Unknown Source)
                    12:42:36,218 ERROR [STDERR] at TestServlet.doPost(TestServlet.java:79)
                    12:42:36,218 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                    12:42:36,218 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                    12:42:36,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    12:42:36,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    12:42:36,218 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.



                    along with this :


                    2:42:36,218 ERROR [STDERR] Caused by: java.util.zip.ZipException: The system cannot find the file specified
                    12:42:36,218 ERROR [STDERR] at java.util.zip.ZipFile.open(Native Method)
                    12:42:36,218 ERROR [STDERR] at java.util.zip.ZipFile.(Unknown Source)
                    12:42:36,218 ERROR [STDERR] at java.util.jar.JarFile.(Unknown Source)
                    12:42:36,218 ERROR [STDERR] at java.util.jar.JarFile.(Unknown Source)
                    12:42:36,218 ERROR [STDERR] at oracle.toplink.essentials.ejb.cmp3.persistence.ArchiveFactoryImpl.createArchive(ArchiveFactoryImpl.java:93)
                    12:42:36,218 ERROR [STDERR] at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getClassNamesFromURL(PersistenceUnitProcessor.java:268)


                    • 7. Re:  Exception got in deployment of EJB3 .ear
                      ashutosh sri Newbie

                      My persistence.xml looks like this :

                      <?xml version="1.0" encoding="UTF-8"?>
                      <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
                      <persistence-unit name="testApp" transaction-type="JTA">
                      oracle.toplink.essentials.PersistenceProvider
                      <jta-data-source>java:/my-ejb-test</jta-data-source>
                      <jar-file>../persist.jar</jar-file>
                      src.Employee






                      </persistence-unit>





                      Code for my entity bean :


                      package src;

                      import java.io.Serializable;
                      import javax.persistence.Entity;
                      import javax.persistence.Id;

                      @Entity
                      public class Employee implements Serializable {
                      @Id
                      private String name;

                      private String age;

                      private String dept;

                      private static final long serialVersionUID = 1L;

                      public Employee() {
                      super();
                      }

                      public Employee(String Name , String Age , String Dept)
                      {

                      this.age = Age ;
                      this.dept = Dept ;
                      this.name = Name;

                      }

                      public String getName() {
                      return this.name;
                      }

                      public void setName(String name) {
                      this.name = name;
                      }

                      public String getAge() {
                      return this.age;
                      }

                      public void setAge(String age) {
                      this.age = age;
                      }

                      public String getDept() {
                      return this.dept;
                      }

                      public void setDept(String dept) {
                      this.dept = dept;
                      }

                      }

                      • 8. Re:  Exception got in deployment of EJB3 .ear
                        William DeCoste Apprentice

                        Here is what looks like the latest problem - you can't load src.FirstSessionBean. Do you have this class/bean loaded/deployed?

                        • 9. Re:  Exception got in deployment of EJB3 .ear
                          ashutosh sri Newbie

                          Yes ! I have got this class very much in the jar along with the source Code .
                          Moreover I am able to get a response also , from this class. But then this class is unable to further continue its call to the entity bean and this is the place where it throws up the exception then.