Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 862
chinna_82 Avatar asked Mar 07 '12 11:03

chinna_82


2 Answers

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

like image 140
mickey Avatar answered Sep 18 '22 16:09

mickey


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

like image 31
Mikko Maunu Avatar answered Sep 18 '22 16:09

Mikko Maunu