Frank Budinsky schrieb:

Hi Thomas,

Since you don't show what schema.xsd and include.xsd contain, and what type you're trying to create when you get the error, it's very hard to guess what the problem might be.

Things to check:

1) Is include.xsd in the same folder as schema.xsd (i.e., c:\temp)? It should be. 2) What is the targetNamespace of the schema in schema.xsd? Is it different from the namespace you're importing ("<our namespace>")? It should be different. 3) What is the target namespace of the schema in include.xsd? Is it the same as namespace you're importing ("<our namespace>")? It should be the same. 4) Are you creating the type from the included schema using the imported namespace ("<our namespace>") as the URI argument ? You should be.

Frank.

Thomas Trenz <[email protected]> wrote on 07/27/2009 06:15:13 AM:

> Hello,
>
> I am using Apache Tuscany SDO 1.1.1 and I have a problem loading a
> schema file with an import statement. What happens is that I can create
> data objects of types that are included in the main file. However, when
> I try to create objects from the imported file, I get the following error:
>
> java.lang.IllegalArgumentException in
> org.apache.tuscany.sdo.util.DataObjectUtil.create(DataObjectUtil.java:2549).
>
> The code to load the schema file is:
>
>   public static void initHelperContext () throws FileNotFoundException
>   {
>     hc = SDOUtil.createHelperContext();
>
>     XSDHelper xsdHelper = hc.getXSDHelper();
> > File f2 = new File ("c:\temp\schema.xsd");
>     InputStream is2 = new FileInputStream (f2);
>     xsdHelper.define(is2, f2.getAbsolutePath());
>   }
>
> That's how the schema file gets imported:
>
>   <xsd:import namespace="<our namespace>" schemaLocation="include.xsd"/>
>
> When I copy the definitions from the imported file into the main file,
> then everything works fine...
>
> Any help is appreciated...
>
> Thanks
> Thomas

Hi Frank,

thanks a lot for your quick reply. In our case, both .xsd files have the same namespace. So we're violating your second point. Is there any reason, why that is not allowed?

Best regards,
Thomas

--
-------------------------------------------------------------------
Thomas Trenz
blue elephant systems GmbH
Wollgrasweg 49
70599 Stuttgart
Germany

Tel.: +49 711 451 017 - 579
Fax.: +49 711 451 017 - 573
Email: [email protected]

Sitz: Stuttgart, Amtsgericht Stuttgart, HRB 24106
Geschäftsführer:  Joachim Hörnle, Thomas Gentsch, Holger Dietrich

Reply via email to