• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Security Exception: signature file

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mike Dean
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic