2

I am running successfully GeoServer 2.15.0 as a Web Archive started from WildFly 16.0.0 using OpenJDK 1.8.0 (RPM built for CentOS 7.6).

I would like to upgrade to GeoServer 2.16.2 (i.e. the latest stable release as of today) but the service cannot be started.

Here is the first error shown:

2020-02-13 11:27:14,554 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."geoserver.war".component."org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener".WeldInstantiator: org.jboss.msc.service.StartException in service jboss.deployment.unit."geoserver.war".component."org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener".WeldInstantiator: Failed to start service
        at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
        at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        ... 4 more
Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener
        at [email protected]//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:186)
        at [email protected]//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
        ... 11 more
Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletHttpHandlerAdapter$HandlerResultSubscriber (Module "deployment.geoserver.war" from Service Module Loader): org/reactivestreams/Subscriber
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
        ... 33 more

I would say that the key problem here is java.lang.NoClassDefFoundError but I do not know how to fix it.

There are several identical issues ; here is the full list:

Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletServerHttpResponse$ResponseBodyProcessor (Module "deployment.geoserver.war" from Service Module Loader): Failed to link org/springframework/http/server/reactive/AbstractListenerWriteProcessor (Module "deployment.geoserver.war" from Service Module Loader): org/reactivestreams/Processor
Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletServerHttpRequest$RequestBodyPublisher (Module "deployment.geoserver.war" from Service Module Loader): Failed to link org/springframework/http/server/reactive/AbstractListenerReadPublisher (Module "deployment.geoserver.war" from Service Module Loader): org/reactivestreams/Publisher
Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletHttpHandlerAdapter$HandlerResultSubscriber (Module "deployment.geoserver.war" from Service Module Loader): org/reactivestreams/Subscriber

I have removed all GeoServer plugins and community modules in order to minimize side effects.

I should mention that GeoServer runs fine under Jetty instead of WildFly.

I also have upgraded WildFly from 16.0.0 to 18.0.1, but the service still does not start. I also upgraded OpenJDK from 1.8.0 to 11.0.6, still the same. And of course I have tested each combination (WF16+Java8, WF16+Java11, WF18+Java8, WF18+Java11).

1 Answer 1

2

Answering my own question because I finally found how to fix the issue.

While loading the GeoServer 2.16 Web Archive, WildFly is in need of reactive-streams. It is unclear why this dependency occurred with GeoServer 2.16 this but definitely appeared with 2.16 and onward (tested with 2.16.0, 2.16.2 and master (2.17)).

I should mention the problem is very similar to this issue.

Quick fix

The fastest way to solve this problem consists in copying the reactive-streams JAR to the WEB-INF directory, i.e.:

  1. unzip the GeoServer WAR in the deployments directory of WildFly, e.g. if the deployments dir is /path/to/deployments then create a directory /path/to/deployments/geoserver.war/ and copy the contents of the unzipped geoserver.war into this folder

  2. download the reactive-streams JAR, e.g. 1.0.3 from the Maven Repository

  3. copy reactive-streams-1.0.3.jar to /path/to/deployments/geoserver.war/WEB-INF/lib/

  4. tell WildFly to deploy the server by creating the .dodeploy file, e.g. touch /path/to/deployments/geoserver.war.dodeploy

The hard way

The other option requires building GeoServer by yourself.

I chose Maven but you may want to take a look at other options.

  1. download the zipped source code package for tag 2.16.2 and unzip it locally

  2. add the following dependency in src/pom.xml:

<dependency>
  <groupId>org.reactivestreams</groupId>
  <artifactId>reactive-streams</artifactId>
  <version>1.0.3</version>
</dependency>
  1. add the following dependency in src/main/pom.xml:
<dependency>
  <groupId>org.reactivestreams</groupId>
  <artifactId>reactive-streams</artifactId>
</dependency>
  1. build the project with Maven:

mvn -DskipTests -T 2C clean install

If everything goes well, a WAR file is created at this location src/web/app/target/geoserver.war

You can check if reactive-streams is included in the WAR by calling:

jar tf geoserver.war WEB-INF/lib

1
  • 2
    I filed an issue at osgeo for geoserver regarding this problem.
    – wumpz
    Commented Mar 5, 2020 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.