Java Security Exception for Java AST
NickName:Sravan Kumar Ask DateTime:2012-05-11T13:17:09

Java Security Exception for Java AST

I am using eclipse 32bit in my office and developing a java code to parse JavaAST, but when I try to run the program at home I am getting a getting this exception. I am also providing where the Exception is occurred.

How can I Resolve this exception?

Exception Line

ASTParser parser = ASTParser.newParser(AST.JLS3);

Security Exception

Exception in thread "main" java.lang.SecurityException: class "org.eclipse.core.runtime.Plugin"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:943)
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:657)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:785)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at org.eclipse.jdt.core.dom.ASTParser.initializeDefaults(ASTParser.java:235)
    at org.eclipse.jdt.core.dom.ASTParser.<init>(ASTParser.java:218)
    at org.eclipse.jdt.core.dom.ASTParser.newParser(ASTParser.java:118)
    at tester.runTest.main(runTest.java:33)

Copyright Notice:Content Author:「Sravan Kumar」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/10545809/java-security-exception-for-java-ast

Answers
mgibsonbr 2012-05-11T05:27:46

Please refer to this page on Java documentation: Sealing Packages within a JAR File. That is the probable cause of the error you're seeing.\n\nIn short, when a jar file is sealed the JVM assumes every class from that jar's packages must be defined inside that jar. If there is some code in other parts of your project that belongs to the same package, it will treat is as a security exception.\n\nCheck if the code you're running at home is structured similarly to what you're running in the office. You might have some classes defined in regular .java files, accessible from your CLASSPATH, that belongs to the same package(s) defined in that jar file. Try removing any unnecessary dependencies from your project (so it looks as closely as possible to your working envirnment) and see if that solves your problem.\n\nEdit: I might have mistaken signed for sealed; the relevant docs, then, is Signing and Verifying JAR Files. The probable cause and possible solution remains the same, though...",


More about “Java Security Exception for Java AST” related questions

Java Security Exception for Java AST

I am using eclipse 32bit in my office and developing a java code to parse JavaAST, but when I try to run the program at home I am getting a getting this exception. I am also providing where the Exc...

Show Detail

Error constructing Java AST Exception while launching Devmode

Getting the below exception While Launching DevMode,I read some of the link which has same issue GWT 2.5.0 compiler exception but not able to solve and using GWT 2.6.1 com.google.gwt.dev.jjs.

Show Detail

Java security manager Exception

I am working on a project using the Java Authorization and Authentication Service (JAAS). I am encountering a strange security exception though: Caused by: java.security.AccessControlException: ac...

Show Detail

NoClassDefFoundError in eclipse when using AST

When trying to use an AST in a java project in eclipse, I get this error message is runtime: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IAdaptable I've tried

Show Detail

GWT - Error constructing Java AST

What could possibly be causing this error during compilation? I have generated project from this archetype https://github.com/ArcBees/Arcbees-Archetypes and I have changed only thing - update GWT...

Show Detail

convert an antlr AST to java

I use the grammar Java.g from the ANTLR wiki produces a lexer and parser for Java source files.Then use the following code to generate an AST. InputStream inputStream = new FileInputStream(fileNam...

Show Detail

Java AST to .java file Rascal

I am wondering if there are mechanics in place to translate from a Java AST back to a Java source file inside the lang::java::m3 library. thanks!

Show Detail

Generate AST for Java with ANTLR

As far as I know, there are two mechanisms in ANTLR for building abstract syntax trees. I want to build a AST for Java source files. Question: There are so many grammar rules in Java.g (java

Show Detail

Java security access control exception

I am trying to execute this program, http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/WebCrawler.java The program compiles without any error after i referred this page, http://...

Show Detail

Exception: java.lang.StackOverflowError org.hibernate.hql.internal.ast.util.JoinProcessor.doFindAllNodes(JoinProcessor.java:116) error before running

This is repository: @Repository public interface BooksForHealthPolicyRepository extends JpaRepository&lt;BooksForHealthPolicy, BooksForHealthPolicyId&gt;{ public List&lt;BooksForHealthPolicy&gt;

Show Detail