It seems to me that the problem is that Geotools seems to be instantiating DefaultFactory even when the WKT authority is available, and DefaultFactory attempts to create a backing store when it's instantiated. This attempts to connect to a database in the createBackingStore method called by isAvailable() - I'd be very surprised if your code was doing anything differently - maybe it's just failing silently instead of logging exceptions?
My understanding of the documentation is that the referencing module is supposed to look for authority services from one of the epsg jars, and use that. What seems to be happening is that *as well* as using the provided WKT jar it's also trying to instantiate the DefaultFactory service (since this is registered as a service in the referencing module itself). I haven't gone into enough detail to find out exactly what function DefaultFactory serves, but it looks to me as if it's simply providing an epsg service by looking for a JDBC database with the information in it. That's probably very useful, but it doesn't sound to me as if it should be the default fallback (especially since it relies on external resources). I can't see why it wouldn't be better if it was factored out into its own jar just like the WKT and hsql providers are? Presumably it would be called something like "epsg-jdbc" ? If it is going to be the default, then the behaviour should be documented because the current behaviour seems to go against the "add a single epsg provider jar" idea. At least - I find it confusing. J On 22 Feb 2010, at 16:22, Andrea Aime wrote: > Joshua Portway wrote: >> http://docs.codehaus.org/display/GEOT/1+Contributors > >> I think glassfish has a tiny "embedded" server that implements a >> minimal environment for testing in that gets instantiated by default >> when you run unit tests in Netbeans (I'm not sure of the internals). >> Hence there probably is JNDI available when I'm testing. >> But these problems weren't limited to unit tests -I was getting them >> when deploying to the full server too. Perhaps you aren't getting >> them in the server because you actually *are* using a database >> registered with JNDI? > > No, we don't actually use JNDI in any server deployment I'm managing. > I tried deploying GeoServer (which uses GeoTools) in Glassfish > some time ago and I did not have timeouts either. > > Would it be possible to modify the JNDI lookups so that they > time out quickly? Not sure, I don't know much about JNDI and > never put a EPSG factory in JNDI anyways. > > Cheers > Andrea > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
