Details
Description
From webapp, submitting a NEW record to the database causes the JPA object to not correctly rollback in the database and throws a openjpa-1.1.1-SNAPSHOT error (currently using openjpa-1.2.1.jar).
Why does the console print 1.1.1 for the openjpa when the project needs to be using .1.2.1 openjpa??
The openjpa-1.2.1.jar is located in the Referenced Libraries folder of the project.
The below persistence.xml has been modifed a few times with and without the Connection* property entries all with the same failures. The project was migrated from Websphere and is not suppose to run on WebLogic. It is possible that that 1.2.1 openjpa jars are not being used by WebLogic and that this might be configuration.
===== persistence.xml
<?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"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="NRPPU" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>jdbc/NrpJtaDS</jta-data-source>
<properties>
<property name="openjpa.TransactionMode" value="managed"/>
<property name="openjpa.ConnectionFactoryMode" value="managed"/>
<property name="openjpa.jdbc.DBDictionary" value="db2"/>
<property name="openjpa.DetachState" value="all(DetachedStateField=true)" />
<property name="openjpa.ConnectionURL" value="jdbc:db2://XXX.xxx.XXX.212:60004/XXXXXDB"/>
<property name="openjpa.ConnectionDriverName" value="com.ibm.db2.jcc.DB2Driver"/>
<property name="openjpa.ConnectionUserName" value="XXXXX"/>
<property name="openjpa.ConnectionPassword" value="XXXXXX"/>
<property name="openjpa.jdbc.Schema" value="XXXDATA"/>
<!--
<property name="openjpa.Log" value="SQL=TRACE"/>
-->
<property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO, MetaData=INFO, Enhance=INFO, Schema=INFO, Runtime=INFO, Query=INFO, JDBC=INFO"/>
</properties>
</persistence-unit>
</persistence>
====== Error from Console
SEVERE: <openjpa-1.1.1-SNAPSHOT-r422266:807362 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_AGENT" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
javax.faces.el.EvaluationException: <openjpa-1.1.1-SNAPSHOT-r422266:807362 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_AGENT" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:97)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at us.tx.state.txdps.nrp.common.listener.ExceptionActionListener.processAction(ExceptionActionListener.java:15)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:450)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:759)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:122)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:73)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:28)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:42)
at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:62)
at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:22)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: <openjpa-1.1.1-SNAPSHOT-r422266:807362 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_AGENT" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
at org.apache.openjpa.jdbc.sql.PrimaryRow.setObject(PrimaryRow.java:339)
at org.apache.openjpa.jdbc.sql.RowImpl.setObject(RowImpl.java:504)
at org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy.insert(InValueDiscriminatorStrategy.java:98)
at org.apache.openjpa.jdbc.meta.Discriminator.insert(Discriminator.java:343)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.insert(AbstractUpdateManager.java:212)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.insert(AbstractUpdateManager.java:196)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.populateRowManager(AbstractUpdateManager.java:145)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:85)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:549)
at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
at org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:554)
at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2017)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1915)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1686)
at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:989)
at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:592)
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 weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:93)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
at $Proxy79.flush(Unknown Source)
at us.tx.state.txdps.nrp.persistence.jpa.dao.AnlAnalystReviewDaoBase.flush(AnlAnalystReviewDaoBase.java:61)
at us.tx.state.txdps.nrp.ejb.analysis.AnalystReviewEjb.createAnalystReview(AnalystReviewEjb.java:212)
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 com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
at us.tx.state.txdps.nrp.ejb.interceptor.LoggingInterceptor.queryResponseTimer(LoggingInterceptor.java:63)
at sun.reflect.GeneratedMethodAccessor403.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy200.createAnalystReview(Unknown Source)
at us.tx.state.txdps.nrp.ejb.analysis.AnalystReviewEjb_20kbwm_AnalystReviewEjbRemoteImpl.createAnalystReview(AnalystReviewEjb_20kbwm_AnalystReviewEjbRemoteImpl.java:67)
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 weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
at $Proxy89.createAnalystReview(Unknown Source)
at us.tx.state.txdps.nrp.analysis.backing.AnalystReviewBacking.saveAnalystReview(AnalystReviewBacking.java:500)
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 com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
... 38 more
Mar 19, 2010 2:46:18 PM us.tx.state.txdps.nrp.common.ejb.EjbLookupFactory lookupJndi
INFO: EJB Lookup Succeeded for: BatchEjb#us.tx.state.txdps.batch.ejb.BatchEjbRemote
Mar 19, 2010 2:46:18 PM us.tx.state.txdps.nrp.common.ejb.EjbLookupFactory lookupJndi
INFO: EJB Lookup Succeeded for: BatchEjb#us.tx.state.txdps.batch.ejb.BatchEjbRemote
Mar 19, 2010 2:46:18 PM us.tx.state.txdps.batch.manager.MessageManager info
INFO: AUTOMATIC.JobHistoryCleanup - Found 0 scheduled jobs.
Mar 19, 2010 2:46:18 PM us.tx.state.txdps.batch.manager.MessageManager info
INFO: AUTOMATIC.JobScheduler - Found 0 queued jobs.
Mar 19, 2010 2:46:18 PM us.tx.state.txdps.batch.manager.MessageManager info
INFO: AUTOMATIC.JobHistoryCleanup - Found 0 executing jobs.