Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF with Maven(org.eclipse.core.runtime.Platform (java.lang.NoClassDefFoundError))
EMF with Maven [message #1651860] Thu, 05 March 2015 14:57 Go to next message
Syed Rizvi is currently offline Syed RizviFriend
Messages: 7
Registered: February 2015
Junior Member
Hi,
I'm working with EMF on a non-plugin, Google AppEngine Maven based project. I have the following dependencies as stated in my pom.xml:

<version.emfcommon>2.8.0.v20120911-0500</version.emfcommon>
<version.emfecore>2.8.1.v20120911-0500</version.emfecore>
<version.emfecorexmi>2.8.0.v20120911-0500</version.emfecorexmi>
<version.emfquery>1.2.100.v200903190031_fixed</version.emfquery>
<version.emfqueryocl>2.0.0.v20091215-1624</version.emfqueryocl>
<version.ocl>3.2.1.v20120917-1739</version.ocl>
<version.oclcommon>1.0.0.v20120516-1543</version.oclcommon>
<version.oclecore>3.2.0.v20120522-1637</version.oclecore>
<version.osgi>3.8.1.v20120830-144521</version.osgi>
<version.core.runtime>3.7.0</version.core.runtime>


The project works find on the local machine but not when deployed to GAE. There I get the org.eclipse.core.runtime.Platform (java.lang.NoClassDefFoundError). How could this be? Are there any dependencies that I am somehow forgetting?

I can see all dependencies being present in the war/WEB-INF/lib folder too. There isn't a chance that a NoClassDefFoundError could arise. Here's a complete stacktrace:

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.core.runtime.Platform
at org.eclipse.ocl.common.OCLCommon.getPreference(OCLCommon.java:74)
at org.eclipse.ocl.lpg.AbstractBasicEnvironment.getValue(AbstractBasicEnvironment.java:440)
at org.eclipse.ocl.options.ParsingOptions.getValue(ParsingOptions.java:330)
at org.eclipse.ocl.AbstractEnvironment.createTypeChecker(AbstractEnvironment.java:1214)
at org.eclipse.ocl.AbstractEnvironment.getTypeChecker(AbstractEnvironment.java:1196)
at org.eclipse.ocl.AbstractEnvironment.getAdapter(AbstractEnvironment.java:1236)
at org.eclipse.ocl.util.OCLUtil.getAdapter(OCLUtil.java:102)
at org.eclipse.ocl.util.TypeUtil.getTypeCheckerAdapter(TypeUtil.java:800)
at org.eclipse.ocl.util.TypeUtil.findAttribute(TypeUtil.java:171)
at org.eclipse.ocl.AbstractEnvironment.doLookupProperty(AbstractEnvironment.java:657)
at org.eclipse.ocl.AbstractEnvironment.lookupProperty(AbstractEnvironment.java:638)
at org.eclipse.ocl.AbstractTypeResolver.findTupleType(AbstractTypeResolver.java:430)
at org.eclipse.ocl.AbstractTypeResolver.resolveTupleType(AbstractTypeResolver.java:382)
at org.eclipse.ocl.AbstractTypeResolver$ResolveSwitch.caseTupleType(AbstractTypeResolver.java:1008)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:267)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:117)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:122)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:105)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.eclipse.ocl.AbstractTypeResolver.resolve(AbstractTypeResolver.java:127)
at org.eclipse.ocl.AbstractTypeResolver$ResolveSwitch.caseCollectionType(AbstractTypeResolver.java:1003)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:168)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:117)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:122)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitchSuperTypes(TypesSwitch.java:122)
at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:105)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.eclipse.ocl.AbstractTypeResolver.resolve(AbstractTypeResolver.java:127)
at org.eclipse.ocl.util.TypeUtil.resolveType(TypeUtil.java:617)
at org.eclipse.ocl.util.OCLStandardLibraryUtil.getSetType(OCLStandardLibraryUtil.java:2216)
at org.eclipse.ocl.util.OCLStandardLibraryUtil.createCollectionOperations(OCLStandardLibraryUtil.java:1754)
at org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl.build(OCLStandardLibraryImpl.java:375)
at org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl.init(OCLStandardLibraryImpl.java:205)
at org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl.<clinit>(OCLStandardLibraryImpl.java:97)
at org.eclipse.ocl.ecore.EcoreEnvironment.getOCLStandardLibrary(EcoreEnvironment.java:271)
at org.eclipse.ocl.parser.AbstractOCLAnalyzer.booleanLiteralExpCS(AbstractOCLAnalyzer.java:3041)
at org.eclipse.ocl.parser.AbstractOCLAnalyzer.primitiveLiteralExpCS(AbstractOCLAnalyzer.java:2922)
at org.eclipse.ocl.parser.AbstractOCLAnalyzer.literalExpCS(AbstractOCLAnalyzer.java:3107)
at org.eclipse.ocl.parser.AbstractOCLAnalyzer.oclExpressionCS(AbstractOCLAnalyzer.java:1983)
at org.eclipse.ocl.parser.AbstractOCLAnalyzer.invCS(AbstractOCLAnalyzer.java:1440)
at org.eclipse.ocl.parser.AbstractOCLAnalyzer.invOrDefCS(AbstractOCLAnalyzer.java:1420)
at org.eclipse.ocl.parser.OCLAnalyzer.parseInvOrDefCS(OCLAnalyzer.java:266)
at org.eclipse.ocl.internal.helper.HelperUtil.parseQuery(HelperUtil.java:164)
at org.eclipse.ocl.internal.helper.OCLHelperImpl.createQuery(OCLHelperImpl.java:176)
at org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.<init>(AbstractOCLCondition.java:211)
at org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition.<init>(BooleanOCLCondition.java:149)
at org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition.<init>(BooleanOCLCondition.java:107)
at org.sociotech.communitymashup.data.impl.DataSetImpl.getAttachments(DataSetImpl.java:3032)

