The constructor Service(URL, QName, WebServiceFeature[]) is undefined

后端 未结 7 2377
无人及你
无人及你 2021-02-12 20:46

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.

相关标签:
7条回答
  • 2021-02-12 21:19

    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

    0 讨论(0)
  • 2021-02-12 21:20

    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.

    0 讨论(0)
  • 2021-02-12 21:28

    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

    0 讨论(0)
  • 2021-02-12 21:32

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

    0 讨论(0)
  • 2021-02-12 21:33

    Change your JAX-WS in the preferences. It is compatibility issue for Java 6 SE and Java EE

    enter image description here

    Sometimes changing from Java 1.6 to Java 1.7 also solves this issue.

    0 讨论(0)
  • 2021-02-12 21:38

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

    0 讨论(0)
提交回复
热议问题