Skip to main content

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

Hi Dave,

   I believe this is a known limitation (i.e.,  update support not yet implemented).  I've filed bug 288141 to track this and included your email.

          Shaun

Dave W. wrote:
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)
        ...

  

--
Oracle
Shaun Smith | Principal Product Manager
Phone: +19055023094
Oracle Server Technologies, Oracle TopLink
ORACLE Canada | 110 Matheson Boulevard West, Suite 100, Mississauga, Ontario | L5R 3P4

Green Oracle Oracle is committed to developing practices and products that help protect the environment

Back to the top