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 163532

Summary: IllegalArgumentException when adding binding; confuses WSDL model for document
Product: xml Reporter: jlautz <jlautz>
Component: WSDL ToolsAssignee: Jun Qian <jqian>
Status: VERIFIED FIXED    
Severity: blocker CC: asif_m, skini, vchellasamy
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Stack trace for first IllegalArgumentException
Stack trace for subsequent IllegalStateException (Add Message action)
Screenshot showing "ghost" Binding1
Expected dialog after clicking Add Binding.

Description jlautz 2009-04-23 21:42:10 UTC
Synopsis: 

1. Open a WSDL file without elements (no messages, ports, etc.) in the WSDL editor.
2. In the tree view, click Add Binding in the context menu for the Bindings node. 
--> No binding appears, nor error message. 
--> The stack trace for an IllegalArgumentException is written to the log. (Stack trace attached). 
--> Subsequent user actions produce an IllegalStateException in the log (Stack trace attached). 
3. Close and reopen the WSDL document (saving is not required).
--> "WSDL is not well-formed." message is displayed in a dialog, although validation doesn't reveal any errors.
--> A Binding1 element is shown in tree view that does not exist in source view. (Screen shot attached)
4. Close WSDL document, restart NB, and reopen the WSDL document.
--> No "WSDL is not well-formed." message is displayed. 
--> Tree view does not show the Binding1 element.

Put at priority P1, because it causes a bunch of automated tests to fail.

Seen with GlassfishESB V2.1 installation: 
PRODUCT_NAME=Glassfish ESB
PRODUCT_BUILD=20090422-0721
PRODUCT_VERSION=2.1

#NETBEANS
#--------------------
NETBEANS_BUILD=200904151427
NETBEANS_VERSION=6.5.1
netbeans.zip=http://smetiste.czech.sun.com/builds/netbeans/6.5/fixes/latest/zip/netbeans-6.5.1-200904151427-java.zip

#SOA
#--------------------
SOA_BUILD=090422
NETBEANS_VERSION=Sierra/soarelease Build
CODELINE=soa-dev65
CVS_TIMESTAMP=2009.04.22.08.10.05
gfesb-nbms.zip=http://download.java.net/jbi/binaries/ojc-nbm-dt/soa-dev65/nightly/Build090422/gfesb-nbms.zip
Comment 1 jlautz 2009-04-23 21:43:53 UTC
Created attachment 80796 [details]
Stack trace for first IllegalArgumentException
Comment 2 jlautz 2009-04-23 21:44:40 UTC
Created attachment 80797 [details]
Stack trace for subsequent IllegalStateException (Add Message action)
Comment 3 jlautz 2009-04-23 21:47:53 UTC
Created attachment 80798 [details]
Screenshot showing "ghost" Binding1
Comment 4 Jun Qian 2009-04-23 23:08:59 UTC
I think the user should not be able to add a new Binding when there is no PortType defined in the WSDL document. The
reported issue can be fixed either by disabling the "Add Binding" action or by showing some error message dialog after
the "Add Binding" action is invoked if there is no PortType defined.

I don't think this is a P1 issue. The automated tests are probably not valid use cases. Downgrading to P3.
Comment 5 jlautz 2009-04-24 00:50:50 UTC
This is a regression. These tests cases have worked for at least a few releases before now.
Comment 6 Jun Qian 2009-04-24 01:05:41 UTC
Jennifer, could you please describe your test case? What does it try to test?
Comment 7 asif_m 2009-04-24 01:13:40 UTC
The wsdl file ends up in unused state,  this is a usability issue which any developer would get into this situation. 
There should be gui level validation to check if port types has been defined, if not, it should disable the "Add
Binding" option or create a default port automatically.

We should fix this issue as soon as possible,  I would mark this as P1, or atleast P2 issue.  This is a valid negative
test case which check the validation of wsdl interaction.
Comment 8 jlautz 2009-04-24 01:45:59 UTC
Screenshot added of original behavior from JavaCAPS 6 kit.
Comment 9 jlautz 2009-04-24 01:46:54 UTC
Created attachment 80810 [details]
Expected dialog after clicking Add Binding.
Comment 10 Jun Qian 2009-04-24 02:20:27 UTC
Jenifer, thanks for the snapshot for the original behavior. 

Fixed in soa-dev65 branch: http://hg.netbeans.org/soa-dev65/rev/c43d74492392

Please let me know if you want this fix to be included in gfesbv21 branch after your verification. 
Comment 11 jlautz 2009-04-24 16:54:18 UTC
Thanks for the quick turnaround, Jun! 

I verified the fix with soadev65 kit sierra_557_20090424_0510. 

Yes, please could you port the fix to the Glassfish V2.1 branch.
Comment 12 Jun Qian 2009-04-24 21:30:32 UTC
Transplanted the fix into gfesbv21 branch: http://hg.netbeans.org/gfesbv21/rev/104974d158f9
Comment 13 jlautz 2009-04-28 19:09:51 UTC
Verified on Glassfish ESB 2.1 on windows Vista:
PRODUCT_BUILD=20090426-0723
NETBEANS_BUILD=200904151427
NETBEANS_VERSION=6.5.1
SOA_BUILD=090426
NETBEANS_VERSION=Sierra/soarelease Build