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 - Running Main class in a Web Service Client doesn't compile JAX-WS generated sources
Summary: Running Main class in a Web Service Client doesn't compile JAX-WS generated s...
Status: NEW
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 7.3.1
Hardware: PC Windows 8 x64
: P3 normal with 1 vote (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on: 151845 194446
Blocks:
  Show dependency tree
 
Reported: 2010-07-13 07:20 UTC by Catchwa
Modified: 2014-10-03 01:04 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Sample WSDL and Schema to import as a Web Service Client (1.21 KB, application/x-zip-compressed)
2010-07-13 07:20 UTC, Catchwa
Details

Note You need to log in before you can comment on or make changes to this bug.
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