问题
The second line is causing the exception listed below. This code actually works on the test server, but is blowing up on my box. Can anyone offer a clue what I need to look at to solve this?
TypedQuery<ed> _TypedQuery = _EntityManager.createQuery(_CriteriaQuery);
List<ed> _edList = _TypedQuery.getResultList();
Exception
org.apache.openjpa.persistence.PersistenceException: null
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1017) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:916) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1012) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:60) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2075) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286) ~[openjpa-2.2.0.jar:2.2.0]
at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302) ~[openjpa-2.2.0.jar:2.2.0]
回答1:
I'll document all my solutions to this problem.
This is the 1st resolution. The clue was here. I upgraded Open JPA from 2.2.0 to 2.2.2 & the exception went away, so it appears that it was a bug.
This happened again. I was missing cglib.2.2.3.zip and/or cglib-nodep-2.2.3.jar.
来源:https://stackoverflow.com/questions/38087792/org-apache-openjpa-persistence-persistenceexception-null