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 175481 - StackOverflowError when validating WSDL file
Summary: StackOverflowError when validating WSDL file
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Validation (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Nikita Krjukov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-27 01:32 UTC by Jun Qian
Modified: 2009-11-09 11:19 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a Java project containing one WSDL file and many XSD files (380.09 KB, application/x-compressed)
2009-10-27 01:36 UTC, Jun Qian
Details
WSDL/XSD dependency map (131.79 KB, image/jpeg)
2009-10-27 01:38 UTC, Jun Qian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jun Qian 2009-10-27 01:32:58 UTC
Open the attached project, and try to validate PDQSupplier.wsdl in the source directory. 

=> java.lang.StackOverflowError
	at java.util.ArrayList.get(ArrayList.java:321)
	at java.util.AbstractList$Itr.next(AbstractList.java:422)
	at org.netbeans.modules.xml.xam.AbstractComponent.getChildren(AbstractComponent.java:197)
	at org.netbeans.modules.xml.schema.model.impl.SchemaImpl.getRedefines(SchemaImpl.java:314)
	at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.getNotImportRefrences(SchemaModelImpl.java:227)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:245)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
	at
org.netbeans.modules.xml.schema.model.impl.resolver.ResolveSession.checkAllDependingModelsLoaded(ResolveSession.java:252)
 ......
Comment 1 Jun Qian 2009-10-27 01:36:01 UTC
Created attachment 90109 [details]
a Java project containing one WSDL file and many XSD files
Comment 2 Jun Qian 2009-10-27 01:38:49 UTC
Created attachment 90110 [details]
WSDL/XSD dependency map
Comment 3 Shivanand Kini 2009-10-27 02:40:36 UTC
Sergey, can you have someone look at this? Looks like caused by schema related changes.
Comment 4 Sergey Lunegov 2009-10-27 09:06:44 UTC
Nikita, please take a look.
Comment 5 Nikita Krjukov 2009-10-27 22:13:17 UTC
The exception happens because of cyclic include between voc.xsd, datatyps.xsd and datatypes-base.xsd
Such dependency is acceptable. But unfortunately it comes to the error. But you can get rid of the exception if
reorganize the includes. 

The man work is in trunk and the issue can be reproduced there as well. So I change mailstone to 6.8
Comment 6 Jun Qian 2009-10-27 23:08:16 UTC
Yes, I see the cyclic include among voc.xsd, datatyps.xsd and datatypes-base.xsd. However, if you try to validate any
one of them, it validates OK.

All those xsds in the attached project come from the HL7 standard and can't be changed or re-orged.

I think this is a kinda stopper for the HealthCarePack which is based on NetBeans 6.7.1, so I think the fix should be
back-ported to 6.7.1.
Comment 7 Nikita Krjukov 2009-10-28 13:00:23 UTC
Fixed in trunk http://hg.netbeans.org/main/rev/d02e798c40aa
A new JUnit test is added to ScehmaModelResolverTest.java

I agree. It definitely has to be migrated to 6.7.1 

The reason why the validation for XSD works well is because the validation for XSD and WSDL work different ways. 
The XSD validation uses only a SAX parser. A schema is considered correct if it has been managed to parse it
successfully. But the WSDL validation tries resolving types of message parts. It uses more complex approaches of
resolving (so called "mega include"), which tries resolving implicit inclusions. You can find some details in the issue
#122836 and also in comments for method IncludeResolver.getMegaIncludedModels(...)
Comment 8 Quality Engineering 2009-10-29 12:10:22 UTC
Integrated into 'main-golden', will be available in build *200910290252* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d02e798c40aa
User: supernikita@netbeans.org
Log: #175481 - StackOverflowError when validating WSDL file
Comment 9 Jun Qian 2009-10-29 20:14:59 UTC
Tested in 6.8 nightly and I don't see the StackOverflowError anymore.

One thing to note is that I had to add 

    xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/"

to the <definitions> element to validate the WSDL. The following is the output: 

    XML validation started.
    Checking file:/C:/temp/175481/src/PDQSupplier.wsdl...
    Referenced entity at "http://schemas.xmlsoap.org/wsdl/".
    XML validation finished.

Without the xsi:schemaLocation definition, I got the following:

    XML validation started.
    Checking file:/C:/temp/175481/src/PDQSupplier.wsdl...
    cvc-elt.1: Cannot find the declaration of element 'definitions'. [9]
    XML validation finished.

Maybe the system catalog in NetBeans 6.8 is different somehow?

Comment 10 pgebauer 2009-11-04 14:09:11 UTC
The fix has been ported into the release67_fixes repository.
http://hg.netbeans.org/release67_fixes/rev/57e28111c50d
Comment 11 Jun Qian 2009-11-09 11:19:07 UTC
Followed the following instructions from Nikita and it worked OK in NetBeans 6.7.

1) Download and install full version of NetBeans 6.7 http://www.netbeans.org/downloads/6.7/index.html
2) Run the IDE.
3) Select menu Tools -> Plugins.
4) Click on the tab Updates and apply all available updates.
5) Restart NetBeans and do steps 3, 4, 5 again while there isn't updates remain.
6) Check if the "XML Schema and WSDL" plugin is installed. Install it if necessary (from Available Plugins tab)

Now your NetBeans has to be almost up to date, but only without latest patches. To install the latest once follow the next steps:

7) Select the tab Settings in the Plugins dialog.
8) Click on the button Add, copy/paste the URL http://smetiste.czech.sun.com/builds/netbeans/6.7.1/fixes/2009-11-04_18-04-21/ml/uc/catalog.xml.gz into the URL Textbox and click on the OK button.
9) A new updates has to appear in the Update tab. Apply them and restart NetBeans. Now you can start testing.