[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-user
Subject:    Re: CastException with parsing instance of compiled XMLSchema.xsd
From:       "Jacob Danner" <jacob.danner () gmail ! com>
Date:       2008-05-30 22:31:28
Message-ID: bb04eb0a0805301531x7ed2bb9avd6bc69b5a29496da () mail ! gmail ! com
[Download RAW message or body]

Hi Scott,

I think you are getting this issue because XMLBeans already includes
types generated from XMLSchema.xsd. The error message you are seeing
indicates the packages for the already compiled xmlbean types in the
org.apache.xmlbeans.impl.xb.xsdschema package

While the packages are not the same, the metadata (.xsb) files
reference the same namespaces and thats where this error is most
likely coming from.

As a solution, you should just use the schema classes included in the
org.apache.xmlbeans.impl.xb.xsdschema package .
HTH,
-jacobd

On Fri, May 30, 2008 at 3:09 PM, Scott Hinkelman
<scott.hinkelman@oracle.com> wrote:
> Hi,
> I am receiving the following exception when parsing an existing instance
> after compiling the XMLSchema.xsd from W3C. The instance file was generated
> using the bindings with no problems, but can not read it back. It appears
> the cast problem is happening inside the external API which is generated.
> This is of course a unique xsd. I am using the same code approach which I
> use successfully with my other xsd file:
>
> java.lang.ClassCastException:
> org.apache.xmlbeans.impl.xb.xsdschema.impl.SchemaDocumentImpl cannot be cast
> to org.w3.x2001.xmlSchema.SchemaD
> ocument
>         at
> org.w3.x2001.xmlSchema.SchemaDocument$Factory.parse(SchemaDocument.java:766)
>         at
> com.oracle.aia.content.examples.XMLSchemaTest1.main(XMLSchemaTest1.java:55)
>
> Code snip where the cast exception occurs:
> File outfile=new File("out.xml");
> org.w3.x2001.xmlSchema.SchemaDocument doc2 =
> org.w3.x2001.xmlSchema.SchemaDocument.Factory.parse(outfile);
>
> XMLBeans is version 2.3.0.
>
> Any ideas?
> Thanks,
>
> Scott H.



-- 
I'm competing in a Half-Ironman distance triathlon to raise money for
the fight against cancer!
Please help support my efforts by going to:
http://www.active.com/donate/tntwaak/jacobd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic