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 84659 - Assertion error when import is added in source view and validated
Summary: Assertion error when import is added in source view and validated
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: WSDL Model (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
: 84714 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-12 02:26 UTC by Shivanand Kini
Modified: 2006-09-19 12:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The sample wsdl file (10.40 KB, application/octet-stream)
2006-09-12 02:26 UTC, Shivanand Kini
Details
ide.log (26.67 KB, text/plain)
2006-09-12 02:28 UTC, Shivanand Kini
Details
part #1/2: fix in xml/xam (7.35 KB, patch)
2006-09-13 19:57 UTC, Nam Nguyen
Details | Diff
part #2/2: fix in xml/wsdl/api (21.30 KB, application/octet-stream)
2006-09-13 19:59 UTC, Nam Nguyen
Details
part #3/2: fix test in xml/schema/api (3.79 KB, patch)
2006-09-13 23:49 UTC, Nam Nguyen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shivanand Kini 2006-09-12 02:26:34 UTC
1. Open the attached wsdl in netbeans.
2. Create a new PurchaseOrder schema for sample schemas in the same folder.
3. Add <xsd:import namespace="something" location="newpo.xsd"/> under the empty
inline schema
4. Validate, shows a error namespace shoudl match targetnamespace of schema
5. Change the namespace to match targetNamespace of schema.
6. Validate
7. AssertionError is thrown.
java.lang.AssertionError: the text content under schema couldnt be found in the
wsdl document
	at
org.netbeans.modules.xml.wsdl.validator.WSDLInlineSchemaValidator.validate(WSDLInlineSchemaValidator.java:97)
	at org.netbeans.modules.xml.xam.spi.Validation.validate(Validation.java:78)
	at
org.netbeans.modules.xml.validation.ValidationOutputWindowController.validate(ValidationOutputWindowController.java:64)
	at
org.netbeans.modules.xml.validation.ValidateXMLCookieImpl.validateXML(ValidateXMLCookieImpl.java:48)
	at
org.netbeans.modules.xml.tools.actions.ValidateAction$RunAction.run(ValidateAction.java:95)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 Shivanand Kini 2006-09-12 02:26:54 UTC
Created attachment 33801 [details]
The sample wsdl file
Comment 2 Shivanand Kini 2006-09-12 02:28:20 UTC
Created attachment 33802 [details]
ide.log
Comment 3 Nam Nguyen 2006-09-12 22:59:23 UTC
We already have a unit test case for this bug (similar stack) which run fine on
Windows.  I just work on Linux and notice that this test
SyncUpdateTest.updatePeerOnInlinSchema failed.  Start investigate base on this
unit test.

Kini: what is the platform you observe this?
Comment 4 Shivanand Kini 2006-09-12 23:04:43 UTC
I saw this on windows xp
Comment 5 Nam Nguyen 2006-09-13 19:57:58 UTC
Created attachment 33899 [details]
part #1/2: fix in xml/xam
Comment 6 Nam Nguyen 2006-09-13 19:59:52 UTC
Created attachment 33900 [details]
part #2/2: fix in xml/wsdl/api
Comment 7 Nam Nguyen 2006-09-13 20:06:29 UTC
The issue here is that sync with change deep inside embedded schema does not
update SchemaImpl peer node, hence the wsdlSchema.getContentFragment still
return old content and failed the assertion.

The fix is to implement update all peer nodes of components on path to root.

The fix has been integrated into release55_dev.  Attachments for the fix are:
xml-xam-84659.diff and xml-wsdl-api-84659.diff.
Comment 8 Nam Nguyen 2006-09-13 23:49:52 UTC
Created attachment 33910 [details]
part #3/2: fix test in xml/schema/api
Comment 9 Shivanand Kini 2006-09-14 05:56:35 UTC
*** Issue 84714 has been marked as a duplicate of this issue. ***
Comment 10 Nam Nguyen 2006-09-14 20:28:36 UTC
Fixes merged into release55:

/cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentModel.java,v
 <--  AbstractDocumentModel.java
new revision: 1.1.2.24; previous revision: 1.1.2.23
/cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/ChangeInfo.java,v  <-- 
ChangeInfo.java
new revision: 1.1.2.5; previous revision: 1.1.2.4
/cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentComponent.java,v
 <--  AbstractDocumentComponent.java
new revision: 1.1.2.27; previous revision: 1.1.2.26
/cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/SyncUnit.java,v  <-- 
SyncUnit.java
new revision: 1.1.2.4; previous revision: 1.1.2.3
/cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/impl/WSDLModelImpl.java,v
 <--  WSDLModelImpl.java
new revision: 1.2.2.23; previous revision: 1.2.2.22
/cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/impl/TypesImpl.java,v
 <--  TypesImpl.java
new revision: 1.2.2.2; previous revision: 1.2.2.1
/cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/impl/SyncReviewVisitor.java,v
 <--  SyncReviewVisitor.java
/cvs/xml/schema/api/test/unit/src/org/netbeans/modules/xml/schema/model/impl/xdm/SyncTest.java,v
 <--  SyncTest.java
new revision: 1.1.2.32; previous revision: 1.1.2.31
/cvs/xml/wsdl/api/test/unit/src/org/netbeans/modules/xml/wsdl/model/impl/SyncUpdateTest.java,v
 <--  SyncUpdateTest.java
new revision: 1.1.2.22; previous revision: 1.1.2.21
Comment 11 Martin Schovanek 2006-09-19 11:40:06 UTC
Please can someone from QE verify the fix in the latest release55 build.
Comment 12 Jindrich Sedek 2006-09-19 12:25:52 UTC
v.