Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Error generating static Data Objects from XSD
Error generating static Data Objects from XSD [message #780997] Thu, 19 January 2012 05:12 Go to next message
Eclipse UserFriend
Hi,
I am trying to generate SDO from the StyledLayerDescriptor.xsd schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd
but following the Eclipse Link Example: wiki.eclipse.org/EclipseLink/Examples/SDO/Compiler
I obtain the following stack trace error: pastebin.com/KappdUb3

I have no idea how to solve this problem... Can you help me?

Thanks in advance!
Re: Error generating static Data Objects from XSD [message #781264 is a reply to message #780997] Fri, 20 January 2012 16:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi

StyledLayerDescriptor.xsd has an import to the schema filter.xsd which has the following include <xsd:include schemaLocation="expr.xsd"/>

There is an error trying to resolve expr.xsd since it's not a complete URL that can be found.

If you use the SDOClassGenerator programatically you can specify a SchemaResolver to handle this. The org.eclipse.persistence.sdo.helper.DefaultSchemaResolver might be enough for your needs otherwise you can extend it or implement the SchemaResolver interface if need to do more advanced resolving.

With the DefaultSchemaResolver if an absolute url is encountered it will be processed but if anything is not a complete url ie:"expr.xsd" you can set the baseSchemaLocation to be prepended to those urls. Here's an example of how to do that:


SDOClassGenerator gen = new SDOClassGenerator();

FileReader reader = new FileReader(new File("C:/StyledLayerDescriptor.xsd"));

DefaultSchemaResolver sr = new DefaultSchemaResolver();
sr.setBaseSchemaLocation(stringOfLocationYouWantToPrepend);
gen.generate(reader, "C:/sdo", sr);


Hope this helps
Denise
Re: Error generating static Data Objects from XSD [message #781269 is a reply to message #781264] Fri, 20 January 2012 16:57 Go to previous message
Eclipse UserFriend
Hi Nazzareno,

stringOfLocationYouWantToPrepend in this case would be "http://schemas.opengis.net/filter/1.0.0/".

-Blaise
Previous Topic:Error generating static Data Objects from XSD
Next Topic:Shared cache on multi base using same classes
Goto Forum:
  


Current Time: Thu May 22 16:22:09 EDT 2025

Powered by FUDForum. Page generated in 0.06434 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top