users@jaxb.java.net

Re: WSDP 1.2 and xsd:import

From: Thomas Plümpe <thomanski_at_gmx.de>
Date: Mon, 16 Jun 2003 22:14:04 +0200

Hi Kohsuke,

> If you could distill your problem down to a test case, that would be
> great. Or if you can just send us the whole schema, that would be fine
> by me, too.
when I try to compile the attached schemas (BPEL4WS 1.1 + related, 5
schemas in 4 namespaces)

via

  xjc.sh -extension -b binding.xjb -catalog catalog.cat \
    -d generated_src/ \
    schemas/bpel-1.1-may2003.xsd schemas/partnerLinkType.xsd \
    schemas/ws-addressing.xsd schemas/wsdl-1.1.xsd \
    schemas/messageProperties.xsd

I get the following message (twice)

  Failed to create InputSource:
    file://<my_proj_dir>/schemas/wsdl-1.1.xsd

and then a number of errors starting with these

  [ERROR] 'definitions' is already defined
    line 83 of
  [ERROR] (related to above error) the first definition appears here
    line 104 of wsdl-1.1.xsd
  [...].

Since I have removed the import of the WSDL schema from the BPEL
schema (the only xsd:import in all of these files), compilation
has worked flawlessly (except for the expected warnings).

> Also, try "-mode forest" option. This will make XJC dump all the inputs
> it recognized along with their URIs. Probably you will find the same
> schema listed twice under different URIs, and if you find them, send
> please post those URIs (or send it to jaxb-comment_at_sun.com if you don't
> want that to be public.)
This shows that the first file loaded is the wsdl schema from
http://schemas.xmlsoap.org/wsdl/ and the fourth file is the
local schemas/wsdl-1.1.xsd file. xjc should only get the local
file.

Alternatively, if changing the importing schema is not an option,
you can as well
    - keep the xsd:import in the bpel spec.
    - remove "schemas/wsdl-1.1.xsd" from the xjc.sh invocation,
    - change the jaxb:bindings' schemaLocation in binding.xjb
      from "schemas/wsdl-1.1.xsd" to its target namespace
      "http://schemas.xmlsoap.org/wsdl/"
and ignore the "Failed to create InputSource" messages which
seem to be non-fatal, i.e. compilation succeeds.

I have previously mentioned that although I got this to work, I
was unable to get a WSDL instance file that makes use of the
messageProperties and partnerLinkType schemas unmarshalled and
promised a more detailed report. But apparently, this fails
because the extensions are not allowed by the WSDL schema, so
it doesn't appear to be a JAXB bug.

I have attached a tgz archive of the files necessary to
reproduce the bug.

> which version of JAXB/JWSDP are you using?
JWSDP 1.2, JAXB 1.0.1

> JDK version and platform
Sun J2SDK 1.4.1_02, Linux

> other versioning info (Xerces, Ant, etc)
xerces included in jwsdp 1.2

> simplified schema and instance docs, if possible. The
> less complicated your samples are, the easier it is for
> us to track down the problem.
Sorry it's not simplified, but you really have to look at
the bpel schema's xsd:import only and (for the alternative)
at binding.xjb and the command line invocation of xjc.

Thomas