2014-01-24 1 views
0

rampart가있는 축 2에서 사용자 이름 토큰으로 보안을 생성하려고합니다.사용자 이름 토큰이있는 축 2를 고정하십시오.

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) 

답변

관련 문제