users@jax-ws.java.net

Still wsimport errors using JAX-WS 2.1EA3 (was: Strange wsimport and WSDL/XSD validation issues: Name resolution)

From: Andreas Loew <Andreas.Loew_at_Sun.COM>
Date: Thu, 16 Nov 2006 11:05:41 +0100

Vivek, All,

for my customer's WSDL (which contains a series of two-level XSD
imports), I still get wsimport errors when trying to generate a Java
binding using the new release.

Please see the attached mail about what happened before - unfortunately,
I didn't receive any replies so far... :-(

The new set of error messages using JAX-WS 2.1 EA3 (from NB 5.0 running
on JDK 1.5.0_09) is the following:

Created dir:
D:\Home\Projekte\gematik\NetBeans\BrokerServiceWeb50\build\web\WEB-INF\classes
running wsimport
Consider using <depends>/<produces> so that wsimport won't do
unnecessary compilation
parsing WSDL...

[ERROR] RelatesToType complex type is in a referenced schema and do not
have the corresponding Java class specified by <jaxb:class ref="..."/>
customization. Therefore it cannot be referenced from outside.
   line 52 of http://www.w3.org/2006/03/addressing/ws-addr.xsd

[ERROR] (related to above) The schema for namespace
"http://www.w3.org/2005/08/addressing" (which includes the above
component) is designated for reference only by this customization.
   line 12 of http://dummy.pseudo-schema#schema2

[ERROR] (related to above) The problematic schema component is
referenced from this component: RelatesTo element declaration
   line 51 of http://www.w3.org/2006/03/addressing/ws-addr.xsd

What does the reference to a non-existing

        http://dummy.pseudo-schema#schema2

mean? How can I track this one down?

Unfortunately, as stated before, the WDSL is confidential, so I cannot
attach it here.

@Vivek:
I'll send the WSDL directly to you by private e-mail.

Any help with this issues is greatly appreciated.

Thanks & best regards,

Andreas

-- 
Andreas Loew
Java Architect
Sun Microsystems (Germany)

attached mail follows:



All,

for my current customer, I am trying to evaluate whether their (rather
complex and newly created) web services descriptions can be
implemented/consumed "out of the box" using NetBeans and the JAX-WS
2.x/WSIT (Project Tango) etc. tool set.

Currently, I am stuck, because for the main WSDL as well as for some of
the imported XSDs, validation in NetBeans 5.5 (running on JDK 1.5.0_09)
consistently fails, as does the attempt to call JAX-WS wsimport to
generate Java classes from it anyway.

On the other hand, XMLSpy tells me that both the WSDL as well as the
imported XSDs are perfectly valid (and to the best of my knowledge,
XMLSpy is right).

Unfortunately, the WDSL is confidential, so I cannot attach it to this
mail. I have attached a fragment (fragment.wsdl) that shows the first
few lines including namespace definitions and import statements.

I have attached the output of XML validation of the WSDL in NB 5.5
(validate-error.txt) as well as the output of trying to call wsimport on
this WSDL file (wsimport-error.txt).

Anyway, I have tracked down the problem to what I assume to be the root
cause for the WSDL/wsimport issue:

I have attached a small sample XSD (GTEST.xsd) for which validation in
NetBeans consistently fails when trying to reference elements or types
from the imported WS-Addressing schema (please see the comments in
GTEST.xsd). Again, using XMLSpy, the same file validates fine (and I
myself consider the XSD valid as well).

Also, using the exact same WSDL, I have managed to successfully generate
a Java binding using BEA's/Apache's XMLBeans...

Any ideas why name resolution might be failing? Any known issues with
regards to name resolution?

Many thanks in advance for any insights or advice on how to proceed in
order to understand what is going on here.

Best regards,

Andreas

-- 
Andreas Loew
Java Architect
Sun Microsystems (Germany) GmbH



XML validation started.
D:/Home/Projekte/gematik/NetBeans/BrokerServiceWeb50/web/WEB-INF/xsd/GTEL.xsd:87,7
src-resolve: Cannot resolve the name 'wsa:RelatesTo' to a(n) 'element declaration' component.

D:/Home/Projekte/gematik/NetBeans/BrokerServiceWeb50/web/WEB-INF/xsd/GSEC.xsd:120,4
src-resolve: Cannot resolve the name 'ds:Signature' to a(n) 'element declaration' component.

2 Error(s), 0 Warning(s).
XML validation finished.


error: RelatesToType complex type is in a referenced schema and do not have the corresponding Java class specified by <jaxb:class ref="..."/> customization. Therefore it cannot be referenced from outside.
  line 52 of http://www.w3.org/2006/03/addressing/ws-addr.xsd
