Cannot find symbol : constructor Service (,,,) error when using Java IDE Netbeans

Question: After downloading Netbeans 7 Beta I am getting “cannot find symbol : constructor Service (java .net .URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])” error from the compiler. I have never seen this before. The code was built without errors in NetBeans 6.9.1. I am running NetBeans on Mac OSX 10.6.5 and building a desktop swing application. Answer: This error is likely a mismatch between JAX-WS 2.2 and 2.1, or you have removed NetBeans 6.9.1 from your machine and the compiler cannot find a reference to JAX-WS-ENDORSED. The Service(URL, QName, WebServiceFeature…) constructor was added in JAX-WS 2.2. You are running your stand-alone application outside the Tomcat or GlassFish containers. NetBeans is probably picking up the javax.ws.Service class from the built-in JDK (JRE) classes. Worth trying: 1. Install the file webservices-api.jar into the JRE endorsed directory, ie. copy webservices-api.jar into /lib/endorsed folder. If you can’t find the java home folder, look for it at \Library\Java\Home. The directory might be empty or not exists at all. In this case you will have to create it. 2. You might have missed something while removed NetBeans 6.9.1. Open NetBeans and select your project. Check out File->Project properties -> Libraries. Remove missing references (JAX-WS-ENDORSED?) if any. Include JAXWS 2.2 if there is no reference to it. Netbeans sooner or later picks up the correct library. Download JAXWS 2.2 from Java GlassFish-Metro site. Java document: http://java.sun.com/javase/6/docs/technotes/guides/standards/ Notes: If you get …\JAXWS\JAXWS_Server\nbproject\build-impl.xml:302: taskdef A class needed by class com.sun.tools.ws.ant.WsImport cannot be found error message, you have copied more .jar files into the endorsed folder than needed. Remove them.