thanks again Gabriel. As the geotools code uses
ServiceRegistry.lookupProviders, which uses the thread classloader, I
am giving up trying to use WFS 1.1.0 for the time being. I can get the
classloader that would see the services from the plugin I'm using, but
I have no way of passing it around. A call like
Iterator<WFSResponseParserFactory> providers =
Service.providers(WFSResponseParserFactory.class,
getClassLoader());
works for me, but it doesn't seem to cache anything. All relevant
methods in WFSExtension are (correctly) package private, so no point
for me to intervene. If you have any suggestion on how to preload the
registry from a place where the classloader can be controlled, I'll
greatly appreciate knowing it.
One more, very ignorant question? I'm now defaulting to WFS 1.0.0 as
you suggested, but I get exceptions from the XML parser trying to
resolve the URI associated with the namespace my data are in (using
geoserver 1.7.6). E.g. if typename is global:wdpa, and 'global' is
associated to http://xxxxx, geotools tries to read the contents of
http://xxxxx as XML and dies. I don't know what the URI is supposed to
point to, and I would not think it was supposed to point to anything.
Even with strict=false, geotools tries to parse its contents as an XML
file. Can you kindly shed some light on this?
Many thanks again,
ferdinando
Quoting Gabriel Roldan <[email protected]>:
> Ferdinando Villa wrote:
>> Thank you Gabriel,
>>
>> I'm pretty sure it's a classloading problem - JPF is basically the
>> precursor of OSGI and works exactly the same. But all of geotools
>> is in a single plugin and the parser is looked up within the plugin
>> itself, so it must be either 1) a parser implementation not
>> present in 2.5.7, or 2) me not exposing the appropriate jars in
>> the plugin manifest and exporting classes so that they can be
>> found dynamically. I am loading and exporting all I could find
>> with no success, but it would help a lot to know which jars, if
>> any, contain a usable implementation, and whether I need to switch
>> to 2.6...
> ah ok, actually the extensibility mechanism is there but the only
> usable implementation is inside the gt-wfs jar itself, class
> org.geotools.data.wfs.v1_1_0.parsers.Gml31GetFeatureResponseParserFactory
> which is referred by the file
> META-INF/services/org.geotools.data.wfs.protocol.wfs.WFSResponseParserFactory
>
> So as long as both the package and the resource under META-INF/services
> are accessible it should work.
>
> Aside, if you're looking for transaction support you'll need to stick
> to WFS 1.0 anyways, transaction support for 1.1 is not there yet. But
> if read-only try going for 1.1 as it's better supported and faster.
>
> Cheers,
> Gabriel
>
>>
>> Thanks much,
>> ferdinando
>>
>> Quoting Gabriel Roldan <[email protected]>:
>>
>>> Hi Ferdinando,
>>>
>>> if you're using the WFSDataStore inside an OSGI environment, it may be
>>> a classloader problem.
>>> uDig has the same problem with eclipse's RCP, and the solution is to
>>> bundle all the dependencies together as a plugin
>>> (net.refractions.udig.libs plugin).
>>>
>>> This is so because the WFSDataStore uses a SPI (Service Provider
>>> Interface) mechanism to dynamically find a parser for a given request
>>> response, just as GeoTools does to find the DataStore implementations,
>>> etc.
>>>
>>> May that be the problem? I don't know about JPF but it looks like.
>>>
>>> Cheers,
>>> Gabriel
>>>
>>> Ferdinando Villa wrote:
>>>> Hi all,
>>>>
>>>> I've been desperate a couple days with this exception:
>>>>
>>>> Can't find a response parser factory for
>>>> net.opengis.wfs.impl.getfeaturetypei...@8a88a9 (handle: GeoTools
>>>> 2.5.7 WFS DataStore, service: WFS, version:
>>>>
>>>> I'm trying to read features from WFS, going pretty much by the
>>>> book. getFeatures() works, this is thrown when I create a
>>>> feature iterator. It's 2.5.7 and I'm working in a JPF/OSGI
>>>> context, so I may not be including all jars properly, but I'm
>>>> pretty much at the end of my wit now (I thought gt-gmlparsing
>>>> would have fixed it but no).
>>>>
>>>> Any advice? Thanks so much for any help,
>>>>
>>>> ferdinando
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Come build with us! The BlackBerry® Developer Conference in SF,
>>>> CA
>>>> is the only developer event you need to attend this year. Jumpstart your
>>>> developing skills, take BlackBerry mobile applications to market
>>>> and stay ahead of the curve. Join us from November 9-12,
>>>> 2009. Register now!
>>>> http://p.sf.net/sfu/devconf
>>>> _______________________________________________
>>>> Geotools-gt2-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>>
>>> --
>>> Gabriel Roldan
>>> OpenGeo - http://opengeo.org
>>> Expert service straight from the developers.
>>
>>
>>
>
>
> --
> Gabriel Roldan
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users