GeoTools with GWT (Development Mode Jetty)



使用带有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的事情,因为它工作得很好,当我部署到另一个容器。对如何解决这个问题有什么想法吗?

看起来这是Jetty中类加载的问题。发现了这个GeoTools问题和这个GWT补丁,它们似乎都解决了这个问题,但目前似乎都没有引起注意。GeoMajas用ServletFilter来劫持Jetty的类加载器来解决这个问题:我最终采用了相同的方法,效果很好。

最新更新