Re: [Geotools-gt2-users] geotools from spring
GeoServer uses spring with not really any problems. If you include any error logs we can probably help. Also which servlet container are you using? -Justin Dave Rafkind wrote: Hi list, I'm trying to use just the Referencing part of Geotools 2.5.1 in a Spring Webapp, but I get all sorts of wierd errors relating to MathTransformFactory or javax.measure.unit.* when I call CRS.parseWKT(). These errors don't come about with a commandline program, I assume some resource is not properly being autodiscovered...are there any guidelines for using Geotools with Spring in a web app? Thanks! Dave -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] geotools from spring
Oh yeah, error logs. I'm using Glassfish v2 to host the webapp. Here's my code in the constructor of a bean: try { CoordinateReferenceSystem targetCRS = DefaultGeographicCRS.WGS84; CoordinateReferenceSystem sourceCRS = CRS.parseWKT(wktString); MathTransformer transformer = CRS.findMathTransform(sourceCRS, targetCRS, true); } catch (org.opengis.referencing.FactoryException fex) { fex.printStackTrace(); } After I got java.lang.ClassNotFoundException: javax.measure.unit.SI, I added the JScience jar to my project.. Error: java.lang.NoSuchMethodError: org.opengis.referencing.cs.CoordinateSystemAxis.getUnit()Ljavax/measure/unit/Unit; at org.geotools.referencing.cs.AbstractCS.init(AbstractCS.java:161) at org.geotools.referencing.cs.DefaultEllipsoidalCS.init(DefaultEllipsoidalCS.java:155) at org.geotools.referencing.cs.DefaultEllipsoidalCS.clinit(DefaultEllipsoidalCS.java:67) at org.geotools.referencing.crs.DefaultGeographicCRS.clinit(DefaultGeographicCRS.java:95) at gov.sanantonio.row.ProjectionUtil.init(ProjectionUtil.java:61) // more spring tracktrace snipped Justin Deoliveira wrote: GeoServer uses spring with not really any problems. If you include any error logs we can probably help. Also which servlet container are you using? -Justin Dave Rafkind wrote: Hi list, I'm trying to use just the Referencing part of Geotools 2.5.1 in a Spring Webapp, but I get all sorts of wierd errors relating to MathTransformFactory or javax.measure.unit.* when I call CRS.parseWKT(). These errors don't come about with a commandline program, I assume some resource is not properly being autodiscovered...are there any guidelines for using Geotools with Spring in a web app? Thanks! Dave -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] geotools from spring
That error says to me that the units library is either missing, or an incorrect version of it is being used. I would check that: 1) units library is there 2) the version being used is correct, ie the same as the version included in the geotools bin release Hope that helps, -Justin Dave Rafkind wrote: Oh yeah, error logs. I'm using Glassfish v2 to host the webapp. Here's my code in the constructor of a bean: try {CoordinateReferenceSystem targetCRS = DefaultGeographicCRS.WGS84; CoordinateReferenceSystem sourceCRS = CRS.parseWKT(wktString); MathTransformer transformer = CRS.findMathTransform(sourceCRS, targetCRS, true); } catch (org.opengis.referencing.FactoryException fex) { fex.printStackTrace(); } After I got java.lang.ClassNotFoundException: javax.measure.unit.SI, I added the JScience jar to my project.. Error: java.lang.NoSuchMethodError: org.opengis.referencing.cs.CoordinateSystemAxis.getUnit()Ljavax/measure/unit/Unit; at org.geotools.referencing.cs.AbstractCS.init(AbstractCS.java:161) at org.geotools.referencing.cs.DefaultEllipsoidalCS.init(DefaultEllipsoidalCS.java:155) at org.geotools.referencing.cs.DefaultEllipsoidalCS.clinit(DefaultEllipsoidalCS.java:67) at org.geotools.referencing.crs.DefaultGeographicCRS.clinit(DefaultGeographicCRS.java:95) at gov.sanantonio.row.ProjectionUtil.init(ProjectionUtil.java:61) // more spring tracktrace snipped Justin Deoliveira wrote: GeoServer uses spring with not really any problems. If you include any error logs we can probably help. Also which servlet container are you using? -Justin Dave Rafkind wrote: Hi list, I'm trying to use just the Referencing part of Geotools 2.5.1 in a Spring Webapp, but I get all sorts of wierd errors relating to MathTransformFactory or javax.measure.unit.* when I call CRS.parseWKT(). These errors don't come about with a commandline program, I assume some resource is not properly being autodiscovered...are there any guidelines for using Geotools with Spring in a web app? Thanks! Dave -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users