axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sardar Hussain <>
Subject [AXIS2] Reading a configuration file in Handler
Date Wed, 02 Feb 2011 00:07:01 GMT

I am trying to read a configuration file in AXIS2 module handler however it shows error. 
When I test the same module before deploying into Axis2 it works fine. My code and configuration
files are as follows:

ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      InputStream is = tcl.getResourceAsStream("C:\\apache-tomcat-6.0.29\\webapps\\axis2\\WEB-INF\\modules\\webConfig.xml");

PolicyDecisionPoint pdp = new JBossPDP(is);

the webConfig.xml is as follows

<ns:jbosspdp xmlns:ns="urn:jboss:xacml:2.0">
    <ns:Locator Name=""> 

It can't read the policy.xml file from the configuration file. I have put this policy file
on different locations within the module archive outside module archive but it can not work.

Can anyone kindly help in this regard.

The JBossPDP constructor behave with the webConfig.xml file like the following.

public JBossPDP(InputStream configFile)
              JAXBElement<?> jxb = (JAXBElement<?>) unmarshaller.unmarshal(configFile);
              bootstrap((PDP) jxb.getValue());
           catch (Exception e)
              throw new RuntimeException(e);



View raw message