Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 506895 - Transitive EMF dependencies missing for DSE Maven artifacts
Summary: Transitive EMF dependencies missing for DSE Maven artifacts
Status: RESOLVED FIXED
Alias: None
Product: Viatra
Classification: Modeling
Component: DSE (show other bugs)
Version: 1.5.0   Edit
Hardware: PC All
: P3 normal
Target Milestone: 1.5.0M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 503318
  Show dependency tree
 
Reported: 2016-11-02 09:14 EDT by Gabor Szarnyas CLA
Modified: 2016-11-03 13:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Szarnyas CLA 2016-11-02 09:14:36 EDT
VIATRA-DSE is missing some transitive dependencies. For a reproducible example, see this branch of this year's TTC submission: https://github.com/FTSRG/ttc16-cra-viatra-dse/tree/viatra-maven

The application compiles but upon running, it throws a NoClassDefFoundError. Build output: https://travis-ci.org/FTSRG/ttc16-cra-viatra-dse/builds/172352471#L4522:

  Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/edit/domain/EditingDomain

Adding these EMF dependencies (from the Acceleo repository) manually makes it work:

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

The application now runs without errors: https://travis-ci.org/FTSRG/ttc16-cra-viatra-dse/builds/172351611#L2214
Comment 1 Gabor Szarnyas CLA 2016-11-02 09:31:34 EDT
Further inspection revealed that

  <dependency>
    <groupId>org.eclipse.emf</groupId>
    <artifactId>org.eclipse.emf.ecore.xmi</artifactId>
    <version>2.10.1</version>
  </dependency>
  <dependency>
    <groupId>org.eclipse.emf</groupId>
    <artifactId>org.eclipse.emf.edit</artifactId>
    <version>2.10.1</version>
  </dependency>
  <dependency>
    <groupId>org.eclipse.birt.runtime</groupId>
    <artifactId>org.eclipse.emf.ecore.change</artifactId>
    <version>2.10.0.v20150123-0348</version>
  </dependency>
Comment 2 Gabor Szarnyas CLA 2016-11-02 09:33:27 EDT
is also a sufficient set of dependencies.
Comment 3 Eclipse Genie CLA 2016-11-02 10:03:50 EDT
New Gerrit change created: https://git.eclipse.org/r/84343
Comment 4 Zoltan Ujhelyi CLA 2016-11-02 10:05:19 EDT
Thanks for the report; but the conclusion is not the way to go: instead of adding direct dependencies, transitive Maven dependencies should not be removed, only transitive p2 dependencies, as the related change tries to do.
Comment 6 Zoltan Ujhelyi CLA 2016-11-02 17:17:28 EDT
The change is merged; the original issue should be fixed for now (after the builds run correctly; should be ready in about an hour). Could you please test it whether it really solves the issue?
Comment 7 Gabor Szarnyas CLA 2016-11-02 22:36:14 EDT
Unfortunately, this did not solve the issue.

The result of the latest build - https://travis-ci.org/FTSRG/ttc16-cra-viatra-dse/builds/172820697 - throws the same exception upon running:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/edit/domain/EditingDomain
	at hu.bme.mit.viatra.ttc.dse.CraHelper.loadInitialModel(CraHelper.java:26)
	at hu.bme.mit.viatra.ttc.dse.DseSolverMain.main(DseSolverMain.java:48)
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.edit.domain.EditingDomain
	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
Comment 8 Zoltan Ujhelyi CLA 2016-11-03 04:41:14 EDT
Nasz, does DSE globally require EMF Edit, or this is only the case for this specific application?
Comment 9 Andras Szabolcs Nagy CLA 2016-11-03 06:00:11 EDT
It is required for the backtracking mechanism (undoing a transformation), so it is an essential dependency.
Comment 10 Zoltan Ujhelyi CLA 2016-11-03 06:52:05 EDT
(In reply to Andras Szabolcs Nagy from comment #9)
> It is required for the backtracking mechanism (undoing a transformation), so
> it is an essential dependency.

Ok, I see. Then it is important to add EMF edit to the dependencies list of the maven module. Still, we should add as little as possible.
Comment 11 Eclipse Genie CLA 2016-11-03 09:21:57 EDT
New Gerrit change created: https://git.eclipse.org/r/84410
Comment 13 Andras Szabolcs Nagy CLA 2016-11-03 12:45:56 EDT
Indeed, all three dependency that Gábor mentioned was required, I added them manually to the parent.dse/pom.xml.

The bad side that I had to specify the exact version numbers, which have to be maintained over time.

The tests are running as expected: https://travis-ci.org/FTSRG/ttc16-cra-viatra-dse/builds/172820697
Comment 14 Gabor Szarnyas CLA 2016-11-03 13:34:35 EDT
Thanks, it works! It also works after I bumped the dependencies to 1.5.0.M1 versions: https://travis-ci.org/FTSRG/ttc16-cra-viatra-dse/builds/173018084
Comment 15 Gabor Szarnyas CLA 2016-11-03 13:34:35 EDT
Thanks, it works! It also works after I bumped the dependencies to 1.5.0.M1 versions: https://travis-ci.org/FTSRG/ttc16-cra-viatra-dse/builds/173018084