persist() kicking up error about unknown entity type [message #645378] |
Thu, 16 December 2010 15:02  |
Eclipse User |
|
|
|
When attempting to persist an instance of an entity which has been identified in the persistence.xml. I am getting an error "java.lang.IllegalArgumentException: Object: com.hwcs.producta.jpa.StagingMtrdev@5d51fe8a is not a known entity type". The class StagingMtrdev is in the persistence.xml and other entities have been persisted before this would be. What is curious is that this problem earlier had not consistently arisen so I am perplexed as to the cause.
Here is the full stacktrace:
Object: com.hwcs.producta.jpa.StagingMtrdev@5d51fe8a is not a known entity type.
java.lang.IllegalArgumentException: Object: com.hwcs.producta.jpa.StagingMtrdev@5d51fe8a is not a known entity type.
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.reg isterNewObjectForPersist(UnitOfWorkImpl.java:4199)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persi st(EntityManagerImpl.java:384)
at com.hwcs.producta.xml.sax.VmonSaxEventHandler.BuildMtrDev(Vm onSaxEventHandler.java:2112)
at com.hwcs.producta.xml.sax.VmonSaxEventHandler.EndFrameElemen t(VmonSaxEventHandler.java:317)
at com.hwcs.producta.xml.sax.VmonSaxEventHandler.endElement(Vmo nSaxEventHandler.java:156)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unkno wn Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEn dElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
at com.hwcs.producta.action.ProcessVelocitySaxImpl.Execute(Proc essVelocitySaxImpl.java:161)
at com.hwcs.producta.main.ProcessVMData.Execute(ProcessVMData.j ava:204)
at com.hwcs.producta.main.ProcessVMData.main(ProcessVMData.java :86)
And here is a piece of the persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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_2_0.xsd">
<persistence-unit name="JpaPU" transaction-type="RESOURCE_LOCAL">
<class>com.hwcs.producta.jpa.StagingMtrsy</class>
... properties for the driver, etc.
</persistence-unit>
</persistence>
I have seen various instances of this arise but could find anything that explained the problem, especially its intermittent nature.
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.03764 seconds