error: (related to above) The schema for namespace "http://www.w3.org/2005/08/addressing" (which includes the above component) is designated for reference only by this customization.
  line 12 of http://dummy.pseudo-schema#schema2
error: (related to above) The problematic schema component is referenced from this component: RelatesTo element declaration
  line 51 of http://www.w3.org/2006/03/addressing/ws-addr.xsd
com.sun.istack.SAXParseException2: (related to above) The problematic schema component is referenced from this component: RelatesTo element declaration
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:211)
        at com.sun.tools.ws.processor.config.ModelInfo.buildModel(ModelInfo.java:87)
        at com.sun.tools.ws.processor.Processor.runModeler(Processor.java:81)
        at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:560)
        at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:56)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.tools.ws.Invoker.main(Invoker.java:78)
        at com.sun.tools.ws.WsImport.main(WsImport.java:38)
Caused by: com.sun.istack.SAXParseException2: (related to above) The problematic schema component is referenced from this component: RelatesTo element declaration
        at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:128)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2173)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:222)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:179)
        ... 10 more
Caused by: com.sun.istack.SAXParseException2: (related to above) The problematic schema component is referenced from this component: RelatesTo element declaration
        at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:66)
        at com.sun.tools.xjc.reader.xmlschema.ErrorReporter.error(ErrorReporter.java:63)
        at com.sun.tools.xjc.reader.xmlschema.ClassSelector._bindToClass(ClassSelector.java:318)
        at com.sun.tools.xjc.reader.xmlschema.ClassSelector.bindToType(ClassSelector.java:266)
        at com.sun.tools.xjc.reader.xmlschema.DefaultClassBinder.elementDecl(DefaultClassBinder.java:263)
        at com.sun.tools.xjc.reader.xmlschema.DefaultClassBinder.elementDecl(DefaultClassBinder.java:71)
        at com.sun.tools.xjc.reader.xmlschema.ClassBinderFilter.elementDecl(ClassBinderFilter.java:91)
        at com.sun.tools.xjc.reader.xmlschema.Abstractifier.elementDecl(Abstractifier.java:25)
        at com.sun.tools.xjc.reader.xmlschema.Abstractifier.elementDecl(Abstractifier.java:12)
        at com.sun.xml.xsom.impl.ElementDecl.apply(ElementDecl.java:216)
        at com.sun.tools.xjc.reader.xmlschema.ClassSelector._bindToClass(ClassSelector.java:299)
        at com.sun.tools.xjc.reader.xmlschema.ClassSelector.bindToType(ClassSelector.java:251)
        at com.sun.tools.xjc.reader.xmlschema.RawTypeSetBuilder.elementDecl(RawTypeSetBuilder.java:110)
        at com.sun.xml.xsom.impl.ElementDecl.visit(ElementDecl.java:205)
        at com.sun.tools.xjc.reader.xmlschema.RawTypeSetBuilder.particle(RawTypeSetBuilder.java:89)
        at com.sun.tools.xjc.reader.xmlschema.RawTypeSetBuilder.build(RawTypeSetBuilder.java:48)
        at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:321)
        at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.modelGroup(DefaultParticleBinder.java:355)
        at com.sun.xml.xsom.impl.ModelGroupImpl.visit(ModelGroupImpl.java:92)
        at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.particle(DefaultParticleBinder.java:331)
        at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder.build(DefaultParticleBinder.java:46)
        at com.sun.tools.xjc.reader.xmlschema.ParticleBinder.build(ParticleBinder.java:61)
        at com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder$1.particle(FreshComplexTypeBuilder.java:71)
        at com.sun.xml.xsom.impl.ParticleImpl.visit(ParticleImpl.java:91)
        at com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder.build(FreshComplexTypeBuilder.java:52)
        at com.sun.tools.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder.build(ComplexTypeFieldBuilder.java:64)
        at com.sun.tools.xjc.reader.xmlschema.BindRed.complexType(BindRed.java:37)
        at com.sun.xml.xsom.impl.ComplexTypeImpl.visit(ComplexTypeImpl.java:236)
        at com.sun.tools.xjc.reader.xmlschema.ClassSelector$Binding.build(ClassSelector.java:177)
        at com.sun.tools.xjc.reader.xmlschema.ClassSelector.executeTasks(ClassSelector.java:339)
        at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:141)
        at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:79)
        at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:399)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:213)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:68)
        at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:126)
        ... 13 more
error: com.sun.istack.SAXParseException2: (related to above) The problematic schema component is referenced from this component: RelatesTo element declaration