• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Policy is not a <wsp:Policy> element

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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());

This is my policy.



Same client used to work with Axis2 1.5.6

Thanks for your help.
 
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you provide us archive with whole project files?
 
Ravinderjit Singh
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't upload .zip/.rar files here. You can download from here
You may need to adjust the build path.
 
Ravinderjit Singh
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Surlac,

Do you have any comments on this problem ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic