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 246555 - Reason: A class/interface with the same name
Summary: Reason: A class/interface with the same name
Status: RESOLVED INCOMPLETE
Alias: None
Product: webservices
Classification: Unclassified
Component: JAXB (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-19 15:38 UTC by JNetBeansIDE
Modified: 2015-07-07 15:09 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen shot of error message (15.53 KB, image/png)
2014-08-19 15:38 UTC, JNetBeansIDE
Details
The .wsdl that was used to generate using the Services Tab | Web Services | Add Web Service facilty that produced the error for me (8.50 KB, application/octet-stream)
2015-07-07 15:09 UTC, DGA51
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JNetBeansIDE 2014-08-19 15:38:41 UTC
Created attachment 148771 [details]
Screen shot of error message

Error message from NetBeans:
Web Service Client can not be created by JaXWS:wsimport utility
Reason A class/interface with the same name "com.psft.basic.BUSINESSUNITTypeShape" is already in use. Use a class customization to resolve this confilict

Explaination:
"A class/interface with the same name" is a known issue with JAXB. I did some research on the web and found some solutions to resolve this issue. Basically, you can either use a jaxb option "-B-XautoNameResolution" or customize class (or ObjectFactory method) binding (i.e. specify different names) for every jaxb types that have the same name.

I used a combination of the two and it gets rid of all the errors of 'wsimport' and all the type classes are generated by 'wsimport'. However, NetBeans still report it as an issue. And I checked the specific class that it complains about in this case "BUSINESSUNITTypeShape" and I found that these classes are generated with the name "BUSINESSUNITTypeShapeXX" where 'XX' is a number appended to the name. I assume that is how the same name issue is resolved by jaxb option "-B-XautoNameResolution" of wsimport.

But, NetBeans still report it as an error. I could not go further from here but have to report it as a bug with NetBeans. 

Note: If I customize class bindings for every jaxb types in the external binding file, it will likely resolve the problem. However, in my case, this is a huge amount of manual work since there are so many jaxb types that have the same name for this particular Web service I am trying to consume. The jaxb option "-B-XautoNameResolution" does seem to have resolved this issue on the 'wsimport' end. I'd like to know if there is something more I need to do in NetBeans or it is indeed a bug with NetBeans.
Comment 1 Marian Mirilovic 2014-08-20 09:36:00 UTC
Milan, please evaluate ASAP. Thanks in advance.
Comment 2 DGA51 2015-04-30 18:10:08 UTC
Ran into this today.
Comment 3 Jan Stola 2015-07-07 11:55:00 UTC
Could you, please, provide exact steps to reproduce this problem? It would be ideal to attach a sample project exhibiting the described problem and emphasize the difference between the actual and the expected behavior. Thank you in advance.
Comment 4 DGA51 2015-07-07 15:09:00 UTC
Created attachment 154506 [details]
The .wsdl that was used to generate using the Services Tab  |  Web Services | Add Web Service facilty that produced the error for me

Note that this service is now firewalled and only accepts request from previously authorized IP addresses