这是我在尝试使用网络服务时看到的例外情况。
java.lang.RuntimeException: Undefined 'Security policy namespace cannot be null.' resource property
at org.apache.rampart.RampartException.getMessage(RampartException.java:81)
at org.apache.rampart.RampartException.(RampartException.java:41)
at org.apache.rampart.RampartException.(RampartException.java:57)
at org.apache.rampart.RampartMessageData.setWSSecurityVersions(RampartMessageData.java:373)
at org.apache.rampart.RampartMessageData.(RampartMessageData.java:261)
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:427)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.eloqua.secure.api.service.EloquaStub.retrieve(EloquaStub.java:2220)
这就是我参与垒的方式。
ConfigurationContext serviceContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem("/usr/axis2-1.6.0/repository", "/usr/axis2-1.6.0/conf/axis2.xml");
EloquaStub serviceStub = new EloquaStub(serviceContext, "<Link to the WSDL>");
ServiceClient client = serviceStub._getServiceClient();
client.engageModule("rampart");
Options options = client.getOptions();
options.setUserName("<USERNAME>");
options.setPassword("**<PASSWORD>**");
RetrieveResponse retrieveResp = serviceStub.retrieve(retrieveData); //this where I am trying to consume to webservice.
我验证了axis2.xml和存储库的路径。 已安装以下内容。
rahas-1.6.0.mar
rampart-1.6.0.mar
代码可以找到上述两个文件以及其他模块。权限设置正确。我知道这是因为我没有看到“FileNotFound”异常。
我在环境中设置了AXIS2_HOME路径。
我的问题如下。
答案 0 :(得分:0)
此错误是由于未正确设置类路径。我有两个类似轴罐的文件夹。出于某种原因,当发生这种情况时,tomcat处于一种奇怪的状态。我从类路径中删除了第二个文件夹,它自行解决。