结合使用GeoTools和GWT,在开发模式下运行我的应用程序时,我得到了以下堆栈跟踪:
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)这个seems to be a Jetty thing,因为当我部署到另一个容器时,它工作得很好。有什么办法解决这个问题吗?
发布于 2011-04-27 17:10:59
看起来这是Jetty中的类加载问题。发现了this GeoTools issue和this GWT patch,这两个似乎都解决了这个问题,但目前似乎都没有得到关注。GeoMajas用a ServletFilter to hijack Jetty's classloader解决了这个问题:我最终采用了同样的方法,并取得了成效。
https://stackoverflow.com/questions/5801424
复制相似问题