Search code examples
wso2noclassdeffounderrorxercessecuritymanagerbalana

Balana "evaluate" command causing NoClassDefFoundError


I got a jar for balana 1.0.5 from here:
http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/balana/org.wso2.balana/1.0.5/
I have an instance of pdp with no configuration and I'm trying to pass it a sample xacml request string just to see if I can get output, then I can work on giving the PDP a policy configuration to run with, but I get this error when calling evaluate.


Caused by: java.lang.NoClassDefFoundError: org/apache/xerces/util/SecurityManager
        at org.wso2.balana.utils.Utils.getSecuredDocumentBuilderFactory(Utils.java:107)
        at org.wso2.balana.Balana.<init>(Balana.java:215)
        at org.wso2.balana.Balana.getInstance(Balana.java:228)
        at org.wso2.balana.ctx.RequestCtxFactory.getXacmlRequest(RequestCtxFactory.java:173)
        at org.wso2.balana.ctx.RequestCtxFactory.getRequestCtx(RequestCtxFactory.java:87)
        at org.wso2.balana.PDP.evaluate(PDP.java:119)

I'd like to know if I'm using the wrong source or if I'm using the right source improperly.

  1. Is this from using the 1.0.5 balana?
  2. Is this from using the jar instead of the source files?
  3. If I should be downloading using mvn rather than browsing the wso2 maven repository?
  4. I've tried tracking down the xercesimpl.jar which contains references to SecurityManager, but when I import that to the classpath, it breaks some w3c xml stuff which otherwise works fine. Is there a version of balana which uses System's SecurityManager rather than trying to depend on xerces?

I also tried loading the K-Market sample with the same 1.0.5 jar and I get the same error, and again with the 1.0.4 jar, but it stops happening with a different error if I go to the 1.0.3 jar.


Solution

    1. Yes, the 1.0.5 balana contains a dependency that isn't present in the jar.
    2. Maybe, but not likely, since the source files, assuming they're the same, would still contain the same dependencies.
    3. No idea. I still haven't figured out maven 100% yet.
    4. I think so. The error stops happening when backtracking to balana 1.0.3 jar