The constructor Service(URL, QName, WebServiceFeat

2019-03-24 08:04发布

I got The constructor Service(URL, QName, WebServiceFeature[]) is undefined error after I run wsimport for my client web service. Im using JDK 1.6. Please help.

Error

7条回答
太酷不给撩
2楼-- · 2019-03-24 08:39

Additionally to switch from java 6 to java 7 you may need to change the 'Order and Export' Eclipse tab in 'Java build path' and put 'JRE system library' on top of the list. If that works it could mean you have an old jar somewhere in your project.

查看更多
Juvenile、少年°
3楼-- · 2019-03-24 08:43

add additional option "-target 2.0" while using wsimport to generate source codes for JAX-WS 2.0 and so on.

查看更多
可以哭但决不认输i
4楼-- · 2019-03-24 08:50

You had produced code that needs JAX-WS 2.1. Version 2.0 does not have WebServiceFeature class, and as result also not constructor in Service with such a argument type.

As you see, in Java SE 6 there is no such a constructor: javax.xml.ws.Service SE 6, but for example in Java EE 6 there is: javax.xml.ws.Service EE 6

查看更多
我只想做你的唯一
5楼-- · 2019-03-24 08:52

You can manually add webservices-api.jar from JAX-WS 2.2 API, into /lib/endorsed. See the bottom of this page: https://blogs.oracle.com/ritzmann/entry/metro_2_0_on_java

查看更多
放荡不羁爱自由
6楼-- · 2019-03-24 08:57

Check the Java version in Eclipse. Go the command prompt and check for the Java version there (command: java -version). Match both the versions and it should work just fine.

查看更多
成全新的幸福
7楼-- · 2019-03-24 09:00

remove jdk1.6 from classpath,then add jdk1.7 can resolve this issue

查看更多
登录 后发表回答