You may wish to take this discussion to the geotools-devel list (or at least 
off the udig-users list as it does not have anything to do with using uDig). 
I recommend going through the GeoTools tutorials prior to asking questions in 
order to account for most common configuration issues.

-- 
Jody Garnett


On Thursday, 3 November 2011 at 10:51 PM, Alberto Debiasi wrote:

> I removed the gt-epsg-postgres jar. Now I have the following exceptions:
> 
> 3-nov-2011 13.48.55 org.geotools.referencing.factory.PropertyAuthorityFactory 
> <init>
> AVVERTENZA: Axis elements found in a wkt definition, the force longitude 
> first axis order hint might not be respected:
> PROJCS["Google Projection",GEOGCS["WGS 84",DATUM["World Geodetic System 
> 1984",SPHEROID["WGS 84", 6378137.0, 298.257223563, 
> AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich", 0.0, 
> AUTHORITY["EPSG","8901"]],UNIT["degree", 0.017453292519943295],AXIS["Geodetic 
> longitude", EAST],AXIS["Geodetic latitude", 
> NORTH],AUTHORITY["EPSG","4326"]],PROJECTION["Popular Visualisation Pseudo 
> Mercator", AUTHORITY["EPSG","1024"]],PARAMETER["semi_minor", 
> 6378137.0],PARAMETER["latitude_of_origin", 0.0],PARAMETER["central_meridian", 
> 0.0],PARAMETER["scale_factor", 1.0],PARAMETER["false_easting", 
> 0.0],PARAMETER["false_northing", 0.0],UNIT["m", 1.0]]
> java.lang.RuntimeException: Parsing failed for Point: 
> java.lang.AbstractMethodError: 
> org.geotools.referencing.factory.GeotoolsFactory.createCoordinateSystemAxis(Ljava/util/Map;Ljava/lang/String;Lorg/opengis/referencing/cs/AxisDirection;Ljavax/measure/unit/Unit;)Lorg/opengis/referencing/cs/CoordinateSystemAxis;
>     at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:164)
>     at 
> org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:220)
>     at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:186)
>     at 
> org.geotools.xml.impl.ElementHandlerImpl.endElement(ElementHandlerImpl.java:233)
>     at org.geotools.xml.impl.ParserHandler.endElement(ParserHandler.java:628)
>     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>     at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown 
> Source)
>     at org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
> Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>  Source)
>     at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
> Source)
>     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>     at org.geotools.xml.Parser.parse(Parser.java:238)
>     at org.geotools.xml.Parser.parse(Parser.java:166)
>     at testGML.mainAPP2.main(mainAPP2.java:28)
> Caused by: java.lang.AbstractMethodError: 
> org.geotools.referencing.factory.GeotoolsFactory.createCoordinateSystemAxis(Ljava/util/Map;Ljava/lang/String;Lorg/opengis/referencing/cs/AxisDirection;Ljavax/measure/unit/Unit;)Lorg/opengis/referencing/cs/CoordinateSystemAxis;
>     at 
> org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateSystemAxis(DirectEpsgFactory.java:1699)
>     at 
> org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateSystemAxis(BufferedAuthorityFactory.java:741)
>     at 
> org.geotools.referencing.factory.epsg.DirectEpsgFactory.createAxesForCoordinateSystem(DirectEpsgFactory.java:1745)
>     at 
> org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateSystem(DirectEpsgFactory.java:1791)
>     at 
> org.geotools.referencing.factory.AbstractAuthorityFactory.createEllipsoidalCS(AbstractAuthorityFactory.java:465)
>     at 
> org.geotools.referencing.factory.BufferedAuthorityFactory.createEllipsoidalCS(BufferedAuthorityFactory.java:678)
>     at 
> org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:1920)
>     at 
> org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateReferenceSystem(BufferedAuthorityFactory.java:783)
>     at 
> org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:800)
>     at 
> org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:640)
>     at 
> org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:800)
>     at 
> org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:731)
>     at 
> org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:179)
>     at org.geotools.referencing.CRS.decode(CRS.java:489)
>     at org.geotools.referencing.CRS.decode(CRS.java:417)
>     at 
> org.geotools.gml2.bindings.GML2ParsingUtils.crs(GML2ParsingUtils.java:332)
>     at 
> org.geotools.gml3.bindings.GML3ParsingUtils.crs(GML3ParsingUtils.java:90)
>     at 
> org.geotools.gml3.bindings.AbstractGeometryTypeBinding.parse(AbstractGeometryTypeBinding.java:96)
>     at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:155)
>     ... 17 more
> 
> I tried also with others local GML files, but the error is the same.
> 
> Alberto
> 
> 
> 2011/11/3 Jody Garnett <[email protected] 
> (mailto:[email protected])>
> > I think your project is not configured correctly; you need to be sure to 
> > include only one epsg jar.  
> > 
> > See the following page:
> > - http://docs.geotools.org/latest/userguide/library/referencing/index.html
> > 
> > A recommendation on that page is gt-epsg-hsql which is a pure java 
> > database.  It looks like you had the gt-epsg-postgres jar in there (which 
> > assumes you have configured a PostgreSQL database with the EPSG database 
> > prior to you calling your application). 
> > -- 
> > Jody Garnett
> > 
> > 
> > On Thursday, 3 November 2011 at 3:13 AM, Alberto Debiasi wrote:
> > 
> > 
> > 
> > > Hi everybody.
> > > 
> > > I tried to open a GML local file (I tried with different GML local files 
> > > ) using GeoTools (the same used in Udig) with this code:
> > > 
> > > 
> > > public static void main(String[] args) {
> > >     try{
> > >     //create the parser with the gml 3.0 configuration
> > >     org.geotools.xml.Configuration configuration = new 
> > > org.geotools.gml3.GMLConfiguration();
> > >     org.geotools.xml.Parser parser = new org.geotools.xml.Parser( 
> > > configuration );
> > > 
> > >     //the xml instance document above
> > >    InputStream xml = new FileInputStream("result2.gml");
> > > 
> > >      SimpleFeatureCollection fc = (SimpleFeatureCollection) parser.parse( 
> > > xml );
> > >       MapContext map = new DefaultMapContext();
> > >       map.setTitle("Quickstart");
> > >       map.addLayer(fc, null);
> > > 
> > >       // Now display the map
> > >       JMapFrame.showMap(map);
> > >     }catch(Exception e){
> > >         e.printStackTrace();
> > >     }
> > > }}
> > > 
> > > but it returns these exceptions:
> > > 
> > > 
> > > 2-nov-2011 18.08.28 
> > > org.geotools.referencing.factory.epsg.ThreadedPostgreSQLEpsgFactory 
> > > isAvailable
> > > AVVERTENZA: Unavailable authority factory: European Petroleum Survey Group
> > > org.opengis.referencing.FactoryException: Failed to connect to the EPSG 
> > > database.
> > >     at 
> > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:441)
> > >     at 
> > > org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:133)
> > >     at 
> > > org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:235)
> > >     at 
> > > org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:119)
> > >     at 
> > > org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:667)
> > >     at 
> > > org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:501)
> > >     at 
> > > org.geotools.factory.FactoryRegistry$1.filter(FactoryRegistry.java:192)
> > >     at javax.imageio.spi.FilterIterator.advance(Unknown Source)
> > >     at javax.imageio.spi.FilterIterator.<init>(Unknown Source)
> > >     at javax.imageio.spi.ServiceRegistry.getServiceProviders(Unknown 
> > > Source)
> > >     at 
> > > org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:197)
> > >     at 
> > > org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:178)
> > >     at 
> > > org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:453)
> > >     at 
> > > org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:88)
> > >     at 
> > > org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:69)
> > >     at org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:251)
> > >     at org.geotools.referencing.CRS.decode(CRS.java:489)
> > >     at org.geotools.referencing.CRS.decode(CRS.java:417)
> > >     at 
> > > org.geotools.gml2.bindings.GML2ParsingUtils.crs(GML2ParsingUtils.java:332)
> > >     at 
> > > org.geotools.gml3.bindings.GML3ParsingUtils.crs(GML3ParsingUtils.java:90)
> > >     at 
> > > org.geotools.gml3.bindings.AbstractGeometryTypeBinding.parse(AbstractGeometryTypeBinding.java:96)
> > >     at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:155)
> > >     at 
> > > org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:220)
> > >     at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:186)
> > >     at 
> > > org.geotools.xml.impl.ElementHandlerImpl.endElement(ElementHandlerImpl.java:233)
> > >     at 
> > > org.geotools.xml.impl.ParserHandler.endElement(ParserHandler.java:628)
> > >     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown 
> > > Source)
> > >     at 
> > > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown 
> > > Source)
> > >     at 
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > >  Source)
> > >     at 
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > >  Source)
> > >     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > >     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > >     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > >     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > >     at org.geotools.xml.Parser.parse(Parser.java:238)
> > >     at org.geotools.xml.Parser.parse(Parser.java:166)
> > >     at testGML.mainAPP2.main(mainAPP2.java:28)
> > > Caused by: org.postgresql.util.PSQLException: FATAL: password 
> > > authentication failed for user "Geotools"
> > >     at 
> > > org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
> > >     at 
> > > org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
> > >     at 
> > > org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
> > >     at 
> > > org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
> > >     at 
> > > org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
> > >     at 
> > > org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
> > >     at org.postgresql.Driver.makeConnection(Driver.java:393)
> > >     at org.postgresql.Driver.connect(Driver.java:267)
> > >     at java.sql.DriverManager.getConnection(Unknown Source)
> > >     at java.sql.DriverManager.getConnection(Unknown Source)
> > >     at 
> > > org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:87)
> > >     at 
> > > org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:70)
> > >     at 
> > > org.geotools.referencing.factory.epsg.DirectEpsgFactory.getConnection(DirectEpsgFactory.java:3174)
> > >     at 
> > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:436)
> > >     ... 36 more
> > > 
> > > Why there are problems?
> > > 
> > > Alberto
> > > _______________________________________________
> > > udig-users mailing list
> > > [email protected] (mailto:[email protected])
> > > http://lists.refractions.net/mailman/listinfo/udig-users
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> 

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to