Please let me know if there is anything additional that you may need. Looking forward to your help, thank you.
  • Attachment: Capture.PNG
    (Size: 33.60KB, Downloaded 75 times)

[Updated on: Thu, 05 March 2015 14:58]

Report message to a moderator

Re: EMF with Maven [message #1651892 is a reply to message #1651860] Thu, 05 March 2015 15:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30461
Registered: July 2009
Senior Member
Syed,

Sorry, I'm not sure how class loading works in such a context. EMF's
core runtime itself is generally designed to work stand alone without
needing the Eclipse core runtime, but I'm pretty sure that's not the
case for the rest of your dependencies and I'm doubtful that the Eclipse
platform's jars are designed to work stand alone...

On 05/03/2015 3:57 PM, Syed Rizvi wrote:
> Hi,
> I'm working with EMF on a non-plugin, Google AppEngine Maven based project. I have the following dependencies as stated in my pom.xml:
>
> <version.emfcommon>2.8.0.v20120911-0500</version.emfcommon>
> <version.emfecore>2.8.1.v20120911-0500</version.emfecore>
> <version.emfecorexmi>2.8.0.v20120911-0500</version.emfecorexmi>
> <version.emfquery>1.2.100.v200903190031_fixed</version.emfquery>
> <version.emfqueryocl>2.0.0.v20091215-1624</version.emfqueryocl>
> <version.ocl>3.2.1.v20120917-1739</version.ocl>
> <version.oclcommon>1.0.0.v20120516-1543</version.oclcommon>
> <version.oclecore>3.2.0.v20120522-1637</version.oclecore>
> <version.osgi>3.8.1.v20120830-144521</version.osgi>
> <version.core.runtime>3.7.0</version.core.runtime>
>
> The project works find on the local machine but not when deployed to GAE. There I get the org.eclipse.core.runtime.Platform (java.lang.NoClassDefFoundError). How could this be? Are there any dependencies that I am somehow forgetting?
>
> I can see all dependencies being present in the war/WEB-INF/lib folder too. There isn't a chance that a NoClassDefFoundError could arise.
>
> Please let me know if there is anything additional that you may need. Looking forward to your help, thank you.
Re: EMF with Maven [message #1651905 is a reply to message #1651860] Thu, 05 March 2015 15:34 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1199
Registered: July 2009
Location: Canada
Senior Member

Hi, Syed,

NoClassDefFoundError happens when a class was found (not
ClassNotFoundException) but failed to initialize after loading. So, it
seems that the Platform class is present on the classpath but some
exception happened during its initialization that caused it to become
nonviable.

So, if you can debug in the GAE environment, then you could step
through the Platform class initialization to find what the problem is.

HTH,

Christian


On 2015-03-05 14:57:05 +0000, Syed Rizvi said:

> Hi,
> I'm working with EMF on a non-plugin, Google AppEngine Maven based
> project. I have the following dependencies as stated in my pom.xml:
>
> <version.emfcommon>2.8.0.v20120911-0500</version.emfcommon>
> <version.emfecore>2.8.1.v20120911-0500</version.emfecore>
> <version.emfecorexmi>2.8.0.v20120911-0500</version.emfecorexmi>
> <version.emfquery>1.2.100.v200903190031_fixed</version.emfquery>
> <version.emfqueryocl>2.0.0.v20091215-1624</version.emfqueryocl>
> <version.ocl>3.2.1.v20120917-1739</version.ocl>
> <version.oclcommon>1.0.0.v20120516-1543</version.oclcommon>
> <version.oclecore>3.2.0.v20120522-1637</version.oclecore>
> <version.osgi>3.8.1.v20120830-144521</version.osgi>
> <version.core.runtime>3.7.0</version.core.runtime>
>
> The project works find on the local machine but not when deployed to
> GAE. There I get the org.eclipse.core.runtime.Platform
> (java.lang.NoClassDefFoundError). How could this be? Are there any
> dependencies that I am somehow forgetting?
>
> I can see all dependencies being present in the war/WEB-INF/lib folder
> too. There isn't a chance that a NoClassDefFoundError could arise.
>
> Please let me know if there is anything additional that you may need.
> Looking forward to your help, thank you.
> <image>
Re: EMF with Maven [message #1651993 is a reply to message #1651905] Thu, 05 March 2015 16:37 Go to previous messageGo to next message
Syed Rizvi is currently offline Syed RizviFriend
Messages: 7
Registered: February 2015
Junior Member
Hi Christian,
I do not have the source for the Platform class initialization and hence that is something beyond my reach. Or am I not following you correctly?

Thanks,
Ammar
Re: EMF with Maven [message #1652119 is a reply to message #1651993] Thu, 05 March 2015 18:08 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1199
Registered: July 2009
Location: Canada
Senior Member

Hi, Ammar,

Yeah, sorry, that was what I meant. I don't know anything about the
GAE environment, so I don't know how difficult it might be to debug.

Cheers,

Christian


On 2015-03-05 16:37:39 +0000, Syed Rizvi said:

> Hi Christian,
> I do not have the source for the Platform class initialization and
> hence that is something beyond my reach. Or am I not following you
> correctly?
>
> Thanks,
> Ammar
Re: EMF with Maven [message #1653078 is a reply to message #1652119] Fri, 06 March 2015 04:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30461
Registered: July 2009
Senior Member
I expect the platform code is not designed to be run unless started as
an Equinox application so I'm not sure how what Ammar had worked
locally. I.e., how exactly was it run locally isn't clear.



On 05/03/2015 7:08 PM, Christian W. Damus wrote:
> Hi, Ammar,
>
> Yeah, sorry, that was what I meant. I don't know anything about the
> GAE environment, so I don't know how difficult it might be to debug.
>
> Cheers,
>
> Christian
>
>
> On 2015-03-05 16:37:39 +0000, Syed Rizvi said:
>
>> Hi Christian,
>> I do not have the source for the Platform class initialization and
>> hence that is something beyond my reach. Or am I not following you
>> correctly?
>>
>> Thanks,
>> Ammar
>
>
Re: EMF with Maven [message #1661056 is a reply to message #1653078] Mon, 09 March 2015 13:09 Go to previous message
Syed Rizvi is currently offline Syed RizviFriend
Messages: 7
Registered: February 2015
Junior Member
Hi Ed,

I spent quite some time trying to figure out where the problem might lie, but in vain Crying or Very Sad All required dependencies are present in the project under the Maven Dependencies section. The project runs as it is on the local machine, and is not started as an Equinox application (besides, GAE still doesn't allow OSGi apps).

The question that why it doesn't run when deployed still remains. I get to see two difference errors in the logs:


  1. Could not initialize class org.eclipse.core.runtime.Platform
  2. Could not initialize class org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl


Attached are their stack traces. If you need any more details, please let me know. Any help would be greatly appreciated!

[Updated on: Mon, 09 March 2015 13:12]

Report message to a moderator

Previous Topic:Doubts about autocompletion
Next Topic:Attaching properties from one Model Element to another
Goto Forum:
  


Current Time: Sun Sep 22 06:19:33 GMT 2019

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

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

Back to the top