0 Replies Latest reply: Mar 18, 2010 2:34 AM by kei sasaki RSS

JBossXACML--NoClassDefFoundError: org/jboss/security/xacml/sunxacml/finder/PolicyFinder

kei sasaki Newbie

Hi.I am using JBoss XACML.
I wonder how I would import the sunxacml packages to JBossXACML?

 

I have tried writing a code to use JBoss XACML package like codeA.

 

 

codeA
package test;

import java.net.URI;
import javax.xml.bind.JAXBElement;

import org.jboss.security.xacml.core.JBossPDP;
import org.jboss.security.xacml.core.model.policy.ActionMatchType;
import org.jboss.security.xacml.core.model.policy.ActionType;
import org.jboss.security.xacml.core.model.policy.ActionsType;
import org.jboss.security.xacml.core.model.policy.ApplyType;
import org.jboss.security.xacml.core.model.policy.AttributeValueType;
import org.jboss.security.xacml.core.model.policy.ConditionType;
import org.jboss.security.xacml.core.model.policy.EffectType;
import org.jboss.security.xacml.core.model.policy.ExpressionType;
import org.jboss.security.xacml.core.model.policy.FunctionType;
import org.jboss.security.xacml.core.model.policy.ObjectFactory;
import org.jboss.security.xacml.core.model.policy.PolicyType;
import org.jboss.security.xacml.core.model.policy.ResourceMatchType;
import org.jboss.security.xacml.core.model.policy.ResourceType;
import org.jboss.security.xacml.core.model.policy.ResourcesType;
import org.jboss.security.xacml.core.model.policy.RuleType;
import org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType;
import org.jboss.security.xacml.core.model.policy.TargetType;
import org.jboss.security.xacml.factories.PolicyAttributeFactory;
import org.jboss.security.xacml.interfaces.PolicyDecisionPoint;
import org.jboss.security.xacml.interfaces.XACMLConstants;
import org.jboss.security.xacml.interfaces.XMLSchemaConstants;

public class PDPwithO {
static boolean debug = true;

    public static void main(String[] args) throws Exception {
          PolicyType policyType = constructPolicy();
          PolicyDecisionPoint pdp = new JBossPDP(); // ●X

          XACMLPolicy policy = PolicyFactory.createPolicy(policyType); // ●Y
          Set<XACMLPolicy> policies = new HashSet<XACMLPolicy>();
          policies.add(policy);

          pdp.setPolicies(policies);
    }


    private static PolicyType constructPolicy() throws Exception{
        ・
        ・
        ・
    }
}


<Execution environment>
    Eclipse3.5.2
    jDK6

 

"constructPolicy()" is same as the one in UserGuide.
I got a error at the line "●X" like this:

 

error1
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/security/xacml/sunxacml/finder/PolicyFinder
    at test.PDPwithO.main(CopyOfPDPwithO.java:35)
Caused by: java.lang.ClassNotFoundException: org.jboss.security.xacml.sunxacml.finder.PolicyFinder
    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)
    ... 1 more


I think that sunxacml's package structure and the one expected by jbossXACML are different.

 

    JbossXACML expects ----------- org/jboss/security/xacml/sunxacml/finder/PolicyFinder
    Sunxacml's structure is --------- com/sum/xacml/finder/PolicyFinder

 

What should I do to execute codeA?

 

 

 

*

I tried to deconpile all sunxacml's class files and to rewrite each package declaration in the files .
But, I got another error at the line "●Y" like this:

 

error2
org.jboss.security.xacml.sunxacml.UnknownIdentifierException: functions of type urn:oasis:names:tc:xacml:1.0:function:anyURI-set-equals are not supported by this factory

 

"deconpile and rewrite" is normal way to use JBossXACML?

     If yes, what should I do to clear the error2?

     If no, how do you use JBossXACML?

Please advice.