2

使用带有 GWT 的GeoTools,在开发模式下运行我的应用程序时,我得到以下堆栈跟踪:

WARNING: Can't load a service for category "CRSAuthorityFactory". Cause is "ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory: Provider org (...) lang.ClassCastException: class org.geotools.referencing.operation.DefaultMathTransformFactory".
sun.misc.ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory: Provider org.geotools.referencing.factory.epsg.DefaultFactory could not be instantiated: java.lang.ClassCastException: class org.geotools.referencing.operation.DefaultMathTransformFactory
    at sun.misc.Service.fail(Unknown Source)
    at sun.misc.Service.access$200(Unknown Source)
    at sun.misc.Service$LazyIterator.next(Unknown Source)
    at org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:829)
    at org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:773)
    at org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:808)
    at org.geotools.factory.FactoryRegistry.getUnfilteredProviders(FactoryRegistry.java:229)
    at org.geotools.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:429)
    at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:364)
    at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:143)
    at org.geotools.referencing.ReferencingFactoryFinder.getAuthorityFactory(ReferencingFactoryFinder.java:216)
    at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactory(ReferencingFactoryFinder.java:436)

似乎是 Jetty 的事情,因为当我部署到另一个容器时它工作正常。有想法该怎么解决这个吗?

4

1 回答 1

2

看起来这是 Jetty 中的类加载问题。发现了这个 GeoTools issue这个 GWT patch,两者似乎都解决了这个问题,但目前似乎都没有引起注意。GeoMajas使用ServletFilter 来劫持 Jetty 的类加载器解决了这个问题:我最终采用了同样的方法,它奏效了。

于 2011-04-27T09:10:58.870 回答