Hi Andrea,
I've checked the classpath and I don't have any of the database jars there, I
don't think that's the problem, I also don't think it's specific to EJB3.
The class that seems to be causing the trouble is
org.geotools.referencing.factory.epsg.DefaultFactory which is in the standard
referencing module jar, and is registered as a service by that jar.
DefaultFactory inherits from ThreadedEpsgFactory, and what seems to be
happening is that it attempts to connect to a database when isAvailable is
called as part of the factory service discovery process - this in turn causes a
JNDI lookup (in createBackingStore). The JNDI lookup takes a considerable
amount of time - especially if there's no JNDI registry around because then my
app sits and waits for a network timeout before continuing.
The result is that every time my app does a factory lookup there's an enormous
stall while it goes through all this JNDI stuff and eventually spews a load of
exception logging before carrying on.
• The only solution that seem to work for me is to make a custom version of the
referencing module with references to the DefaultFactory and the
LongitudeFirstFactory classes removed from the service declarations
(LongitudeFirstFactory also has the same behaviour, and when I remove
DefaultFactory I just get the same problem with that). This solution seems to
work - the long stalls and JNDI exceptions go away, and my app still runs, so I
presume that it's successfully falling back on the WKT module.
This behaviour seems like a bug to me (it certainly doesn't seem to behave as
described in the documentation), but I can't understand why nobody else seems
to be having this problem....
josh
Here's my classpath :
/Applications/NetBeans/NetBeans
6.8.app/Contents/Resources/NetBeans/java3/ant/lib/ant.jar
/Applications/NetBeans/NetBeans
6.8.app/Contents/Resources/NetBeans/java3/ant/lib/ant-junit.jar
/Users/josh/NetbeansProjects/Skyj2ee/Colours/dist/Colours.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/jai-1_1_3/lib/jai_codec.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/jai-1_1_3/lib/jai_core.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-io-1.4/commons-io-1.4.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-net-2.0/commons-net-2.0.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-net-2.0/commons-net-ftp-2.0.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-collections-3.2.1/commons-collections-3.2.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-api-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-main-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-coverage-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-render-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/jsr-275-1.0-beta-2.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/geoapi-pending-2.3-M1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-metadata-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-referencing-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/jts-1.10.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/slf4j-1.5.10/slf4j-api-1.5.10.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/slf4j-1.5.10/slf4j-jdk14-1.5.10.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/netcdf/netcdfAll-4-1/jdom.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/netcdf/netcdfAll-4-1/netcdf-4.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-lang-2.4/commons-lang-2.4.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-httpclient-3.1/commons-httpclient-3.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/commons-configuration-1.6/commons-configuration-1.6.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/vecmath/vecmath.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geoapi/geoapi-2.3-M1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geoapi/geoapi-pending-2.3-M1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-geotiff-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/imageio-ext-tiff-1.0.5.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/imageio-ext-utilities-1.0.5.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-swing-2.6.1.jar
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/geotools/gt-epsg-wkt-2.6.1.jar
[.netbeans_automatic_build, .netbeans_update_resources, Colours.jar, META-INF,
org]
/Users/josh/NetbeansProjects/Skyj2ee/NetbeansLibs/junit_4/junit-4.5.jar
[org]
/Applications/NetBeans/sges-v3/glassfish/lib/embedded/glassfish-embedded-static-shell.jar
On 18 Feb 2010, at 18:29, Andrea Aime wrote:
> Joshua Portway ha scritto:
>> I'm still getting a lot of hassle because the referencing module
>> seems to insist on doing a JNDI lookup for "jdbc/EPSG" even though I
>> only have the WKT jar in my classpath (at least as far as I can
>> tell). Is this normal? Is there a way to stop it (other than
>> presumably creating an actual EPSG database or something)?
>> Here's the stack trace I get when the lookup fails :
>> org.opengis.referencing.FactoryException: Failed to connect to the
>> EPSG database. at
>> org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:430)
>> at
>
> Please double check your classpath one more time.
> ThreadedEpsgFactory is a base class for database based factories, this
> suggests you have gt-epsg-h2, gt-epsg-hsql or some other database backed
> factory.
>
> The factory contained in the WKT module (EPSGCRSAuthorityFactory) does
> not have ThreadedEpsgFactory as its base class.
>
> I'm also wondering why you get timeout issues... we build GeoTools
> and projects based on it hourly and we don't see such issues.
> But then again, none of them is using EJB3 (GeoServer is the only
> J2EE one and uses Spring instead).
>
> Cheers
> Andrea
>
>
> --
> Andrea Aime
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
------------------------------------------------------------------------------
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