[geotk] Can I prevent Geotoolkit from spawning new threads?

Jon Blower j.d.blower at reading.ac.uk
Tue Oct 13 16:10:27 EDT 2009


I've been experimenting with running Geotoolkit as part of a Google
App Engine application.  I have just discovered that GAE does not
allow applications to spawn new threads.  Unfortunately Geotoolkit
does this when calling CRS.getSupportedCodes() or CRS.decode().  The
creation of a ShutdownHook causes a security exception in GAE:

	at org.geotoolkit.factory.ShutdownHook.(ShutdownHook.java:55)
	at org.geotoolkit.factory.ShutdownHook.(ShutdownHook.java:41)
	at org.geotoolkit.factory.FactoryFinder.getServiceRegistry(FactoryFinder.java:198)
	at org.geotoolkit.factory.FactoryFinder.getFactories(FactoryFinder.java:216)
	at org.geotoolkit.factory.AuthorityFactoryFinder.getCRSAuthorityFactories(AuthorityFactoryFinder.java:264)
	at org.geotoolkit.referencing.DefaultAuthorityFactory.create(DefaultAuthorityFactory.java:92)
	at org.geotoolkit.referencing.CRS.getAuthorityFactory(CRS.java:219)
	at org.geotoolkit.referencing.CRS.decode(CRS.java:410)
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
	at java.security.AccessController.checkPermission(AccessController.java:546)

I imagine that this might be hard, but is there any way of using Gtk
in such a way as that it does not spawn new threads?  By the way, it
seems to spawn threads even when using a "databaseless" CRS database,
i.e. with a static epsg.properties file.


Dr Jon Blower
Technical Director, Reading e-Science Centre
Environmental Systems Science Centre
University of Reading
Harry Pitt Building, 3 Earley Gate
Reading RG6 6AL. UK
Tel: +44 (0)118 378 5213
Fax: +44 (0)118 378 6413
j.d.blower at reading.ac.uk

More information about the Geotoolkit mailing list