Community
Participate
Working Groups
Build Identifier: 2.3.0.v20110604-r9504 I recently tried to port some persisted classes from hibernate (with JPA2.0 annotations) to eclipse link and encountered the following error, another procejt with just one simple test entity works fine. Except the stacktrace everything works fine, object could be persisted/loaded: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [berichtgenerator] failed. Internal Exception: Exception [EclipseLink-7156] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.ValidationException Exception Description: Unable to find the class named [java.lang.String]. Ensure the class name/path is correct and available to the classloader. Internal Exception: java.lang.ClassNotFoundException: java/lang/String at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1385) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:98) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:306) at org.eclipse.gemini.jpa.provider.GeminiOSGiInitializer.initializeFromBundle(GeminiOSGiInitializer.java:119) at org.eclipse.gemini.jpa.provider.EclipseLinkOSGiProvider.assignPersistenceUnitsInBundle(EclipseLinkOSGiProvider.java:191) at org.eclipse.gemini.jpa.PersistenceBundleExtender.tryAssigningPersistenceUnitsInBundle(PersistenceBundleExtender.java:172) at org.eclipse.gemini.jpa.PersistenceBundleExtender.bundleChanged(PersistenceBundleExtender.java:314) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1522) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1458) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1453) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:485) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:251) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:173) at java.lang.Thread.run(Thread.java:662) Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [berichtgenerator] failed. Internal Exception: Exception [EclipseLink-7156] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.ValidationException Exception Description: Unable to find the class named [java.lang.String]. Ensure the class name/path is correct and available to the classloader. Internal Exception: java.lang.ClassNotFoundException: java/lang/String at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:221) ... 17 more Caused by: Exception [EclipseLink-7156] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.ValidationException Exception Description: Unable to find the class named [java.lang.String]. Ensure the class name/path is correct and available to the classloader. Internal Exception: java.lang.ClassNotFoundException: java/lang/String at org.eclipse.persistence.exceptions.ValidationException.unableToLoadClass(ValidationException.java:1949) at org.eclipse.persistence.internal.jpa.metadata.MetadataHelper.getClassForName(MetadataHelper.java:111) at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.getJavaClass(ORMetadata.java:273) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.DirectCollectionAccessor.processDirectMapMapping(DirectCollectionAccessor.java:446) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ElementCollectionAccessor.process(ElementCollectionAccessor.java:737) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processDirectCollectionAccessors(MetadataProject.java:1388) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1659) at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:521) at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1320) ... 16 more Caused by: java.lang.ClassNotFoundException: java/lang/String at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:119) at org.eclipse.persistence.internal.jpa.metadata.MetadataHelper.getClassForName(MetadataHelper.java:97) ... 24 more Reproducible: Always Steps to Reproduce: N/A habens on one project all the time, does not happens on another one
It looks like this is happening on an ElementCollection that is a Map. Can you narrow down which one is the problem and provide the mapping information for it? (i.e. annotations, orm.xml, and definition)
(In reply to comment #1) > It looks like this is happening on an ElementCollection that is a Map. Can you > narrow down which one is the problem and provide the mapping information for > it? (i.e. annotations, orm.xml, and definition) I have just one file containing Element Collection, the file looks like this: @Table(name = "Literatur") @Entity public class Literatur extends PersitentBase { @ElementCollection(fetch = FetchType.EAGER) @Column(name = "fields") private final Map<String, String> fields = new HashMap<String, String>(); private String name; private String typ; private long bibliothek_id; [... getter and setter ...] } @MappedSuperclass public class PersitentBase { @Version private long version; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; [... getter and setter ...] } persistence.xml: <persistence version="1.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_1_0.xsd"> <persistence-unit name="berichtgenerator" transaction-type="RESOURCE_LOCAL"> <class>de.laeubisoft.berichtgenerator.storage.db.dao.Literatur</class> <class>de.laeubisoft.berichtgenerator.storage.db.dao.PersitentBase</class> [... other classes ...] <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="eclipselink.target-database" value="MySQL"/> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/test" /> <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> <property name="javax.persistence.jdbc.user" value="root" /> <property name="javax.persistence.jdbc.password" value="" /> <property name="eclipselink.weaving" value="false"/> </properties> </persistence-unit> </persistence>
where are you deploying? application server? which one? How is EclipseLink made available? How is your application packaged?
(In reply to comment #3) > where are you deploying? application server? which one? How is EclipseLink > made available? How is your application packaged? The application is deployed inside an Equinox OSGi framework using the JPA Service provided with Eclipse Gemini. I'm currently launching the application from within the Eclipse IDE.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink