Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Eclipselink in OSGI environment: "not a known entity type" on bundle reload

Hi,
I'm just starting out with the latest EclipseLink release
(1.1.2.v20090612-r4475) in my OSGI environment  based on Equinox
3.5.0.v20090520. I have created a very simple test of inserting/updating a
single entity within a bundle containing persistence.xml and
JPA-PersistenceUnits bundle header. It works and all is well until I update
my test bundle. At that point, a merge() or persist() of my entity results
in an IllegalArgumentException: "Object:
edu.udel.sampleform.model.MainForm@b5cd8 is not a known entity type."[1]

By stepping through the code in debug mode, I can see that my newly created
EntityManager contains (within
EntityManager.serverSession.project.descriptors) a reference to the previous
version of my entity's class and a ClassDescriptor is not found for the
actual class, resulting in the exception.

Restarting the EclipseLink core bundle fixes the error, but that results in
restarting every bundle that uses EclipseLink. Are there additional steps I
can take to ensure that a single bundle's old entity classes are cleared and
the new versions processed on that bundle's restart?

Thanks,
Dave.

[1]
java.lang.IllegalArgumentException: Object:
edu.udel.sampleform.model.MainForm@157e43 is not a known entity type.
	at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:3368)
	at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.mergeCloneWithReferences(RepeatableWriteUnitOfWork.java:257)
	at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:3339)
	at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.mergeInternal(EntityManagerImpl.java:296)
	at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.merge(EntityManagerImpl.java:274)
	at
edu.udel.sampleform.controller.FormFactory.createForm(FormFactory.java:42)
        ...

-- 
View this message in context: http://www.nabble.com/Eclipselink-in-OSGI-environment%3A-%22not-a-known-entity-type%22-on-bundle-reload-tp25194351p25194351.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top