9 Replies Latest reply on Mar 30, 2007 3:58 PM by mgrouch

    Deploying JBoss Seam Booking JPA example to WebLogic 9.1

    mgrouch Expert

      I've built JBoss Seam Booking JPA example for weblogic from jboss-seam-1.2.1.GA release. It gives the following error when I try to deploy it into
      WebLogic 9.1

      java.lang.NoSuchMethodError:
      javax.persistence.ManyToOne.targetEntity()Ljava/lang/Class;
      





      12:22:16,957 INFO [Component] Component: register, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.example.jpa.RegisterAction
      12:22:16,957 INFO [Component] Component: user, scope: SESSION, type: ENTITY_BEAN, class: org.jboss.seam.example.jpa.User
      12:22:16,973 INFO [Lifecycle] starting up: bookingDatabase
      12:22:17,020 INFO [Version] Hibernate EntityManager 3.2.1.GA
      12:22:17,082 INFO [Version] Hibernate Annotations 3.2.1.GA
      12:22:17,098 INFO [Environment] Hibernate 3.2.1
      12:22:17,114 INFO [Environment] hibernate.properties not found
      12:22:17,114 INFO [Environment] Bytecode provider name : cglib
      12:22:17,114 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      12:22:17,661 INFO [AnnotationBinder] Binding entity from annotated class: org.jboss.seam.example.jpa.Booking
      12:22:17,801 INFO [EntityBinder] Bind entity org.jboss.seam.example.jpa.Booking on table Booking
      <Mar 29, 2007 12:22:17 PM EDT> <Warning> <HTTP> <BEA-101162> <User defined listener org.jboss.seam.servlet.SeamListener failed: java.lang.Run
      timeException: exception invoking: startup.
      java.lang.RuntimeException: exception invoking: startup
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:133)
      at org.jboss.seam.Component.callComponentMethod(Component.java:1842)
      at org.jboss.seam.Component.callCreateMethod(Component.java:1757)
      at org.jboss.seam.Component.newInstance(Component.java:1746)
      at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
      at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:145)
      at org.jboss.seam.init.Initialization.init(Initialization.java:504)
      at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
      at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:374)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:83)
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1581)
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2678)
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:874)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:326)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:114)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:25)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:640)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:252)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:567)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:131)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:101)
      at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:126)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:329)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:845)
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1246)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:432)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliv
      erer.java:181)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.j
      ava:12)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:6
      7)
      at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
      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.seam.util.Reflections.invoke(Reflections.java:20)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
      at org.jboss.seam.Component.callComponentMethod(Component.java:1842)
      at org.jboss.seam.Component.callCreateMethod(Component.java:1757)
      at org.jboss.seam.Component.newInstance(Component.java:1746)
      at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
      at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:145)
      at org.jboss.seam.init.Initialization.init(Initialization.java:504)
      at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
      at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:374)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:83)
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1581)
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2678)
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:874)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:326)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:114)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:25)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:640)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:252)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:567)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:131)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:101)
      at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:126)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:329)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:845)
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1246)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:432)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliv
      erer.java:181)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.j
      ava:12)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:6
      7)
      at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
      java.lang.NoSuchMethodError: javax.persistence.ManyToOne.targetEntity()Ljava/lang/Class;
      at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1260)
      at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:710)
      at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
      at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
      at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1112)
      at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1233)
      at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:869)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:183)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:240)
      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
      at org.jboss.seam.core.EntityManagerFactory.startup(EntityManagerFactory.java:70)
      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.seam.util.Reflections.invoke(Reflections.java:20)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
      at org.jboss.seam.Component.callComponentMethod(Component.java:1842)
      at org.jboss.seam.Component.callCreateMethod(Component.java:1757)
      at org.jboss.seam.Component.newInstance(Component.java:1746)
      at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
      at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:145)
      at org.jboss.seam.init.Initialization.init(Initialization.java:504)
      at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
      at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:374)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:83)
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1581)
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2678)
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:874)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:326)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:114)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:25)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:640)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:252)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:567)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:131)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:101)
      at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:126)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:329)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:845)
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1246)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:432)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliv
      erer.java:181)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.j
      ava:12)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:6
      7)
      at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
      >



      Thanks

        • 1. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
          mgrouch Expert

          From Java documentation java.lang.NoSuchMethodError

          Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.

          Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.


          Any clues how definition of javax.persistence.ManyToOne.targetEntity()
          could change?

          Thanks a lot

          • 2. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
            Gavin King Master

            Can only happen if BEA does not implement the spec correctly :-)

            • 3. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
              mgrouch Expert

              Is there any workaround to make it work on WebLogic 9.1? Thx

              • 4. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
                mgrouch Expert

                I've found this post on Bea forums


                # Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.EntityManagerFactory.getEntityManager()Ljavax/persistence/EntityManager;

                Curious, I think this could be a bug from Hibernate or ejb3-persistance implementation.

                * Problems using JPA implemented by Hibernate in Weblogic 9.1
                2006-10-02 01:52:00 konrad_a@poczta.fm [Reply | View]

                The cause of NoSuchMethodError is that weblogic.jar contains javax.persisence.EntityManager interface which is in conflict with JPA 1.0 (EJB 3.0) persistence.jar shipped with Hibernate 3.2. As weblogic.jar is first on the classpath, the problem occurs. The solution is to copy "persistence.jar" to WL's JDK lib/ext dir (normally it is bea/jdk150_03/jre/lib/ext) and restart the server.


                I will try that.

                • 5. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
                  mgrouch Expert

                  Putting ejb3-persistence.jar before weblogic.jar on JVM classpath solved this problem.

                  I've got a new one though

                  Unable to resolve 'examples-dataSource-demoPool'


                  <Mar 29, 2007 11:42:42 PM EDT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'jboss-seam-jp
                  a'.
                  weblogic.application.ModuleException:
                  at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:876)
                  at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:326)
                  at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:114)
                  at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
                  at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                  at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
                  at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:25)
                  at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:640)
                  at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                  at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:252)
                  at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
                  at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
                  at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:176)
                  at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:347)
                  at weblogic.management.deploy.internal.DeploymentAdapter$1.activate(DeploymentAdapter.java:50)
                  at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
                  at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:232)
                  at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:168)
                  at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
                  at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
                  at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
                  at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
                  at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
                  at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
                  at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
                  javax.naming.NameNotFoundException: Unable to resolve 'examples-dataSource-demoPool'. Resolved ''; remaining name 'examples-dataSource-demoPo
                  ol'
                  at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1123)


                  • 6. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
                    Ajaneesh Rajashekharaiah Newbie

                    i think the solution would be to override the transaction api of weblogic by adding ejb3-persistence.jar before weblogic.jar in startWebLogic.sh/bat

                    This solved a similar problem for me.

                    However i hope it doesnt affect other application in the same domain!

                    • 7. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
                      Ajaneesh Rajashekharaiah Newbie

                      Looks like you created the pool/datasource but have not targeted it to any server. check "" node in config.xml

                      • 9. Re: Deploying JBoss Seam Booking JPA example to WebLogic 9.1
                        mgrouch Expert

                        Got it working after configuring pointbase demo DB in my weblogic instance.
                        Thanks all!