Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » @ObjectTypeConverter + RCP = Error
@ObjectTypeConverter + RCP = Error [message #792276] Mon, 06 February 2012 20:36 Go to next message
Filipp A. is currently offline Filipp A.
Messages: 49
Registered: February 2010
Member
hi all!
i have a simple rcp + gemini
mapping works at all fine, but if i try to convert enum to string with @ObjectTypeConverter, i get an error. but with @Enumerated(EnumType.ORDINAL) is everything ok! do i something wrong, or is it bug from eclipselink or gemini? may be i forgot some bundle to activate before org.eclipse.gemini.jpa ?

mapping:
@ObjectTypeConverter(name = "stateEnumToString", dataType = String.class, objectType = State.class, 
conversionValues = {
	@ConversionValue(dataValue = "INITIAL", objectValue = "INITIAL"),
	@ConversionValue(dataValue = "ACTIVE", objectValue = "ACTIVE"),
	@ConversionValue(dataValue = "DELETED", objectValue = "DELETED"),
	@ConversionValue(dataValue = "UNKNOWN", objectValue = "UNKNOWN"),
	@ConversionValue(dataValue = "INACTIVE", objectValue = "INACTIVE")}
, defaultObjectValue = "UNKNOWN")



error:
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [puTestData] 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:1523)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1459)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1454)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:487)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:253)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:173)
	at java.lang.Thread.run(Thread.java:680)
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [puTestData] 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.converters.ObjectTypeConverterMetadata.process(ObjectTypeConverterMetadata.java:206)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processConvert(MappingAccessor.java:1352)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processMappingConverter(MappingAccessor.java:1533)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processMappingValueConverter(MappingAccessor.java:1562)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.BasicAccessor.process(BasicAccessor.java:383)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.processMappingAccessors(MetadataDescriptor.java:1435)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.processMappingAccessors(ClassAccessor.java:1482)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processMappingAccessors(EntityAccessor.java:1053)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:619)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1627)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:518)
	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)
	... 30 more


bundle start levels (rcp itself and bundle with data starts at default start level)
   <configurations>
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.gemini.jpa" autoStart="true" startLevel="3" />
      <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
      <plugin id="org.eclipse.persistence.jpa" autoStart="true" startLevel="0" />
   </configurations>

Re: @ObjectTypeConverter + RCP = Error [message #792328 is a reply to message #792276] Mon, 06 February 2012 22:16 Go to previous messageGo to next message
Michael Keith is currently offline Michael Keith
Messages: 215
Registered: July 2009
Senior Member
At first blush it looks like EclipseLink is using the wrong classloader for its object conversion, and we know how unforgiving OSGi is about that kind of thing. I'll poke around in the EclipseLink code and investigate some more, though.

-Mike
Re: @ObjectTypeConverter + RCP = Error [message #792806 is a reply to message #792328] Tue, 07 February 2012 12:34 Go to previous messageGo to next message
Filipp A. is currently offline Filipp A.
Messages: 49
Registered: February 2010
Member
Ok, thanks! I hope to hear good news from you soon.
Re: @ObjectTypeConverter + RCP = Error [message #793090 is a reply to message #792806] Tue, 07 February 2012 19:17 Go to previous messageGo to next message
Michael Keith is currently offline Michael Keith
Messages: 215
Registered: July 2009
Senior Member
Well, not sure if it's good news, yet, but we're getting somewhere, at least. It looks like it is related to the fact that EclipseLink is using the temp loader to load some of the classes in the object converter, but the temp loader is not the right one. There is already a bug registered against this problem [1]. (Although it was hit in a slightly different case it is essentially the same problem).

I am going to see if I can find a way to work around the EclipseLink bug once and for all by getting it to set its temp loader to the real loader. Have entered an enhancement against Gemini JPA to do this [2]. This should work as long as it does not use the temp loader to load a class that eventually needs to be woven.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=354678
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=370874
Re: @ObjectTypeConverter + RCP = Error [message #793130 is a reply to message #793090] Tue, 07 February 2012 20:18 Go to previous messageGo to next message
Filipp A. is currently offline Filipp A.
Messages: 49
Registered: February 2010
Member
It's really bad news.... Sad some idea, how long it will be till patch? or some workaround?
Re: @ObjectTypeConverter + RCP = Error [message #793764 is a reply to message #793130] Wed, 08 February 2012 14:36 Go to previous messageGo to next message
Michael Keith is currently offline Michael Keith
Messages: 215
Registered: July 2009
Senior Member
Well, as a workaround have you tried using @Converter/@Convert?
Re: @ObjectTypeConverter + RCP = Error [message #794067 is a reply to message #793764] Wed, 08 February 2012 22:13 Go to previous messageGo to next message
Filipp A. is currently offline Filipp A.
Messages: 49
Registered: February 2010
Member
thank you for info & ideas! in my case i have changed to @Enumerated and it's works fine!

[Updated on: Wed, 08 February 2012 22:14]

Report message to a moderator

Re: @ObjectTypeConverter + RCP = Error [message #796623 is a reply to message #793090] Sun, 12 February 2012 09:01 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum Tsvetkov
Messages: 149
Registered: July 2009
Senior Member
Mike,

I've also opened a bug some time ago, which seems to have the same root cause. Do you think it is the same?

Krum
Re: @ObjectTypeConverter + RCP = Error [message #796624 is a reply to message #796623] Sun, 12 February 2012 09:01 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum Tsvetkov
Messages: 149
Registered: July 2009
Senior Member
Sorry, forgot the link https://bugs.eclipse.org/bugs/show_bug.cgi?id=366017
Re: @ObjectTypeConverter + RCP = Error [message #797760 is a reply to message #792276] Mon, 13 February 2012 21:44 Go to previous message
Michael Keith is currently offline Michael Keith
Messages: 215
Registered: July 2009
Senior Member
Yes, that is also the same problem. EclipseLink was supposed to have removed all instances of the temp loader but there are apparently still a few places where it uses it to load some classes.
Previous Topic:Problems using cm-properties in Gemini blueprint
Next Topic:Gemini JPA Getting Started Sample App
Goto Forum:
  


Current Time: Thu Oct 23 02:36:50 GMT 2014

Powered by FUDForum. Page generated in 0.04169 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software