当我尝试使用openJPA更新或删除数据库中的任何项目时,我得到以下异常:
引起:java.lang.NullPointerException at org.apache.openjpa.kernel.StateManagerImpl.replaceObjectField(StateManagerImpl.java:2076) 在org.apache.openjpa.enhance.com $ freightliner $ viva $ dao $ VivaSubgroupItems $ pcsubclass.pcReplaceField(Unknown Source) at org.apache.openjpa.kernel.StateManagerImpl.replaceField(StateManagerImpl.java:3041) at org.apache.openjpa.kernel.StateManagerImpl.storeObjectField(StateManagerImpl.java:2473) at org.apache.openjpa.kernel.StateManagerImpl.storeObject(StateManagerImpl.java:2463) 在org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.load(StoreCollectionFieldStrategy.java:573) 在org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:819) 在org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:692) 在com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.load(WsJpaJDBCStoreManager.java:125) 在org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116) 在org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78) at org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2937) at org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:3015) at org.apache.openjpa.kernel.StateManagerImpl.fetchObjectField(StateManagerImpl.java:2258) at org.apache.openjpa.kernel.StateManagerImpl.fetchField(StateManagerImpl.java:778) at org.apache.openjpa.kernel.StateManagerImpl.fetch(StateManagerImpl.java:740) 在org.apache.openjpa.enhance.RedefinitionHelper $ 1.invoke(RedefinitionHelper.java:230) at com.sun.proxy。$ Proxy17.isEmpty(Unknown Source) 在org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:213) 在org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:153) 在org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:241) 在org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:101) 在org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3244) ......还有6个
答案 0 :(得分:0)
您需要使用其他增强策略。你必须设置openjpa.RuntimeUnenhancedClasses =支持,这将导致你误入歧途。这个功能充其量只是错误。
You will need to either setup build time enhancement, or configured the -javaagent enhancer.