This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 188614

Summary: Running Main class in a Web Service Client doesn't compile JAX-WS generated sources
Product: webservices Reporter: Catchwa
Component: ClientAssignee: Milan Kuchtiak <mkuchtiak>
Status: NEW ---    
Severity: normal CC: Catchwa, pjiricka
Priority: P3    
Version: 7.3.1   
Hardware: PC   
OS: Windows 8 x64   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 151845, 194446    
Bug Blocks:    
Attachments: Sample WSDL and Schema to import as a Web Service Client

Description Catchwa 2010-07-13 07:20:07 UTC
Created attachment 100793 [details]
Sample WSDL and Schema to import as a Web Service Client

NetBeans 6.9

1.) Create a New Java Application Project
2.) Add a new Web Service Client to your project (the actual WSDL doesn't really matter but you can use the local file method via the WSDL that I'm about to attach.)
3.) wsimport is successful and no error messages are shown
4.) Add code to the Main class to reference something in the JAX-WS generated classes. e.g.

package wsclienttest;

import org.netbeans.test.NewWebServiceService;

public class Main {
    public static void main(String[] args) {
        NewWebServiceService nwss = new NewWebServiceService();
    }
}

5.) Trying to run the Main class by right-clicking on it (the Main.java class, *not* the project itself) and selecting Run gives the following error:

wsimport-client-generate:
Compiling 1 source file to C:\NetBeansProjects\WSClientTest\build\classes
C:\NetBeansProjects\WSClientTest\src\wsclienttest\Main.java:8: package org.netbeans.test does not exist
import org.netbeans.test.NewWebServiceService;
C:\NetBeansProjects\WSClientTest\src\wsclienttest\Main.java:12: cannot find symbol
symbol  : class NewWebServiceService
location: class wsclienttest.Main
        NewWebServiceService nwss = new NewWebServiceService();
C:\NetBeansProjects\WSClientTest\src\wsclienttest\Main.java:12: cannot find symbol
symbol  : class NewWebServiceService
location: class wsclienttest.Main
        NewWebServiceService nwss = new NewWebServiceService();
3 errors
C:\NetBeansProjects\WSClientTest\nbproject\build-impl.xml:577: The following error occurred while executing this line:
C:\NetBeansProjects\WSClientTest\nbproject\build-impl.xml:287: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)



This is because the JAX-WS Generated Source directory hasn't been compiled yet (they all have spanner icons next to them).

The solution is to right click on the *project* and select Run but this isn't very intuitive (for me, at least) based on the compiler error message. Once this is done, you can select Run on individual classes without any further errors.

As an enhancement (I wasn't sure if this was a defect or enhancement), I would suggest that triggering Run on individual classes should trigger builds of the JAX-WS Generated Sources so that the referenced compilation errors are eliminated.
Comment 1 Milan Kuchtiak 2010-07-13 08:08:33 UTC
The generated - sources are not ignored in RUN file action. It is almost the same as issue 151845. Adding a dependency on this issue.
Comment 2 Milan Kuchtiak 2010-07-13 08:10:20 UTC
Sorry, I wanted to say that generated sources are ignored, of course.
Comment 3 forrestj 2010-12-07 10:55:15 UTC
Hi, Id like to second this request, only through googling and finding this bug request I got it working with the workaround mentioned above. :)

James
Comment 4 alefon 2013-11-15 08:16:36 UTC
After three years , issue persists ! 
confirmed this problem with NB 7.3.1 on 64 Windows 8.
Comment 5 br3nto 2014-10-03 01:04:03 UTC
I am also having this issue.

The issue is occurring after I restarted NetBeans on the machine I created the web services client and also after opening the project on another computer.

I am using NetBeans IDE 8.0 and the project is using Java Platform JDK 1.6.

The failure occurs after wsimport-client-generate.

It can't find the package that contains the web services client classes, even though those classes do compile correctly in the previous step.

I get these error regardless of whether I do clean and build, clean then build, clean and run.

Cannot find symbol.
symbol: method required()
location: @interface javax.xml.bind.annotation.XmlElementRef
  @XmlElementRef(name = "attachment", type = JAXBElement.class, required = true)

There are several of the above error messages.

The work around above did not work in my case. #sadface