1 Reply Latest reply on Sep 16, 2008 9:12 AM by Mark Little

    OpenJPA

    Oleg Priadko Newbie

      There is problem when i use openJPA and Spring. Can anybody help me
      ...

      Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate cannot be cast to javax.transaction.TransactionManager
      at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:361)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:255)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
      at $Proxy349.save(Unknown Source)
      at ru.artezio.service.impl.MessageServiceImpl.save(MessageServiceImpl.java:25)
      at ru.artezio.portlet.task.addMessage.onSubmitAction(addMessage.java:25)
      at org.springframework.web.portlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:322)
      at org.springframework.web.portlet.mvc.AbstractFormController.handleActionRequestInternal(AbstractFormController.java:389)
      at org.springframework.web.portlet.mvc.AbstractController.handleActionRequest(AbstractController.java:197)
      at org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter.handleAction(SimpleControllerHandlerAdapter.java:46)
      at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:638)
      at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:418)
      at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:400)
      at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.invokeAction(PortletContainerImpl.java:458)
      at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:401)
      at org.jboss.portal.portlet.container.PortletContainerInvoker$1.invoke(PortletContainerInvoker.java:86)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
      at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:86)
      at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
      at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
      at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
      at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
      at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
      at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeNotSupported(TransactionInterceptor.java)
      at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor.invoke(ProducerCacheInterceptor.java:53)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.portlet.AjaxInterceptor.invoke(AjaxInterceptor.java:51)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.ModesInterceptor.invoke(ModesInterceptor.java:62)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:47)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:55)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor.invoke(PortletSessionSynchronizationInterceptor.java:80)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:46)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:104)
      at org.jboss.portal.web.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:74)
      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.portal.web.command.CommandServlet.doGet(CommandServlet.java:131)
      at org.jboss.portal.web.command.CommandServlet.doPost(CommandServlet.java:162)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
      at org.jboss.portal.web.command.CommandServlet.include(CommandServlet.java:80)
      at org.jboss.portal.web.command.CommandDispatcher.include(CommandDispatcher.java:50)
      at org.jboss.portal.web.jboss.JBossWebContext.include(JBossWebContext.java:66)
      at org.jboss.portal.web.ServletContainer.include(ServletContainer.java:182)
      at org.jboss.portal.portlet.impl.spi.AbstractRequestContext.dispatch(AbstractRequestContext.java:81)
      at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:76)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:68)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.ValveInterceptor.invoke(ValveInterceptor.java:60)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
      at org.jboss.portal.portlet.container.PortletContainerInvoker.invoke(PortletContainerInvoker.java:198)
      at org.jboss.portal.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:233)
      at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.org$jboss$portal$core$impl$portlet$state$ProducerPortletInvoker$invoke$aop(ProducerPortletInvoker.java:53)
      at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
      at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java)
      at org.jboss.portal.portlet.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:147)
      at org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:150)
      at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$1.invoke(InstanceContainerImpl.java:99)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
      at org.jboss.portal.portlet.management.PortletContainerManagementInterceptorImpl.invoke(PortletContainerManagementInterceptorImpl.java:58)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor.invoke(PortalSessionSynchronizationInterceptor.java:91)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:91)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:175)
      at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
      at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.org$jboss$portal$core$impl$model$instance$InstanceContainerImpl$invoke$aop(InstanceContainerImpl.java:427)
      at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
      at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.invoke(InstanceContainerImpl.java)
      at org.jboss.portal.core.impl.model.instance.AbstractInstance.invoke(AbstractInstance.java:231)
      at org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand.execute(InvokePortletWindowActionCommand.java:174)
      at org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
      at org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:123)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:134)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:78)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:56)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:56)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
      at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
      at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
      at org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
      at org.jboss.portal.core.controller.Controller.processCommand(Controller.java:235)
      ... 63 more
      Caused by: <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate cannot be cast to javax.transaction.TransactionManager
      at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(AbstractBrokerFactory.java:754)
      at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:320)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:216)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
      at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
      at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:378)
      at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:302)
      ... 216 more
      Caused by: java.lang.ClassCastException: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate cannot be cast to javax.transaction.TransactionManager
      at org.apache.openjpa.ee.JNDIManagedRuntime.getTransactionManager(JNDIManagedRuntime.java:60)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(AbstractBrokerFactory.java:721)
      ... 225 more