从STS获取令牌时出错

时间:2013-08-16 05:27:26

标签: wso2 wso2is

我从WSO2身份服务器STS客户端调用

中的以下方法调用中收到错误 电话:

responseToken = stsClient.requestSecurityToken(servicePolicy,
                    STS_EPR, stsPolicy, RELYING_PARTY_SERVICE_EPR);

返回以下错误。

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
    at org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:311)
    at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:327)
    at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:336)
    at org.apache.ws.security.WSSConfig.getDefaultWSConfig(WSSConfig.java:345)
    at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:363)
    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:261)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:398)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
    at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:164)
    at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:181)

这显然是包含在类路径中的错误jar。我正在针对WSO2身份服务器4.1.0运行此攻击并且冒犯wss4j .jar版本是与4.1.0 IS一起提供的wss4j_1.5.11.wso2v5.jar。我应该使用哪个版本的.jar来摆脱这个问题?

附注:我在WSO2的公共Maven资源库中查找了源.jar文件,但是那里只有二进制.jar文件可用,为什么WSO2公共存储库中缺少源.jar文件,因为WSO2相信开源软件?

这里我指的是http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/ws/security/wss4j/1.5.11-wso2v5/

1 个答案:

答案 0 :(得分:1)

转到身份服务器bin文件夹[wso2is-4.1.0 / bin]并发出命令“ant”以获取所需的库,(确保已安装Apache Ant)

wso2is-4.1.0 / bin $ ant

然后在构建ant脚本之后,转到位置wso2is-4.1.0 / repository / lib并查看所需的库。

垒-policy_1.6.1-wso2v8.jar 城墙-core_1.6.1-wso2v8.jar 城墙-trust_1.6.1-wso2v8.jar wss4j_1.5.11-wso2v5.jar axis2_1.6.1-wso2v8.jar axiom_1.2.11-wso2v3.jar

确保在客户端的类路径中使用上述版本。