1 2 Previous Next 15 Replies Latest reply on Jan 23, 2006 7:44 AM by gavin.king

    booking example with CVS version and jboss-head jboss-4.0.x

    lcoetzee

      Hi all,

      I have been trying to use the latest Seam CVS version with the jboss-head 4.0.x CVS version. Unfortunately my deployment fails with problems in the persistence unit. As a test I have tried the booking example and get the same problem (see stack trace below).

      Any suggestions ?

      Thanks

      Louis

      17:11:01,943 INFO [JmxKernelAbstraction] jboss.jca:name=bookingDatasource,service=DataSourceBinding
      17:11:02,097 INFO [Environment] Hibernate 3.1.1
      17:11:02,149 INFO [Environment] hibernate.properties not found
      17:11:02,211 INFO [Environment] using CGLIB reflection optimizer
      17:11:02,212 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      17:11:02,424 WARN [ServiceController] Problem starting service persistence.units:ear=jboss-seam-booking.ear.ear,jar=jboss-seam-booking.jar.jar,unitName=bookingDatabase
      java.lang.ClassCastException: java.lang.AbstractMethodError
       at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:101)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor2.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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy59.start(Unknown Source)
       at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:76)
       at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:608)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:452)
       at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor2.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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy29.start(Unknown Source)
       at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:365)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor16.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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:280)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor2.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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
       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: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:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:477)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:357)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:464)
       at java.lang.Thread.run(Thread.java:595)
      


      which leads to:
      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=jboss-seam-booking.ear.ear,jar=jboss-seam-booking.jar.jar,unitName=bookingDatabase
       State: FAILED
       Reason: java.lang.ClassCastException: java.lang.AbstractMethodError
       I Depend On:
       jboss.jca:service=DataSourceBinding,name=bookingDatasource
       Depends On Me:
       jboss.j2ee:service=EJB3,ear=jboss-seam-booking.ear,jar=jboss-seam-booking.jar,name=BookingListAction
       jboss.j2ee:service=EJB3,ear=jboss-seam-booking.ear,jar=jboss-seam-booking.jar,name=ChangePasswordAction
       jboss.j2ee:service=EJB3,ear=jboss-seam-booking.ear,jar=jboss-seam-booking.jar,name=HotelBookingAction
       jboss.j2ee:service=EJB3,ear=jboss-seam-booking.ear,jar=jboss-seam-booking.jar,name=LoginAction
       jboss.j2ee:service=EJB3,ear=jboss-seam-booking.ear,jar=jboss-seam-booking.jar,name=RegisterAction
      
      ObjectName: jboss.j2ee:service=EJB3,ear=jboss-seam-booking.ear,jar=jboss-seam-booking.jar,name=BookingListAction
       State: NOTYETINSTALLED
       I Depend On:
       persistence.units:ear=jboss-seam-booking.ear.ear,jar=jboss-seam-booking.jar.jar,unitName=bookingDatabase
      


        • 1. Re: booking example with CVS version and jboss-head jboss-4.
          gavin.king

          I am definitely not experiencing this. Looks like you have a bad jar floating around somewhere.

          • 2. Re: booking example with CVS version and jboss-head jboss-4.
            lcoetzee

            Hi Gavin,

            I have done a cvs update and rebuilt jboss (also rebuilt seam). This seems to have sorted out the problem. I am now able to build/deploy and run the booking example. Excellent !

            I have attempted to port my application to the new ejb tags etc. and have changed the configuration in web.xml (added org.jboss.seam.core.init.jndiPattern to my web.xml). I run into the following problem:



            java.lang.IllegalArgumentException: EntityManagerFactory not found


            with a long stack trace. In it it says the following:


            Caused by: javax.naming.NameNotFoundException: EntityManagerFactories not bound
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            2006-01-20 16:32:22,029 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactory(ManagedPersistenceContext.java:80)
            2006-01-20 16:32:22,029 ERROR [STDERR] at org.jboss.seam.core.ManagedPersistenceContext.create(ManagedPersistenceContext.java:50)
            2006-01-20 16:32:22,030 ERROR [STDERR] ... 230 more


            even though I see the following in my log file:

            [org.jboss.seam.Component] trySeam1Entity.persistenceUnitName=java:/EntityManagerFactories/trySeam1Entity


            Any suggestions ?

            Thanks

            Louis


            • 3. Re: booking example with CVS version and jboss-head jboss-4.
              theute

              Did you update your persistence.xml file ?

              The syntax changed, check the booking example.

              • 4. Re: booking example with CVS version and jboss-head jboss-4.
                lcoetzee

                Yip, did that.

                For certain types of actions I can retrieve and persist stuff to the database. Unfortunately I haven't been able to figure out where or why it breaks (the specific components). I will tryn and spend some time over the weekend to analize it a bit more.

                Oh by the way, I followed the suggestions in:

                http://wiki.jboss.org/wiki/Wiki.jsp?page=FromJBossEJB3.0RC3ToRC4PFD

                Don't know if I missed something.

                Thanks

                L



                • 5. Re: booking example with CVS version and jboss-head jboss-4.
                  lcoetzee

                  Got it sorted out.

                  Based on http://www.jboss.com/index.html?module=bb&op=viewtopic&t=75968
                  I realized that I never defined the jndi in my persistence.xml.

                  To work properly one needs the following:
                  in web.xml

                   <!-- this only for use in jboss-seam beta 2-->
                   <context-param>
                   <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
                   <param-value>TrySeam1/#{ejbName}/local</param-value>
                   </context-param>
                  <context-param>
                   <param-name>
                   org.jboss.seam.core.init.managedPersistenceContexts
                   </param-name>
                   <param-value>trySeam1Entity</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>trySeam1Entity.persistenceUnitJndiName</param-name>
                   <param-value>
                   java:/EntityManagerFactories/trySeam1EntityF
                   </param-value>
                   </context-param>
                  

                  and very important in persistence.xml
                  <!-- this required for beta2 -->
                  <property name="jboss.entity.manager.factory.jndi.name"
                   value="java:/EntityManagerFactories/trySeam1EntityF"/>
                  


                  The documentation now clearly describes the requirements as well.

                  Thanks

                  L

                  • 6. Re: booking example with CVS version and jboss-head jboss-4.
                    gavin.king

                    Yeah, I truly apologise for all the painful changes in the area - mainly done to accommodate changes in the EJB spec. I hope this stuff is now locked down and documented sufficiently that it won't waste any more of people's time.

                    • 7. Re: booking example with CVS version and jboss-head jboss-4.
                      lcoetzee

                      Not a problem. We like the edge!

                      As an aside, seems I am strugling a bit to change my configuration for my test environment. I get the following error:

                      [testng] [INFO,NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                       [testng] [INFO,MCKernelAbstraction] installing bean: jboss.j2ee:service=EJB3,jar=test,name=HelloWorldAction with dependencies:
                       [testng] [INFO,Initialization] done initializing Seam
                       [testng] [INFO,Ejb] stopping the embedded EJB container
                       [testng] java.lang.IllegalArgumentException: EntityManagerFactory not found
                       [testng] at org.jboss.seam.core.ManagedPersistenceContext.create(ManagedPersistenceContext.java:55)
                       [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       [testng] at java.lang.reflect.Method.invoke(Method.java:585)
                       [testng] at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
                       [testng] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
                       [testng] at org.jboss.seam.Component.callComponentMethod(Component.java:1117)
                       [testng] at org.jboss.seam.Component.callCreateMethod(Component.java:1102)
                       [testng] at org.jboss.seam.Component.newInstance(Component.java:1091)
                       [testng] at org.jboss.seam.Component.getInstance(Component.java:1039)
                       [testng] at org.jboss.seam.Component.getInstance(Component.java:1022)
                       [testng] at csir.helloworld.test.HelloWorldEntityIntegrationTest$1.invokeApplication(HelloWorldEntityIntegrationTest.java:29)
                       [testng] at org.jboss.seam.mock.SeamTest$Script.run(SeamTest.java:187)
                       [testng] at csir.helloworld.test.HelloWorldEntityIntegrationTest.TestHelloWorldEntity(HelloWorldEntityIntegrationTest.java:25)
                       [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                       [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       [testng] at java.lang.reflect.Method.invoke(Method.java:585)
                       [testng] at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:463)
                       [testng] at org.testng.internal.Invoker.invokeMethod(Invoker.java:378)
                       [testng] at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:580)
                       [testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:89)
                       [testng] at org.testng.TestRunner.privateRun(TestRunner.java:612)
                       [testng] at org.testng.TestRunner.run(TestRunner.java:503)
                       [testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:219)
                       [testng] at org.testng.SuiteRunner.run(SuiteRunner.java:145)
                       [testng] at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:570)
                       [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:533)
                       [testng] at org.testng.TestNG.run(TestNG.java:310)
                       [testng] at org.testng.TestNG.privateMain(TestNG.java:660)
                       [testng] at org.testng.TestNG.main(TestNG.java:602)
                       [testng] Caused by: javax.naming.NameNotFoundException: napEntityManager not bound
                       [testng] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
                       [testng] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
                       [testng] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
                       [testng] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
                       [testng] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
                       [testng] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
                       [testng] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                       [testng] at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactory(ManagedPersistenceContext.java:78)
                       [testng] at org.jboss.seam.core.Ma


                      even though I have added
                      initParams.put(Init.JNDI_PATTERN, "#{ejbName}/local");
                      to my test class (which extends SeamTest) as well as adding
                      <!-- this required for beta2 -->
                       <property name="jboss.entity.manager.factory.jndi.name"
                       value="java:/EntityManagerFactories/napEntityManagerF" />
                      
                      to my persistence.xml.

                      I am not sure about the above though.

                      I have changed my persistence.xml used for testing.

                      Any suggestions what else I need to get the embedded container going again ?

                      Thanks

                      L

                      • 8. Re: booking example with CVS version and jboss-head jboss-4.
                        gavin.king

                        Is it a problem of "napEntityManager" vs "napEntityManagerF" ?

                        • 9. Re: booking example with CVS version and jboss-head jboss-4.
                          lcoetzee

                          Don't think so.

                          I have defined in my web.xml the following:

                           <context-param>
                           <param-name>
                           org.jboss.seam.core.init.managedPersistenceContexts
                           </param-name>
                           <param-value>napEntityManager</param-value>
                           </context-param>
                          
                           <context-param>
                           <param-name>
                           napEntityManager.persistenceUnitJndiName
                           </param-name>
                           <param-value>
                           java:/EntityManagerFactories/napEntityManagerF
                           </param-value>
                           </context-param>


                          In the same web.xml I also have:
                          <!-- this only for use in jboss-seam beta 2-->
                           <context-param>
                           <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
                           <param-value>NAP/#{ejbName}/local</param-value>
                           </context-param>
                          

                          This is weird, because I actually try and use
                          initParams.put(Init.JNDI_PATTERN, "#{ejbName}/local");

                          in my test class. (I use the same web.xml for test and normal deployment, but different persistence.xml, datasources etc.)

                          L


                          • 10. Re: booking example with CVS version and jboss-head jboss-4.
                            gavin.king

                            Well, its just that the exception says:

                            Caused by: javax.naming.NameNotFoundException: napEntityManager not bound

                            Are you certain it is picking up the right web.xml?

                            The JNDI pattern is not relevant. And yes, it needs to be different depending upon whether or not you are in an EAR. (As per docs.)

                            • 11. Re: booking example with CVS version and jboss-head jboss-4.
                              lcoetzee

                              I think I am messing up between my deployment and test environments.

                              My log file shows the following when running the tests.

                              [DEBUG,Component] org.jboss.seam.core.init.componentClasses=org.jboss.seam.core.Ejb
                              [DEBUG,Component] org.jboss.seam.core.init.jndiPattern=#{ejbName}/local
                              [DEBUG,Component] org.jboss.seam.core.init.managedPersistenceContexts=napEntityManager
                              

                              but later on it says:
                              [INFO,SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
                              


                              Jip, it is picking up the right (only) web.xml and not running from an ear (so I assume it should be without the ear name).

                              L

                              • 12. Re: booking example with CVS version and jboss-head jboss-4.
                                gavin.king

                                 

                                "lcoetzee" wrote:
                                I think I am messing up between my deployment and test environments.

                                My log file shows the following when running the tests.
                                [DEBUG,Component] org.jboss.seam.core.init.componentClasses=org.jboss.seam.core.Ejb
                                [DEBUG,Component] org.jboss.seam.core.init.jndiPattern=#{ejbName}/local
                                [DEBUG,Component] org.jboss.seam.core.init.managedPersistenceContexts=napEntityManager
                                

                                but later on it says:
                                [INFO,SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
                                


                                Jip, it is picking up the right (only) web.xml and not running from an ear (so I assume it should be without the ear name).

                                L


                                Both those things look correct.

                                You can ignore that message from SessionFactoryObjectFactory. You do not need the SessionFactory bound to JNDI when using EJB3.

                                I still believe that the problem is that your

                                napEntityManager.persistenceUnitJndiName

                                is not set.

                                • 13. Re: booking example with CVS version and jboss-head jboss-4.
                                  lcoetzee

                                  Jip you were right !

                                  For some reason it was not reading my web.xml (not doing any JSF stuff yet). However, when I defined

                                  org.jboss.seam.core.init.managedPersistenceContexts napEntityManager
                                  napEntityManager.persistenceUnitJndiName java:/EntityManagerFactories/napEntityManagerF
                                  in my seam.properties it worked like a charm !

                                  Thanks

                                  Louis


                                  • 14. Re: booking example with CVS version and jboss-head jboss-4.
                                    gavin.king

                                    Yes, note that the new defaulting rules are that if you don't specify persistenceUnitJndiName, the JNDI name of the EMF would default to "java:/napEntityManager", in your case.

                                    What I want to do for the next EJB3 release is sit down with Bill and define some defaulting rules for how resources and EMFs will be bound to the ENC or global JNDI *by default*, so that we can provide a similar functionality to org.jboss.seam.core.init.jndiPattern for resources and EMFs. That way we will eliminate the shitty mucking-with-JNDI-names stuff.

                                    1 2 Previous Next