7 Replies Latest reply on Jun 14, 2007 7:50 AM by knisterpeter

    Tomcat + Embedded EJB

    knisterpeter

      Hi,

      my EJBs are not deployed as expected. Below is part of my logfile with the (I think) relevant parts. I'm using SEAM 1.2.1.GA and want to use Hibernate JPA, but I think one problem related to the EJBs is that hibernate does not get started. There are no error messages in the logfile so I have no idea what is going on.

      Logfile:

      10:19:25,198 WARN [BeanSchemaBinding] You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
      10:19:25,696 INFO [LocalTxDataSource] Bound datasource to JNDI name 'java:/DefaultDS'
      10:19:26,188 INFO [LocalTxDataSource] Bound datasource to JNDI name 'java:/KingPin'
      10:19:27,035 INFO [Ejb3Deployment] EJB3 deployment time took: 726
      10:19:27,234 INFO [Ejb3Deployment] EJB3 deployment time took: 198
      10:19:27,902 INFO [Ejb3DescriptorHandler] adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to de.llynch.kingpin.action.impl.RegisterAction org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@151dcd6
      10:19:28,032 INFO [Ejb3Deployment] EJB3 deployment time took: 797
      10:19:28,170 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=jboss-seam-1.2.1.GA,name=Dispatcher,service=EJB3 with dependencies:
      10:19:28,489 INFO [EJBContainer] STARTED EJB: org.jboss.seam.core.Dispatcher ejbName: Dispatcher
      10:19:28,609 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=jboss-seam-1.2.1.GA,name=TransactionListener,service=EJB3 with dependencies:
      10:19:28,740 INFO [EJBContainer] STARTED EJB: org.jboss.seam.core.TransactionListener ejbName: TransactionListener
      10:19:28,752 INFO [MCKernelAbstraction] installing bean: persistence.units:jar=llynch-kingpin-lib-1.0-SNAPSHOT.jar,unitName=kingpin with dependencies:
      10:19:28,753 INFO [MCKernelAbstraction] AbstractDependencyMetaData@913c56{dependency=KingPin}
      10:19:28,763 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=llynch-kingpin-lib-1.0-SNAPSHOT,name=RegisterAction,service=EJB3 with dependencies:
      10:19:28,946 INFO [MCKernelAbstraction] AbstractDependencyMetaData@1c66ec7{dependency=persistence.units:jar=llynch-kingpin-lib-1.0-SNAPSHOT.jar,unitName=kingpin}
      


        • 1. Re: Tomcat + Embedded EJB
          knisterpeter

          One thing to add here is when I'm using java:/DefaultDS in my persistence.xml as jndi-datasource hibernate is started while deploying my app, when using my own specified datasource it does not get started. Any clue what is need to use my own datasource?

          • 2. Re: Tomcat + Embedded EJB
            knisterpeter

            When I change my EJB to have the EntityMangager annotated with @In instead of @PerstistenceContext it does get deployed in the ejb server , but then no EntityManager is injected and I get the following exception when calling a method on that bean:

            org.jboss.seam.RequiredException: In attribute requires non-null value: register.em
             org.jboss.seam.Component.getValueToInject(Component.java:1919)
             org.jboss.seam.Component.injectAttributes(Component.java:1368)
             org.jboss.seam.Component.inject(Component.java:1195)
             org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
             org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
             org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
             org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
             sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             java.lang.reflect.Method.invoke(Method.java:597)
             org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
             org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
             org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
             org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
             org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
            ...


            • 3. [SOLVED] Re: Tomcat + Embedded EJB
              knisterpeter

              It should be mentioned in the documentation that the jndiName and the 'datasource bean' in jboss-beans.xml must be the same.
              For example if you specify a jndiName for your datasources as 'java:/testDS' then, the bean must be named 'testDS'.

              • 4. Re: Tomcat + Embedded EJB
                pmuir

                Can you file an issue in JIRA? Thanks!

                • 5. Re: Tomcat + Embedded EJB
                  knisterpeter

                  Also the connectionURL must not be prefixed or postfixed with whitespaces. There is a trim() missing I think.

                  • 6. Re: Tomcat + Embedded EJB
                    knisterpeter

                    I would like to file both issues in JIRA, but I'm not allowed to register an account... Maybe I'm a bit too stupid, but creating a JIRA account redirects to jboss.com registration and that gives me an deny message for creating new users...

                    • 7. Re: Tomcat + Embedded EJB
                      knisterpeter

                      Okok, I get it. I could use my forum account as it is the same as the JIRA one... :-)