geoserver2.14+;在Glassfish4+;上失败有人成功了吗?

geoserver2.14+;在Glassfish4+;上失败有人成功了吗?,glassfish,geoserver,Glassfish,Geoserver,在硬件迁移过程中,我认为在Glassfish 4.0上将Geoserver从2.13.0升级到2.14.2是明智的,希望能够治愈片状缺陷 JVM配置为使用JVM参数使用非标准数据目录: -DGEOSERVER_DATA_DIR=/geoserver 使用从Geoserver.org下载的.war,部署失败 2.15.x表现出相同的故障 2.13.0部署和运行,尽管有一些片状(登录后geoserver主页上显示的类似堆栈轨迹) 该问题与平台无关,使用的环境为: 在Glassfish 4或Glas

在硬件迁移过程中,我认为在Glassfish 4.0上将Geoserver从2.13.0升级到2.14.2是明智的,希望能够治愈片状缺陷

JVM配置为使用JVM参数使用非标准数据目录: -DGEOSERVER_DATA_DIR=/geoserver

使用从Geoserver.org下载的.war,部署失败

2.15.x表现出相同的故障 2.13.0部署和运行,尽管有一些片状(登录后geoserver主页上显示的类似堆栈轨迹)


该问题与平台无关,使用的环境为:

在Glassfish 4或Glassfish 5上运行Oracle Java 1.8.0161的Windows 10 X64(包括Glassfish的全新开箱即用安装)

CentOS 7在Glassfish 4上运行OpenJDK 1.8.0Þ222

WAR确实部署在TomCat的本地主机(W10)安装上,尽管没有自定义数据目录集

如果最新的GeoServer构建可以在Glassfish 4上运行,这将节省大量的时间和费用

有什么建议吗

Severe:   Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcFacade' defined in URL [jar:file:/E:/glassfish-4.0/glassfish/domains/domain1/applications/geoserver/WEB-INF/lib/gs-gwc-2.14.5.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.gwc.GWC]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396)
    at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
    at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)
    at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:165)
    at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    at java.lang.Thread.run(Thread.java:748)

Severe:   Exception while loading the app
Severe:   Undeployment failed for context /geoserver
Warning:   The web application [/geoserver] registered the JDBC driver [org.h2.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Severe:   The web application [/geoserver] created a ThreadLocal with key of type [java.lang.ThreadLocal.SuppliedThreadLocal] (value [java.lang.ThreadLocal$SuppliedThreadLocal@e524836]) and a value of type [org.geowebcache.storage.CompositeBlobStore.StoreSuitabilityCheck] (value [EXISTING]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Severe:   Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcFacade' defined in URL [jar:file:/E:/glassfish-4.0/glassfish/domains/domain1/applications/geoserver/WEB-INF/lib/gs-gwc-2.14.5.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.gwc.GWC]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;

您之所以看到这种情况,是因为您尝试部署的应用程序包与Glassfish附带的Google Guava版本不同。不幸的是,Glassfish喜欢它自己的打包版本,它没有方法
com.google.common.base.premissions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;)

存在一些(或多或少涉及的)变通办法。

由于您似乎有一个WAR存档,此注释表明,在
glassfishweb.xml
中禁用classloader委派可能就足够了。也许你很幸运,这确实有助于你处理战争档案。
否则,您将不得不切换到Payara,它似乎已经修复了这个bug。

您可能需要向一家公司支付开发Glassfish的费用-据我所知,没有一个常规开发人员考虑过使用它。在WAR文件中的web-INF中添加Glassfish-web.xml文件,其中类加载器委派被禁用至少在部署Geoserver时,它似乎是可行的。我还没有对它进行更彻底的测试,但这似乎是解决方案。这是一个非常简单的修复方法,我强烈建议参与Geoserver项目的任何人在他们的页面中添加注释,以告知其他仍在使用Glassfish的参考实现的人!很高兴它起到了作用。@ChristophJohn现在颁发了赏金,很抱歉耽搁了,以前从未这样做过,也没有意识到我必须手动颁发赏金。