java.lang.NoSuchMethodException: .getPortClassMap()

项目要用到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 


java.lang.NoSuchMethodException: .getPortClassMap()
 

参考:http://bbs.csdn.net/topics/390736806

xfire 服务器代码和客户端代码见附件

注意:项目使用maven构建

你可能感兴趣的:(webservice,xfire,ws,getPortClassMap)