Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse
NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1792973] Thu, 26 July 2018 16:37 Go to next message
David Struck is currently offline David StruckFriend
Messages: 25
Registered: July 2010
Junior Member
I am trying to use ChangeRecorder in my Java application. My Eclipse project uses Maven, so that is how I am downloading the org.eclipse.emf.ecore.change jar. My code compiles nicely but I get a NoClassDefFoundError when I run my application out of Eclipse:

java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/change/util/ChangeRecorder
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.change.util.ChangeRecorder
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

I've confirmed the org.eclipse.emf.ecore.change jar is on my launch configuration's classpath.

I've tried multiple different versions in my pom.xml, e.g.

<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.ecore.change</artifactId>
<version>2.10.0.v20150123-0348</version>
</dependency>

I've also tried versions 2.11.0.v20160420-0247, 2.11.0.v20150512-0501, as well as this:

<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.change</artifactId>
<version>2.11.0</version>
</dependency>

All give me the same error.

I downloaded EMF-Updates-2.12.zip from http://download.eclipse.org/modeling/emf/emf/builds/release/2.12/index.html -- the jar I extracted from there is the only jar I've found so far that works for me. But I'd prefer to manage my dependencies using Maven.

Does anyone know why the Maven jars are not working?
Re: NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1792974 is a reply to message #1792973] Thu, 26 July 2018 17:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29653
Registered: July 2009
Senior Member
We recently published Maven versions for EMF 2.14, so perhaps try those.
Re: NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1792976 is a reply to message #1792974] Thu, 26 July 2018 19:09 Go to previous messageGo to next message
David Struck is currently offline David StruckFriend
Messages: 25
Registered: July 2010
Junior Member
Thanks, Ed. I'm still new to Maven so it's not always obvious to me where to locate the dependency details. When I go to

https://mvnrepository.com/artifact/org.eclipse.emf/org.eclipse.emf.ecore.change

I only see one version (2.11.0). When I go to

https://mvnrepository.com/artifact/org.eclipse.birt.runtime/org.eclipse.emf.ecore.change

I see more versions but the latest is still a variant of 2.11.

Am I looking in the wrong place?
Re: NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1792985 is a reply to message #1792976] Fri, 27 July 2018 04:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29653
Registered: July 2009
Senior Member
Actually Karsten Thoms did the publishing work. I can see from the build script that they ended up in https://oss.sonatype.org/#nexus-search;quick~org.eclipse.emf.ecore but I think this is only a staging location and I'm not sure the final location. I'll have to ask him. Perhaps we can document such details in the build job: https://ci.eclipse.org/emf/job/publish-maven/
Re: NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1792992 is a reply to message #1792985] Fri, 27 July 2018 07:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

My recollection is that there is/was a versioning/lifetime incompatibility between Eclipse and Maven that was 'solved' by encouraging Eclipse projects to publish via repo.eclipse.org.

A quick browse of repo.eclipse.org shows that it has a very recent org.eclipse.xtext, but only 2.12 of EMF. Generally what you find on maven-central can be very old and misleading, often contributed without knowledge of the developers.

Again my recollection is that many relengs await a generic/automated solution to publishing to avoid regular manual activities.

Almost all Eclipse projects now build with Tycho that is an extended Maven with support for Eclipse P2 repositories. I recommend that you use the P2 repos that each project publishes for use by numerous other projects. These are heavily exercised. Unfortunately what is on Maven-Central is just a teaser to deceive newbies.

Regards

Ed Willink
Re: NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1793012 is a reply to message #1792992] Fri, 27 July 2018 13:18 Go to previous messageGo to next message
David Struck is currently offline David StruckFriend
Messages: 25
Registered: July 2010
Junior Member
Thanks, guys! I was getting the impression that mvnrepository.com felt somewhat "unauthorized". I'll check out these other possibilities.
Re: NoClassDefFoundError - org.eclipse.emf.ecore.change jar - Maven - Eclipse [message #1793824 is a reply to message #1793012] Thu, 16 August 2018 12:48 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 639
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Sorry for getting back so late, I was on vacation :)

Before my vacation I was working on the publishing on EMF artifacts. They are only in a staging repository yet, because I did not gather enough feedback if these artifacts are now as expected. When I have that feedback they could be published.

Could you please try https://oss.sonatype.org/content/repositories/orgeclipseemf-1057 ?
Previous Topic:"It" says there are JET warnings but doesn't display them!
Next Topic:Resolving package URI from workspace plugin with E4 model editor
Goto Forum:
  


Current Time: Sun Nov 18 13:57:01 GMT 2018

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

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

Back to the top