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 195792 - When creating a client by JAX-WS Style, Erroneous XXX_Service.java class is generated
Summary: When creating a client by JAX-WS Style, Erroneous XXX_Service.java class is g...
Status: RESOLVED WORKSFORME
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 09:40 UTC by Soham_Majumder
Modified: 2013-07-09 14:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NetBeans 7.0 Client Service File creation Error (138.72 KB, image/jpeg)
2011-02-22 09:40 UTC, Soham_Majumder
Details
Sample WSDL file to test the Issue (2.10 KB, application/xml)
2011-02-22 09:42 UTC, Soham_Majumder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Soham_Majumder 2011-02-22 09:40:34 UTC
Created attachment 106279 [details]
NetBeans 7.0 Client Service File creation Error

When creating a JAX-WS Client from WSDL file, the generated XXXX_Service.java file contains functions having "super(__getWsdlLocation(), EMPLOYEEREGISTER_QNAME, features);" codes which show the following error-->"constructor Service in class javax.xml.ws.Service cannot be applied to given types
 required: java.net.URL,javax.xml.namespace.QName
 found: java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]"

Once the code is commented/edited as "super(__getWsdlLocation(), EMPLOYEEREGISTER_QNAME/*, features*/);" the code gets compiled as seems to be running fine.

Steps to check/Reproduce::::::::::

1> Download the attached validated WSDL file to create a JAX-WS Client from NetBeans 7.0.

2> Create a dummy Java Application (for creating the client)

3> Right click on the package/project, to get the Options drop down menu.

4> Select Web Service Client --> Local file --> Browse and select the downloaded WSDL file.

5> Select/create a package.

6> Click Finish

Actual Result:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
org.example.employeeregister.EmployeeRegister_Service.java contains 
 the following functions which have the same error.....
    public EmployeeRegister_Service(WebServiceFeature... features) {
        super(__getWsdlLocation(), EMPLOYEEREGISTER_QNAME, features);
    }

    public EmployeeRegister_Service(URL wsdlLocation, WebServiceFeature... features) {
        super(wsdlLocation, EMPLOYEEREGISTER_QNAME, features);
    }

    public EmployeeRegister_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
        super(wsdlLocation, serviceName, features);
    } 

"constructor Service in class javax.xml.ws.Service cannot be applied to given types
 required: java.net.URL,javax.xml.namespace.QName
 found: java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]"

Expected Result::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Not sure but when the codes are commented/Modified as...
    public EmployeeRegister_Service(WebServiceFeature... features) {
        super(__getWsdlLocation(), EMPLOYEEREGISTER_QNAME/*, features*/);
    }

    public EmployeeRegister_Service(URL wsdlLocation, WebServiceFeature... features) {
        super(wsdlLocation, EMPLOYEEREGISTER_QNAME/*, features*/);
    }

    public EmployeeRegister_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
        super(wsdlLocation, serviceName, /*features*/);
    }
things seem to work.

Build Date & Platform:::::::::::::::::::::::::::::::::::::: 
Product Version: NetBeans IDE 7.0 Beta (Build 201011152355)
Java: 1.6.0_21; Java HotSpot(TM) Client VM 17.0-b17
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\305782\.netbeans\7.0beta

Additional Builds and Platforms:::::::::::::::::::::::::::: 
Works smoothly on (Product Version: NetBeans IDE 6.1 (Build 200804211638))
Java: 1.5.0_10; Java HotSpot(TM) Client VM 1.5.0_10-b03
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb), 

but has the same problem in 
Product Version: NetBeans IDE 6.9.1 (Build 201011082200)
Java: 1.6.0_21; Java HotSpot(TM) Client VM 17.0-b17
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\305782\.netbeans\6.9

Additional :::::::
Screen shot attached.
Comment 1 Soham_Majumder 2011-02-22 09:42:01 UTC
Created attachment 106280 [details]
Sample WSDL file to test the Issue

Sorry missed while comiting the Issue
Comment 2 Denis Anisimov 2011-02-22 10:44:11 UTC
This is not a bug.
This is expected behavior and cannot be fixed . The reason is below:
- Your project classpath contains JDK jar libraries which includes WS support
libraries. 
- The mentioned libraries have old version. 
They are inside JDK so there is no possibility to remove them from classpath.
- To resolve this problem "endorsed" jars mechanism is used.
Nb has a number of jar files for recent WS specification. These jar files are
placed into special folder and it is used as endorsed folder. Java endorsed mechanism uses these jars instead of old .
- As result one can use modern WS specification .
Project can be built and deployed against this modern WS specification.
- Errors are shown only in the editor and project explorer because Nb Java infrastructure doesn't uses JDK libraries and doesn't know about endorsed libraries.
But these errors are ONLY inside generated source files which should not be
modified and edited by user. Their usage doesn't bring a problem in the user source code.

There is no problems with ant task usage for build/deploy project .
You can just ignore these errors in project explorer and work with project 
without any problem.
Comment 3 tdk 2013-06-26 11:06:08 UTC
I know this issue was raised quite siome time ago, but I'm running into the exact problem right now with NB 7.3 (Build 201306052037) and Java 1.6.0_43.

Dennis answer "There is no problems with ant task usage for build/deploy project .
You can just ignore these errors in project explorer and work with project 
without any problem." is not quite to the point, because I simply can't compile my generated sources without manually fixing the code, which I have to redo after each clean-build.

Dennis mentions the "endorsed" libraries, how can I force NB to use them instead of the JDK ones (which actually cause this problem)?
Comment 4 Milan Kuchtiak 2013-07-09 14:26:05 UTC
Please, check ix xendorsed wsimport parameter is set to true:

Go to:
Web Service References -> Your_service -> Edit Web Service Attributes (on right click) -> Wsimport options

If not, please set this option to true.

See that Netbeans projects (Ant) use the JAX-WS 2.2 library, bundled with IDE, for Wsimport task (JAX-WS artifact generation).

I tested your wsdl file with Netbeans7.0, 7.3 and development version (7.4).

Please, reopen the issue if there are still problems. There would be best you could attach the sample project to the issue then.