[Geoserver-users] [Geotools-gt2-users] question about using gt2-xmlcodegen

Yingqi Tang wrote:

Justin,

when I am trying to generate the binding for owaAll.xsd schema, I got
a fatal error saying that

NullPointerException from org.geotools.xml.Schemas.getIncludes(Schemas.java 862)

Which seems to be caused by the <import> tag in the owaAll schema.

Do you how to solve that?

Hmm... that would mean the schema passed in is null... can you give me the entire stack trace?

Thanks,
Yingqi

On 7/25/07, Yingqi Tang <anakintang@anonymised.com> wrote:

Justin,

Justin

Thanks a lot for the information and I already checkout the geoserver
code. I am also a little curious about the process of generating those
model and binding using EMF and gt2-xmlcodegen, so could you give me
some information on how to generate them independent from the
geoserver project?

I hope I didn't trouble you too much on this.

Thanks,
Yingqi

On 7/25/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:
> Sure thing.
>
> They live in the geoserver subversion repository.
>
> http://svn.codehaus.org/geoserver/trunk/
>
> In particular:
>
> http://svn.codehaus.org/geoserver/trunk/geoserver/net.opengis.ows/
> http://svn.codehaus.org/geoserver/trunk/geoserver/net.opengis.wfs/
>
> The above two are just the models themselves generated from the schema
>
> http://svn.codehaus.org/geoserver/trunk/geoserver/ows
> http://svn.codehaus.org/geoserver/trunk/geoserver/wfs
>
> These two modules contain the xml bindings to parse + encode instances
> of the model.
>
> Check them out and feel free to let me know if you have any more questions.
>
> -Justin
>
> Yingqi Tang wrote:
> > That will be great if you could provide more infomation on those
> > modules that you've done, thanks a lot, I really appreciate.
> >
> > Thanks,
> > Yingqi
> >
> > On 7/24/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:
> >> Hmmm. cant say that I do... However it sounds like you are trying to
> >> generate classes from the wfs 1.1 schema? I should let you know that I
> >> have done so successfully in GeoServer... and the result is available
> >> via two GeoServer modules. The classes were generated with emf. If you
> >> want more info about how to get yours hands on them just let me know.
> >>
> >> -Justin
> >>
> >> Yingqi Tang wrote:
> >> > Justin,
> >> >
> >> > Do you know how to solve the same problem for "mvn jaxb2:xjc"?
> >> >
> >> > Thanks
> >> >
> >> > On 7/24/07, Yingqi Tang <anakintang@anonymised.com> wrote:
> >> >> Thanks a lot!
> >> >>
> >> >> I actually tried and that successfully works around the problem
> >> >>
> >> >> On 7/24/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:
> >> >>> Hi
> >> >>>
> >> >>> Nope you didnt' miss anything... This is a problem with xml schema in
> >> >>> general... usually parsers arent able to resolve schema location
> >> >>> references directly because they don't exist. Luckily there are some
> >> >>> plugin configuration parameters which can help.
> >> >>>
> >> >>> What you need to do is download the ows schema somewhere to your hard
> >> >>> disk. It is available from schemas.opengis.net in case you dont
> >> already
> >> >>> know.
> >> >>>
> >> >>> Then specify the following in the plugin configuration:
> >> >>>
> >> >>> <configuration>
> >> >>> ...
> >> >>> <schemaLookupDirectories>
> >> >>> <schemaLookupDirectory>[directory with
> >> ows.xsd]</schemaLookupDirectory>
> >> >>>
> >> >>> </schemaLookupDirectories>
> >> >>> ...
> >> >>>
> >> >>> </configuration>
> >> >>>
> >> >>> The full reference of plugin configuration parameters is located
> >> here:
> >> >>>
> >> http://docs.codehaus.org/display/GEOTDOC/1+Configuration+Parameter+Reference

> >>
> >> >>>
> >> >>> There are some other parameters which can probably help. Give that
> >> a try
> >> >>> and let me know how it goes.
> >> >>>
> >> >>> Also... if we could keep these discussion on the public mailing list
> >> >>> (gt-devel) that would be good. Thanks.
> >> >>>
> >> >>> -Justin
> >> >>>
> >> >>> Yingqi Tang wrote:
> >> >>>> Justin,
> >> >>>>
> >> >>>> I was trying to follow the XML development guide to create
> >> binding for
> >> >>>> a schema. The first schema I throw in is wfs.xsd for WFS 1.1.0.
> >> >>>>
> >> >>>> It seems the path of wfs.xsd can be resolved, but there is relative
> >> >>>> path in wfs.xsd itself like "../../ows/1.0.0/owsAll.xsd", which
> >> causes
> >> >>>> the problem and exception popup saying "Can not resolve schema
> >> >>>> location..."
> >> >>>>
> >> >>>> Did I miss something?
> >> >>>>
> >> >>>> Here is the plugin configuration:
> >> >>>>
> >> >>>> <plugin>
> >> >>>> <groupId>org.geotools.maven</groupId>
> >> >>>> <artifactId>gt2-xmlcodegen</artifactId>
> >> >>>> <version>2.4-SNAPSHOT</version>
> >> >>>> <configuration>
> >> >>>>
> >> >>>> <schemaLocation>\src\main\xsd\wfs\1.1.0\wfs.xsd</schemaLocation>
> >> >>>>
> >> <destinationPackage>org.geotools.experiment.wfs2</destinationPackage>
> >> >>>> <!--
> >> >>>> <constructorArguments>
> >> >>>> <constructorArgument>
> >> >>>> <name>factory</name>
> >> >>>>
> >> <type>org.geotools.po.ObjectFactory</type>
> >> >>>> </constructorArgument>
> >> >>>> </constructorArguments>
> >> >>>> -->
> >> >>>> </configuration>
> >> >>>> </plugin>
> >> >>>>
> >> >>>> Thanks
> >> >>>>
> >> >>>
> >> >>> --
> >> >>> Justin Deoliveira
> >> >>> The Open Planning Project
> >> >>> http://topp.openplans.org
> >> >>>
> >> >
> >> -------------------------------------------------------------------------
> >> > This SF.net email is sponsored by: Splunk Inc.
> >> > Still grepping through log files to find problems? Stop.
> >> > Now Search log events and configuration files using AJAX and a browser.
> >> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> >> > _______________________________________________
> >> > Geotools-gt2-users mailing list
> >> > Geotools-gt2-users@lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >> >
> >> > >
> >>
> >> --
> >> Justin Deoliveira
> >> The Open Planning Project
> >> http://topp.openplans.org
> >>
> >
> > > >
>
> --
> Justin Deoliveira
> The Open Planning Project
> http://topp.openplans.org
>

!DSPAM:4007,46a8be3910526491211187!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org