项目要用到webservice,我研究了下xfire,在运行xfire的客户端代码时报错:
- Exception in thread "main" java.lang.IllegalStateException: Could not initialize Service.
- at org.codehaus.xfire.jaxws.ServiceDelegate.<init>(ServiceDelegate.java:77)
- at org.codehaus.xfire.jaxws.Provider.createServiceDelegate(Provider.java:32)
- at javax.xml.ws.Service.<init>(Service.java:56)
- at test.jax.HelloWorldSimple.<init>(HelloWorldSimple.java:54)
- at test.jax.Main.main(Main.java:26)
- Caused by: java.lang.NoSuchMethodException: test.jax.HelloWorldSimple.getPortClassMap()
- at java.lang.Class.getMethod(Class.java:1605)
- at org.codehaus.xfire.jaxws.ServiceDelegate.<init>(ServiceDelegate.java:60)
- ... 4 more
解决方法:
删除xfire-all-1.2.6.jar 中org.codehaus.xfire.jaxws.Provider.class
参考:http://bbs.csdn.net/topics/390736806
xfire 服务器代码和客户端代码见附件
注意:项目使用maven构建
时间: 2024-11-02 00:38:14