gml parsing problems

2 messages Options
Embed this post
Permalink
niels hoffmann-2

gml parsing problems

Reply Threaded More More options
Print post
Permalink
List,
 
I'm trying to parse a gml document. The problem I have is that the code works in a standalone Desktop test App but not in the WPS code (servlet) where I actually need it.
 
org.geotools.xml.Configuration configuration = new org.geotools.gml3.GMLConfiguration();
org.geotools.xml.Parser parser = new org.geotools.xml.Parser( configuration );
FileInputStream xml = null;
try{
      xml = new FileInputStream(new File(uri.getPath()));
}catch(FileNotFoundException fe){  }
 
try{
      FeatureCollection fc = (FeatureCollection) parser.parse( xml );
 

It seems to be a toss up between the following exceptions:
 
<ns:ExceptionText>Parsing failed for simple_waiheke: java.lang.NoClassDefFoundError: Could not initialize class org.geotools.feature.type.BasicFeatureTypes</ns:ExceptionText><ns:ExceptionText>org.geotools.xml.impl.ParseExecutor.visit:158
 
<ns:ExceptionText>Parsing failed for simple_waiheke: java.lang.NoSuchMethodError: org.opengis.feature.simple.SimpleFeatureType.getAttributeDescriptors()Ljava/util/List;</ns:ExceptionText><ns:ExceptionText>org.geotools.xml.impl.ParseExecutor.visit:158
 
Does anybody have an idea what could be the cause?
I'm using GT 2.6.0 and maven.
 
Cheers, Niels

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Ben Caradoc-Davies

Re: gml parsing problems

Reply Threaded More More options
Print post
Permalink
On 13/11/09 10:47, niels hoffmann wrote:
> <ns:ExceptionText>Parsing failed for simple_waiheke: java.lang.NoClassDefFoundError: Could not initialize class org.geotools.feature.type.BasicFeatureTypes</ns:ExceptionText><ns:ExceptionText>org.geotools.xml.impl.ParseExecutor.visit:158

This class in in gt-main, which is drawn in as a transitive dependency
is you use gt-xsd-core or gt-xsd-gml3.

> Does anybody have an idea what could be the cause?
> I'm using GT 2.6.0 and maven.

Does your maven pom declare gt-xsd-core or gt-xsd-gml3 as a dependency?
This should result in gt-main being on the classpath.

Is it possible you deployment package does not have gt-main? Or the
classpath is not being set? Are you using maven-assembly-plugin? Or are
you running it in Eclipse?

Kind regards,

--
Ben Caradoc-Davies <[hidden email]>
Software Engineer, CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users