jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes Security Exception: signature file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Security Exception: signature file" Watch "Security Exception: signature file" New topic
Author

Security Exception: signature file

Mike Dean
Greenhorn

Joined: Sep 28, 2005
Posts: 14
I am using Drools to build an Eclipse-based RCP application. I have placed the Drools components and their dependencies into a plugin which is deployed as a jar file, and the RCP application successfully runs (with only one or two rules). Now I am trying to simply setup JUnit tests, and am crashing and burning with a java.lang.SecurityException. Here is the code:



This dies on the line instantiating a PackageBuilder:



I have no idea what this even means, much less how to fix it. I do not intentionally sign any jars, etc., though I also know nothing about signing jars. Just thought it might relate to this error.

Any help is deeply appreciated.

- Mike
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
I'm not sure of the cause.

As a workaround or as another data point I suggest removing the @BeforeClass and setting up a static variable to check for "didInitClass" and perform this once with that.

I've had similar problems occur during class loading time where it seems the class structures were in a problematic state.


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Mike Dean
Greenhorn

Joined: Sep 28, 2005
Posts: 14
Thanks. I removed the @BeforeClass and since this is a test suite in JUnit4, it then called the first test, which was TestHypoglycemiaDetection, which then failed on the teardown because there was no setup which comes from this @BeforeClass routine. This implies to me that this class, AllDroolsRulesTests, is being initialized without issue. It is when it hits the PackageBuilder that we run into a problem, and I am thinking this must relate to some "signed" jar that is in the Drools distributions, etc.
Mike Dean
Greenhorn

Joined: Sep 28, 2005
Posts: 14
I did take your advice to heart. Instead of getting rid of @Before I checked again and decided to comment out code and see if this would work. It does move me through to the test, so the @BeforeClass annotation is clearly not the problem:



I also tried commenting code out until the line that creates a new ruleBase (which is from a Drools RuleBaseFactory) and encountered the same invalid signature trace, except it originates with the instantiation from the RuleBaseFactory. This makes me think there is a signature in one of the Drools jars. But I don't know what to do about this, since the jars are dependencies of my project.
Mike Dean
Greenhorn

Joined: Sep 28, 2005
Posts: 14
This turned out to be because Eclipse was slipping a signature into the project. I am not sure why this was occurring, but I was signing the manifest with a garbage certificate, etc. This may bite someone else - just check when wrapping existing jars in a new plugin to make sure dummy.sf and dummy.csa have not been placed inside the manifest.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security Exception: signature file
 
Similar Threads
JUnit, Eclipse, and Drools
Drools 4
What is JBoss Drools?
How to retrieve the collection of conditions using Drools ?
setting up Eclipse with JBoss tools