Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » java.lang.SecurityException on maven build with Xtext and XCore from Mars
java.lang.SecurityException on maven build with Xtext and XCore from Mars [message #1703124] Tue, 28 July 2015 17:13 Go to next message
Richard Melvin is currently offline Richard MelvinFriend
Messages: 9
Registered: July 2009
Junior Member
Following the usual maven tutorial, and examples shown before in this forum, I'm attempting to upgrade a maven project that uses xtext and xcore to versions as present in a fresh Eclipse Mars install.

When running the xtext-maven-plugin on the .xcore file, it gets to:

[INFO] Validate and generate.
[INFO] Starting validation for input: 'XCoG.xcore'
[INFO] Starting generator for input: 'XCoG.xcore'


and then reports (several hundred times)

java.lang.SecurityException: class "org.eclipse.core.runtime.Plugin"'s signer information does not match signer information of other classes in the same package


and nothing is generated.

The relevant bit of the exception trace seems to be:
org.eclipse.emf.codegen.ecore.genmodel.util.GenModelUtil.getJavaOptions(GenModelUtil.java:128)

which is a line that references class JavaCore, which is an import from org.eclipse.jdt.core.

The full debug log of the build seems to show there are two different version of org.eclipse.jdt.core in play,




org.eclipse.jdt.core:jar:3.11.0.v20150602-1242 which is as released with Mars.

org.eclipse.tycho:org.eclipse.jdt.core:jar:3.10.0.v20140604-1726 which is a dependency of org.eclipse.xtext:org.eclipse.xtext.xtext:jar:2.8.3,

which comes because the pom.xml in org.eclipse.xtext.dependencies specifies:

<dependency>
	<groupId>org.eclipse.tycho</groupId>
	<artifactId>org.eclipse.jdt.core</artifactId>
	<version>3.10.0.v20140604-1726</version>
</dependency>


is that an error? And is there any workaround?








Re: java.lang.SecurityException on maven build with Xtext and XCore from Mars [message #1703132 is a reply to message #1703124] Tue, 28 July 2015 18:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
hmmm, i cannot reproduce that using https://github.com/eclipse/xtext/tree/maintenance/maven/org.eclipse.xtext.maven.plugin/src/test/resources/it/generate/xcore-lang as starting point.
can you share a complete reproducable project


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: java.lang.SecurityException on maven build with Xtext and XCore from Mars [message #1703232 is a reply to message #1703132] Wed, 29 July 2015 14:58 Go to previous messageGo to next message
Richard Melvin is currently offline Richard MelvinFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks for taking a look. Downloading and building the example you linked works fine, once changing versions to latest publicly released ones:

		<xtext-version>2.8.3</xtext-version>
		<ecore-xtext-version>1.1.1</ecore-xtext-version>
		<ecore-xcore-lib-version>1.1.0</ecore-xcore-lib-version>
		<ecore-xcore-version>1.2.2</ecore-xcore-version>


But the same set of dependencies in my project fails. The only obvious difference is I am using tycho, instead of pure maven, to build it (i.e. <packaging>eclipse-plugin</packaging>).

Excluding and adding dependencies to only use org.eclipse.jdt.core:jar:3.11.0.v20150602-1242 doesn't change anything.

I'll try and come up with a small reproducible case.
Re: java.lang.SecurityException on maven build with Xtext and XCore from Mars [message #1703260 is a reply to message #1703232] Wed, 29 July 2015 21:01 Go to previous message
Richard Melvin is currently offline Richard MelvinFriend
Messages: 9
Registered: July 2009
Junior Member
Just to dump the results here in case it helps someone else (or me next year):

The signature conflict is between the jars org.eclipse.core.runtime 3.7.0 and org.eclipse.equinox.common 3.6.200, because both have the package org.eclipse.core.runtime, but only the former has class Plugin.

org.eclipse.emf.codegen.ecore.genmodel.util.GenModelUtil references org.eclipse.jdt.core.JavaCore which references many classes from org.eclipse.core.runtime including Plugin. So it ends up with half of each package, hence the error.

To get things to work, I needed to fiddle things until the bundle org.eclipse.core.runtime was searched before org.eclipse.equinox.common. This wasn't as simple as copying the example, as I was using tycho and there were other dependencies involved, but once I understood what was going on, it was just trial and error.

Can't help but thing there is something fundamentally flawed about the design of one or more of OSGI, eclipse or tycho here given everything is so fragile. Beneath jar hell there is a deeper pit where things only work if jars are in the right order, and you can't directly specify the order...
Previous Topic:Using xbase
Next Topic:Force specific encoding with IFilesystemAccess
Goto Forum:
  


Current Time: Tue Mar 19 09:02:59 GMT 2024

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

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

Back to the top