| Summary: | NullPointerException from WSDLAnalyzer when validating a WSDL | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Webservices | Reporter: | Mauro Molinari <mauromol> | ||||||
| Component: | wst.wsdl | Assignee: | Keith Chong <keith.chong.ca> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Keith Chong <keith.chong.ca> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | agarcdomi, bfitzpat, chris.spires, ech3l0n, gr.grzybek, isalgueiro, jtietje, keith.chong.ca, nboldt, royr, tdrury, tejones, thatnitind, tpeel143 | ||||||
| Version: | 3.2.1 | Flags: | thatnitind:
review?
(keith.chong.ca) |
||||||
| Target Milestone: | 3.14 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| URL: | https://github.com/eclipse/webtools.webservices/pull/1 | ||||||||
| See Also: |
https://git.eclipse.org/r/141012 https://git.eclipse.org/c/webservices/webtools.webservices.git/commit/?id=ab0e1795cdabbe86403a286f7e0c89cacfdbe511 |
||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Mauro Molinari
Created attachment 177006 [details]
ZIP containing the WSDL and XSD files needed to reproduce
Created attachment 192982 [details]
WSDL and XSD Files attached
Eclipse version information:
Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 2
Build id: 20110218-0911
I am submitting another example of a WSDL Test-v1.wsdl and an XSD TestTypes-v1.0.xsd that Eclipse is giving the same warning on. The warning is:
WS-I: A problem occured while running the WS-I WSDL conformance check: org.eclipse.wst.wsi.internal.analyzer.WSIAnalyzerException: null
------------------------------------------------------------------------------
Nested exception is: java.lang.NullPointerException The WSDLAnalyzer was unable to validate the given WSDL File.
Please note that SoapUI does not give me this warning. When I validate the wsdl using SoapUI, it passes without any warnings.
Thank you,
Frank
I got the same error with my WSDL file. The file passed validation using the latest XMLSpy 2011 Enterprise Edition. I am seeing the same error with this Amazon WSDL: http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl Any updates on when this will be resolved? I was able to reproduce the problem. I was troubleshooting validation errors in the wsdl files. The validator was not able to find the schema files. When I imported an XML catalog, the warnings went away but was replaced with the single warning at the beginning in each wsdl file with the exception of some that had errors. Some of the wsdl files were displaying errors from validation after the XML Catalog import, and when the errors were corrected , they were replaced with the parser warning: WS-I: A problem occured while running the WS-I WSDL conformance check: org.eclipse.wst.wsi.internal.analyzer.WSIAnalyzerException: The conformance validation process failed. ------------------------------------------------------------------------------ Nested exception is: java.lang.NullPointerException The WSDLAnalyzer was unable to validate the given WSDL File. All of the catalog elements in the User Specified Entries are Suffix Entry. I had to create the XML catalog by hand using the schema copied from OASIS-open.org. The export XML Catalog feature produces an empty file (no xml header or anything). <?xml version="1.0" encoding="UTF-8"?> <er:catalog xmlns:er="urn:oasis:names:tc:entity:xmlns:xml:catalog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:entity:xmlns:xml:catalog ../pathToSchema/XMLCatalogSchema.xsd"> <systemSuffix systemIdSuffix="v2_0/Example.xsd" uri="platform:/resource/path/Example.xsd"/> </catalog> in the wsdl the schema locations are relative: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import namespace="http://site/service/" id="ExampleRequest" schemaLocation="../path/v2_0/Example.xsd"/> </xsd:schema> I did not try other permutation of the XML catalog to see if different catalog entries would behave differently. A little more investigation shows that I am only getting the NullPointer exception in the validator when the files successfully validate. I removed the XML Catalog entry for the Schema files and use the absolute path to the schema files. After putting in the absolute path, the errors from validation go away is replaced with the NullPointer exception. So the XML Catalog does not seem related, but the error/warning only appears when the file validates successfully. OK, I've finally examined all the details of WSDL WS-I Basic Profile validatiion which ends in NPE. I've narrowed down the problem two the simplest case when there are TWO wsdl:ports. The problem is this line: ((WSDLValidatorImpl)validator).init(analyzerContext, profileAssertions, reportArtifact, getAnalyzerConfig(), reporter, getAnalyzerConfigIndex() == 0) in org.eclipse.wst.wsi.internal.core.analyzer.BasicProfileAnalyzer in org.eclipse.wst.wsi.source_1.0.500.v201203081939.jar. This line tells org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl to perform "initialization" (which means validating WSDL at definition, typed and imports level) ONLY for first AnalyzerConfig, but in case there are more than one port or service, the method: org.eclipse.wst.wsi.internal.analyzer.WSDLAnalyzer.addConfigurationToTest(String, String, String, String) is invoked for each port (source: org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator.validate(Document, IValidationInfo)) The problem lies in: org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl.validateArtifact() which, at the end invokes org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl.cleanup() thus clearing the org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl.containerMap WHICH CONTAINS ALL WS-I PREREQUISITES needed for further validation. I see two possible solutions: 1) always perform initialization of org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl (replace "getAnalyzerConfigIndex() == 0" with "true") - slower 2) refactor much more code to allow the invoker of WSDLValidatorImpl to get access to "containerMap" (which contains results of previous validation results - prerequisites) before cleaning it up Please fix this (and https://bugs.eclipse.org/bugs/show_bug.cgi?id=334057) bug! It's very annoying! regards Grzegorz Grzybek Had this error, but it goes away when the namespaces have a trailing slash. Change: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="urn:oasis:names:tc:entity:xmlns:xml:catalog ../pathToSchema/XMLCatalogSchema.xsd"> to xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/" xsi:schemaLocation="urn:oasis:names:tc:entity:xmlns:xml:catalog ../pathToSchema/XMLCatalogSchema.xsd"> Note trailing slash on xmlns:xsi. Don't change a urn!! This way you make xsi:schemaLocation a custom attribute without any meaning because what matters is the namespace, not the prefix. You could also have changed the namespace to "xyzabc" - it would work just like adding "/". regards Grzegorz Grzybek Today I hit again this problem. Files that reproduce this problem were submitted, so could anyone take a look at this? :-( The exception breaks the validation process when another WSDL imports a WSDL for which this error is shown. Since WSDL validation is always quite complex, this problem is quite annoying. I've described the solution over a year ago. The pull request (https://github.com/eclipse/webtools.webservices/pull/1) is left without response. I'm working with my forked version for over a year and I've never get any NPE... I don't know why the pull request is not used... regards Grzegorz Grzybek Just hit this NPE validating an WSDL with two ports. I'm using Eclipse 4.4.1 and Web Services Tools 3.7.0.v201501151848. Someone please pull in Grzegorz's patch. Wow, 5 years... I didn't expect I'd switch to IDEA after 12 years of using Eclipse ;) ~Grzegorz Soon this (already solved) bug has his ninth anniversary... (In reply to Grzegorz Grzybek from comment #12) > I've described the solution over a year ago. The pull request > (https://github.com/eclipse/webtools.webservices/pull/1) is left without > response. I'm working with my forked version for over a year and I've never > get any NPE... > > I don't know why the pull request is not used... We don't get notified of pull requests. and with the original repositories being hosted on git.eclipse.org, there's not a friction-free way of getting those changes integrated that perfectly tracks with CLA signing. The lone Source Editing pull request has been processed, but there's no way that I can Close it. Converted to gerrit: https://git.eclipse.org/r/#/c/141006/ New Gerrit change created: https://git.eclipse.org/r/141012 Gerrit change https://git.eclipse.org/r/141012 was merged to [master]. Commit: http://git.eclipse.org/c/webservices/webtools.webservices.git/commit/?id=ab0e1795cdabbe86403a286f7e0c89cacfdbe511 This was merged for WTP 3.14. |