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(java.lang.IllegalArgumentException: URI is not absolute)
Error generating static Data Objects from XSD [message #780761] Thu, 19 January 2012 10:12 Go to next message
Nazzareno Sileno is currently offline Nazzareno SilenoFriend
Messages: 4
Registered: January 2012
Junior Member
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 #781261 is a reply to message #780761] 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
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 #781266 is a reply to message #781261] 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 "http://schemas.opengis.net/filter/1.0.0/".

-Blaise
Previous Topic:NOEXPAND hints and bind-parameters
Next Topic:Error generating static Data Objects from XSD
Goto Forum:
  


Current Time: Fri Dec 13 02:53:44 GMT 2024

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

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

Back to the top