Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » what is the solution to java.lang.SecurityException?
what is the solution to java.lang.SecurityException? [message #911036] Mon, 10 September 2012 17:20 Go to next message
b x is currently offline b x
Messages: 16
Registered: February 2012
Junior Member
I runned ant in eclipse, and there is an exception:
Exception in thread "main" java.lang.SecurityException: class "org.eclipse.jdt.core.JDTCompilerAdapter"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1387)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:249)
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.resolveClassName(CompilerAdapterFactory.java:194)
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:155)
at org.apache.tools.ant.taskdefs.Javac.findSupportedFileExtensions(Javac.java:979)
at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:956)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:927)

how to handle this exception?
Re: what is the solution to java.lang.SecurityException? [message #911526 is a reply to message #911036] Tue, 11 September 2012 16:01 Go to previous messageGo to next message
b x is currently offline b x
Messages: 16
Registered: February 2012
Junior Member
I found two solutions: re-sign the jar files or remove the manifest information, but I don't know how to do it.
Re: what is the solution to java.lang.SecurityException? [message #912573 is a reply to message #911526] Thu, 13 September 2012 15:41 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 924
Registered: July 2009
Senior Member
The exception seems to say that you are using a jdtCompilerAdapter.jar whose signature does not match of the jar containing the Eclipse Java Compiler.

In order to advise further we'd need to now which exact file versions of both you are using.

When installing the JDT the jdtCompilerAdapter.jar comes as a nested jar within the plugin org.eclipse.jdt.core_xxx.jar, the latter containing also the compiler. So either we'd need the version of this plugin or information where else you obtained the jars from.

Stephan
Re: what is the solution to java.lang.SecurityException? [message #912989 is a reply to message #912573] Fri, 14 September 2012 10:49 Go to previous messageGo to next message
b x is currently offline b x
Messages: 16
Registered: February 2012
Junior Member
the version is org.eclipse.jdt.core_3.8.1.v20120531-0637.jar
Re: what is the solution to java.lang.SecurityException? [message #916226 is a reply to message #911036] Tue, 18 September 2012 14:58 Go to previous messageGo to next message
b x is currently offline b x
Messages: 16
Registered: February 2012
Junior Member
here are the jar files I used in hte project:
ant.jar
ant-launcher.jar
jdtCompilerAdapter.jar
org.eclipse.ant.ui.source_3.5.300.v20120523-1752.jar
org.eclipse.core.contenttype_3.4.200.v20120523-2004.jar
org.eclipse.core.jobs_3.5.200.v20120521-2346.jar
org.eclipse.core.resources_3.8.0.v20120522-2034.jar
org.eclipse.core.runtime_3.8.0.v20120521-2346.jar
org.eclipse.equinox.common_3.6.100.v20120522-1841.jar
org.eclipse.equinox.preferences_3.5.0.v20120522-1841.jar
org.eclipse.jdt.compiler.tool_1.0.101.v20120522-1651.jar
org.eclipse.jdt.core_3.8.1.v20120531-0637.jar
org.eclipse.jdt.debug.ui_3.6.100.v20120530-1425.jar
org.eclipse.jface.text_3.8.0.v20120531-0600.jar
org.eclipse.jface_3.8.0.v20120521-2329.jar
org.eclipse.osgi_3.8.0.v20120529-1548.jar
org.eclipse.text_3.5.200.v20120523-1310.jar

jdtCompilerAdapter.jar is from org.eclipse.jdt.core_3.8.1.v20120531-0637.jar
ant.jar and ant-launcher.jar are from apache-ant-1.8.4-bin.zip
Re: what is the solution to java.lang.SecurityException? [message #916299 is a reply to message #916226] Tue, 18 September 2012 17:33 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 924
Registered: July 2009
Senior Member
All those versions look OK.

Meanwhile I learned that org.eclipse.jdt.core_3.8.1.v20120531-0637.jar is signed but the nested jdtCompilerAdapter.jar is not signed.

So, if you are running ant with checking of certificates enabled it will see some classes are signed and others are not, and since both jars share some packages this triggers the exception.

So why is this affecting you and not actually everybody using ecj via ant? Is certificate checking normally enabled when running ant?

In my ant installation none of the jars in ant/lib/ are signed. So I guess ant normally runs without this verification?

Stephan
Re: what is the solution to java.lang.SecurityException? [message #916306 is a reply to message #916299] Tue, 18 September 2012 17:45 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 924
Registered: July 2009
Senior Member
Here's a relevant comment from a bug [1]:
Quote:
We decided that Ant, for example, is never invoked with runtime signature verification enabled, so signing JARs that only appear on ant classpaths wasn't needed.


hm?


[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=263298#c1
Previous Topic:Error while Starting Tomcat 6.0
Next Topic:How to determine JDT indentation tab size
Goto Forum:
  


Current Time: Thu Apr 17 14:26:38 EDT 2014

Powered by FUDForum. Page generated in 0.03164 seconds