Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:12 Go to next message
Nazzareno Sileno is currently offline Nazzareno SilenoFriend
Messages: 4
Registered: January 2012
Junior Member
I am trying to generate SDO from the StyledLayerDescriptor.xsd
but following the Eclipse Link Example:
I obtain the following stack trace error:

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 21:53 Go to previous messageGo to next message
Denise Smith is currently offline Denise SmithFriend
Messages: 11
Registered: July 2009
Junior Member

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();
gen.generate(reader, "C:/sdo", sr);

Hope this helps
Re: Error generating static Data Objects from XSD [message #781269 is a reply to message #781264] Fri, 20 January 2012 21:57 Go to previous message
Blaise Doughan is currently offline Blaise DoughanFriend
Messages: 163
Registered: July 2009
Senior Member

Hi Nazzareno,

stringOfLocationYouWantToPrepend in this case would be "".

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

Current Time: Wed Aug 05 22:37:26 GMT 2020

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

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

Back to the top