天天看點

java.lang.NoSuchMethodException: .getPortClassMap()

項目要用到webservice,我研究了下xfire,在運作xfire的用戶端代碼時報錯:

java.lang.NoSuchMethodException: .getPortClassMap()

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()

xfire 伺服器代碼和用戶端代碼見附件

注意:項目使用maven建構