Getting error Policy is not a <wsp:Policy> element

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting error Policy is not a <wsp:Policy> element

Ravinderjit
Hello,

Working with Axis2 1.6.2.
I am trying to invoke Axis2  service using java client. Using ServiceClient for invoke. Modules engaged 'Addressing' and 'Rampoart'.

Attached here my policy file.

I am getting this error.

 INFO [main] (ModuleDeployer.java:82) - Deploying module: addressing-1.6.2 - file:/C:/Workspaces/Eclipse_Workspace/Axis2HelloService/src/resources/modules/addressing-1.6.2.mar
 INFO [main] (ModuleDeployer.java:82) - Deploying module: rahas-1.6.2 - file:/C:/Workspaces/Eclipse_Workspace/Axis2HelloService/src/resources/modules/rahas-1.6.2.mar
 INFO [main] (ModuleDeployer.java:82) - Deploying module: rampart-1.6.2 - file:/C:/Workspaces/Eclipse_Workspace/Axis2HelloService/src/resources/modules/rampart-1.6.2.mar
Exception in thread "main" java.lang.IllegalArgumentException: {http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}Policy is not a <wsp:Policy> element.
        at org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:176)
        at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
        at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:100)
        at org.apache.ws.secpolicy11.builders.WSS10Builder.build(WSS10Builder.java:40)
        at org.apache.ws.secpolicy11.builders.WSS10Builder.build(WSS10Builder.java:33)
        at org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:138)
        at org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
        at org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
        at org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
        at org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
        at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
        at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:100)
        at com.example.axis2.RampartSampleClient.loadPolicy(RampartSampleClient.java:93)
        at com.example.axis2.RampartSampleClient.main(RampartSampleClient.java:53)


Loading the policy like this
StAXOMBuilder builder = new StAXOMBuilder(filePath);
                return PolicyEngine.getPolicy(builder.getDocumentElement());

Same client used to work with Axis2 1.5.6

Thanks for your help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting error Policy is not a <wsp:Policy> element

Ravinderjit
Attaching policy file.mypolicy.xml
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting error Policy is not a <wsp:Policy> element

Ravinderjit
Any comments on this from Axis2/Rampart experts ?
Loading...