WFS GetFeatureType crashes on MacOS X
-------------------------------------

                 Key: GEOT-1548
                 URL: http://jira.codehaus.org/browse/GEOT-1548
             Project: GeoTools
          Issue Type: Bug
          Components: data wfs
    Affects Versions: 2.4-RC0
         Environment: MacOS X - Darwin Kernel Version 8.10.1
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
gt2-2.4.x r27495
            Reporter: Jean-Pierre Fiset
            Assignee: David Zwiers


When using GeoTools on a MacOS X platform (affects 2.4.x stream, not 2.3.x), a 
crash occurs when performing "org.geotools.data.wfs.WFSDataStore.getSchema()". 

The bottom line is that the version of Java2 SDK shipped with Mac (built by 
Apple) does not contain the JDBC-ODBC bridge. This fact can be verified by a 
large body of documentation available through your nearest search engine.

During factory registry initialization, all plugins are loaded. This happens on 
the first call to getSchema(). When the epsg-access plugin is loaded, an 
instance of org.geotools.referencing.factory.epsg.AccessDataSource is created, 
which is dependent on sun.jdbc.odbc.ee.DataSource. The most assiduous readers 
will conclude that, on a Mac, this situation will generate an exception. Here 
is what this exception looks like:

java.lang.NoClassDefFoundError: sun/jdbc/odbc/ee/DataSource
        
org.geotools.referencing.factory.epsg.FactoryOnAccess.createDataSource(FactoryOnAccess.java:71)
        
org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore0(ThreadedEpsgFactory.java:384)
        
org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:476)
        
org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:138)
        
org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:232)
        
org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:126)
        
org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:663)
        
org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:491)
        
org.geotools.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:425)
        
org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:354)
        
org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:115)
        
org.geotools.referencing.ReferencingFactoryFinder.getAuthorityFactory(ReferencingFactoryFinder.java:229)
        
org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactory(ReferencingFactoryFinder.java:450)
        
org.geotools.referencing.factory.epsg.LongitudeFirstFactory.createBackingStore(LongitudeFirstFactory.java:188)
        
org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:138)
        
org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:232)
        
org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:126)
        
org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:663)
        
org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:491)
        org.geotools.factory.FactoryRegistry$1.filter(FactoryRegistry.java:168)
        javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:793)
        javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:787)
        
javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:491)
        
org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:175)
        
org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:187)
        
org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:465)
        
org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:57)
        org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:188)
        org.geotools.referencing.CRS.decode(CRS.java:416)
        org.geotools.referencing.CRS.decode(CRS.java:350)
        org.geotools.data.wfs.WFSDataStore.getSchema(WFSDataStore.java:405)
        
ca.carleton.gcrc.nunaliit.server.easyOgc.springmvc.views.WfsFeatureTypeView.printBody(WfsFeatureTypeView.java:46)
        
ca.carleton.gcrc.nunaliit.server.easyOgc.springmvc.views.AbstractHtmlView.render(AbstractHtmlView.java:35)
        
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1103)
        
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:840)
        
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
        
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
        
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:354)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


A work-around is to delete the file gt2-epsg-access-2.4.jar from the 
distribution. Obviously, this work around does not apply to those expecting to 
retrieve EPSG data from access databases on other platforms.

The solution will be to catch said exception somewhere in the stack shown above 
and disregard it. However, the submitter's confidence on the affected code is 
not high enough at this point to suggest a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to