I'm using Sun's XACML implementation which loads XACML from either URLs or
files. That was causing headaches making code that works from either test
cases or servlets, so I developed the URLStreamHandler lashup (attached)
until a better idea comes along. That adds a classpath: URL prefix (to the
JVM) which works fine under junit and httpServlet but fails under WSO2.

Also, what should I do to make my log messages appear in the console? I've
added this to log4j.properties:

log4j.category.com.technica.pbac=DEBUG


Can anyone shed any light on why classpath URLs don't work under WSO2 ESB?
Security? Classloader problems? OSGI?

 public
void init(SynapseEnvironment synapseEnvironment)
{
log
= Logger.getLogger(PbacMediator.class.getName());
log
.setLevel(Level.INFO); //desperation
log
.info("PbacMediator.init:"+synapseEnvironment);
/**
* Enable support for classpath: urls.
*/
ClassLoader cl = getClass().getClassLoader();
ClasspathURL.init(cl);
/**
* FixMe: should load this string from config. Research how later.
*/
String domainsPath
= 
"file://localhost/Users/Brad/Dropbox/work-technica-new/Technica-PBAC-PDP/DecisionServer/DS-PBAC-Mediator/src/main/resources/Domains.xml";
// hacking
String doesntWorkPath =  "classpath:Domains.xml";
try
{
URL domainsURL = new URL(domainsPath);
InputStream domainsStream = domainsURL.openStream();
this.pdp = new PbacPDP(domainsStream);

}

Attachment: ClasspathURL.java
Description: Binary data

_______________________________________________
Carbon-dev mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to