If you bind your DataSource to the JNDI tree (which is read/write), it should work. A better solution woudl be to use the JNDI osgi:xxx url to grab the DataSource if it was registered as an OSGi service.
On Tue, Sep 1, 2009 at 17:12, Ryan Moquin <[email protected]> wrote: > Actually I think what this issue is related to is that an > org.apache.servicemix.naming.OSGIContext is being returned for the > initialcontext and I'm guess that the needed jndi datasource can't be > dynamically bound and retrieved as a result... I'll have to see if I can > override this behavior so it doesn't use JNDI since I think it won't be > compatible.. > > On Sun, Aug 30, 2009 at 3:24 PM, Ryan Moquin <[email protected]> > wrote: > > > One more problem in migrating to Servicemix 4.0. I'm using geotools to > do > > look ups on coordinate reference EPSG numbers. When geotools runs, it > will > > create an hsql database on the fly for looking up EPSG values. This > worked > > fine on Fuse ESB 3.x (with no additional work, other than making sure the > > jar is in the classpath), but it doesn't work on Servicemix 4.0. Is > there > > no temporary work area that can be used for creating a temporary file > such > > as an HSQL database? > > > > Here is the exception I receive, in case it helps with any suggestions. > > Thanks!! > > > > 15:08:52,500 | WARN | atasource loader | factory > > | ? ? | 34 > > org.opengis.referencing.FactoryException: Failed to connect to the EPSG > > database. > > at > > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:428) > > at > > > org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:132) > > at > > > org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:233) > > at > > > org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:119) > > at > > > org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:668) > > at > > > org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:500) > > at > > org.geotools.factory.FactoryRegistry$1.filter(FactoryRegistry.java:191) > > at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:793) > > at javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:787) > > at > > > javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:491) > > at > > > org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:196) > > at > > > org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:176) > > at > > > org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:451) > > 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:182) > > at org.geotools.referencing.CRS.decode(CRS.java:420) > > at org.geotools.referencing.CRS.decode(CRS.java:348) > > at com.bae.gse.gis.util.GISConstants.createCRS(GISConstants.java:34) > > at > > > com.bae.gse.arcgis.rest.conversion.JSONConversionHelper.loadCrs(JSONConversionHelper.java:85) > > at > > > com.bae.gse.arcgis.rest.discovery.ArcGISRestLoader.loadMapService(ArcGISRestLoader.java:178) > > at > > > com.bae.gse.arcgis.rest.discovery.ArcGISRestLoader.loadService(ArcGISRestLoader.java:55) > > at > > > com.bae.gse.arcgis.rest.response.ServiceDescriptionResponse.loadResponse(ServiceDescriptionResponse.java:26) > > at > > com.bae.gse.arcgis.rest.response.RestResponse.load(RestResponse.java:43) > > at > > > com.bae.gse.arcgis.rest.response.ServiceDescriptionResponse.<init>(ServiceDescriptionResponse.java:21) > > at > > > com.bae.gse.arcgis.rest.request.ServiceDirectoryRequest.load(ServiceDirectoryRequest.java:42) > > at > > > com.bae.gse.arcgis.rest.discovery.ArcGISDiscovery.loadService(ArcGISDiscovery.java:83) > > at > > > com.bae.gse.arcgis.rest.discovery.ArcGISDiscovery.loadFolder(ArcGISDiscovery.java:68) > > at > > > com.bae.gse.arcgis.rest.discovery.ArcGISDiscovery.loadRootFolder(ArcGISDiscovery.java:45) > > at > > > com.bae.gse.arcgis.rest.discovery.ArcGISDiscovery.load(ArcGISDiscovery.java:35) > > at > > > com.bae.gse.salina.components.geospatial.ArcGISMetadataLoaderTask.loadMetadata(ArcGISMetadataLoaderTask.java:75) > > at > > > com.bae.gse.salina.components.geospatial.MetadataLoaderTask.run(MetadataLoaderTask.java:34) > > at java.util.TimerThread.mainLoop(Timer.java:512) > > at java.util.TimerThread.run(Timer.java:462) > > Caused by: java.sql.SQLException: Failed to get the data source for name > > "jdbc/EPSG". > > at > > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createDataSource(ThreadedEpsgFactory.java:306) > > at > > > org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory.createDataSource(ThreadedHsqlEpsgFactory.java:200) > > at > > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore0(ThreadedEpsgFactory.java:373) > > at > > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:421) > > ... 33 more > > Caused by: javax.naming.NotContextException: jdbc/EPSG > > at > > > org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:171) > > at > > > org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:611) > > at javax.naming.InitialContext.lookup(InitialContext.java:392) > > at javax.naming.InitialContext.lookup(InitialContext.java:392) > > at > > > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createDataSource(ThreadedEpsgFactory.java:299) > > ... 36 more > > > > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com
