0

ランパートを使用して、axis2 でユーザー名トークンを使用してセキュリティを生成しようとしています。

String securityPolicyPath = "/WEB-INF/policy.xml";

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("/axis2-1.6.2/repository/", "/WEB-INF/conf/axis2.xml");

CalAddStub stub = new CalAddStub(ctx,"http://localhost:8090/RampartTest/services/CalAdd/");
ServiceClient sc = stub._getServiceClient();
sc.engageModule("rampart");

Options options = sc.getOptions();
options.setUserName("apache");
options.setPassword("password");
        options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,loadPolicy(securityPolicyPath));
Add_cal add = new Add_cal();
add.setX(6);
add.setY(9);
System.out.println("id = " + stub.add_cal(add).get_return());

しかし、私はこの例外を受けています。

[INFO] Deploying Web service: version.aar - file:/C:/axis2-1.6.2/repository/services/version.aar
Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/JaxenException
    at org.apache.rampart.handler.WSDoAllSender.processBasic(WSDoAllSender.java:108)
    at org.apache.rampart.handler.WSDoAllSender.processMessage(WSDoAllSender.java:72)
    at org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
    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)
4

1 に答える 1

1

クラスパスにApache Jaxen の依存関係が必要です。

Rampart Project Dependencies公式ページのRampart Dependency Treeセクションを参照してください。

于 2014-01-24T10:39:04.263 に答える