New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cometd-demo.war deploys with an exception on wildfly10 #758

Closed
ghuser opened this Issue Dec 6, 2017 · 13 comments

Comments

Projects
None yet
3 participants
@ghuser

ghuser commented Dec 6, 2017

The cometd-demo.war does not run on wildfly10 (standalone-full profile). I get this:

Failed to define class org.eclipse.jetty.servlets.gzip.GzipHandler in Module "deployment.cometd-demo-3.1.3.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/eclipse/jetty/servlets/gzip/GzipHandler (Module "deployment.cometd-demo-3.1.3.war:main" from Service Module Loader): org/eclipse/jetty/server/handler/HandlerWrapper

Which of the jetty dependencies are required, for running a cometd application on wildfly10 and support clustering?

@ghuser ghuser changed the title from Jetty dependencies on wildfly10 to cometd-demo.war does not run on wildfly10 Dec 6, 2017

@sbordet

This comment has been minimized.

Show comment
Hide comment
@sbordet

sbordet Dec 6, 2017

Member

This is strange, as the CometD Demo does not use GzipHandler, and it's not present in cometd-demo-3.1.3.war.
I don't know why wildfly would try to load it.

Member

sbordet commented Dec 6, 2017

This is strange, as the CometD Demo does not use GzipHandler, and it's not present in cometd-demo-3.1.3.war.
I don't know why wildfly would try to load it.

@ghuser ghuser changed the title from cometd-demo.war does not run on wildfly10 to cometd-demo.war deploys with an exception on wildfly10 Dec 7, 2017

@ghuser

This comment has been minimized.

Show comment
Hide comment
@ghuser

ghuser Dec 7, 2017

Changed title: It actually deploys and works but with the exception mentioned.

ghuser commented Dec 7, 2017

Changed title: It actually deploys and works but with the exception mentioned.

@sbordet

This comment has been minimized.

Show comment
Hide comment
@sbordet

sbordet Dec 7, 2017

Member

My comment still stands... the CometD Demo does not use GzipHandler, so you have to double check whether you have modified the demo or have otherwise included a dependency to it.

Member

sbordet commented Dec 7, 2017

My comment still stands... the CometD Demo does not use GzipHandler, so you have to double check whether you have modified the demo or have otherwise included a dependency to it.

@ghuser

This comment has been minimized.

Show comment
Hide comment
@ghuser

ghuser Dec 7, 2017

Could this help? Running with -verbose:class

[Loaded javax.servlet.http.HttpServletResponseWrapper from jar:file:/opt/wildfly-10.1.0.Final/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_3.1_spec-1.0.0.Final.jar!/]
[Loaded org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper from vfs:/content/cometd-demo-3.1.3.war/WEB-INF/lib/jetty-servlets-9.2.22.v20170606.jar]
�[33m19:01:17,939 WARN  [org.jboss.modules] (MSC service thread 1-5) Failed to define class org.eclipse.jetty.servlets.gzip.GzipHandler in Module "deployment.cometd-demo-3.1.3.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/eclipse/jetty/servlets/gzip/GzipHandler (Module "deployment.cometd-demo-3.1.3.war:main" from Service Module Loader): org/eclipse/jetty/server/handler/HandlerWrapper

ghuser commented Dec 7, 2017

Could this help? Running with -verbose:class

[Loaded javax.servlet.http.HttpServletResponseWrapper from jar:file:/opt/wildfly-10.1.0.Final/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_3.1_spec-1.0.0.Final.jar!/]
[Loaded org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper from vfs:/content/cometd-demo-3.1.3.war/WEB-INF/lib/jetty-servlets-9.2.22.v20170606.jar]
�[33m19:01:17,939 WARN  [org.jboss.modules] (MSC service thread 1-5) Failed to define class org.eclipse.jetty.servlets.gzip.GzipHandler in Module "deployment.cometd-demo-3.1.3.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/eclipse/jetty/servlets/gzip/GzipHandler (Module "deployment.cometd-demo-3.1.3.war:main" from Service Module Loader): org/eclipse/jetty/server/handler/HandlerWrapper
@sbordet

This comment has been minimized.

Show comment
Hide comment
@sbordet

sbordet Dec 7, 2017

Member

jetty-servlets is definitely included in the demo's WEB-INF/lib, but we never use CompressedResponseWrapper or otherwise GzipHandler so that class should not be loaded.
I don't know why WildFly loads it, did you ask there ?

Member

sbordet commented Dec 7, 2017

jetty-servlets is definitely included in the demo's WEB-INF/lib, but we never use CompressedResponseWrapper or otherwise GzipHandler so that class should not be loaded.
I don't know why WildFly loads it, did you ask there ?

@ghuser

This comment has been minimized.

Show comment
Hide comment
@ghuser

ghuser Dec 7, 2017

True. Problem appears on clean wildfly10 installation just by deploying an empty war built with the following dependencies.

<dependencies>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlets</artifactId>
        <version>9.2.22.v20170606</version>
    </dependency>
</dependencies>

Are jetty dependencies required only for the demo, or they are needed for creating any cometd app?

ghuser commented Dec 7, 2017

True. Problem appears on clean wildfly10 installation just by deploying an empty war built with the following dependencies.

<dependencies>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlets</artifactId>
        <version>9.2.22.v20170606</version>
    </dependency>
</dependencies>

Are jetty dependencies required only for the demo, or they are needed for creating any cometd app?

@sbordet

This comment has been minimized.

Show comment
Hide comment
@sbordet

sbordet Dec 7, 2017

Member

The dependency to jetty-servlets is needed because the demo uses CrossOriginFilter, so it's not strictly required by CometD, it's only used by the demo.

You can write your own filter to handle cross-origin requests and get rid of the jetty-servlets dependency as a temporary workaround.

Member

sbordet commented Dec 7, 2017

The dependency to jetty-servlets is needed because the demo uses CrossOriginFilter, so it's not strictly required by CometD, it's only used by the demo.

You can write your own filter to handle cross-origin requests and get rid of the jetty-servlets dependency as a temporary workaround.

@Gr33nbl00d

This comment has been minimized.

Show comment
Hide comment
@Gr33nbl00d

Gr33nbl00d Jan 11, 2018

This does not solve the problem, the problem still exists without jetty-servlets on a fresh Wildfly 11 final installation

Gr33nbl00d commented Jan 11, 2018

This does not solve the problem, the problem still exists without jetty-servlets on a fresh Wildfly 11 final installation

@sbordet

This comment has been minimized.

Show comment
Hide comment
@sbordet

sbordet Jan 11, 2018

Member

@Gr33nbl00d the last comment from the OP seems to hint that this is a WildFly problem, as it should not load classes that are not used, even if they are present in an empty war.

As said, CometD does not use CompressedResponseWrapper so WildFly should not load it.

Member

sbordet commented Jan 11, 2018

@Gr33nbl00d the last comment from the OP seems to hint that this is a WildFly problem, as it should not load classes that are not used, even if they are present in an empty war.

As said, CometD does not use CompressedResponseWrapper so WildFly should not load it.

@Gr33nbl00d

This comment has been minimized.

Show comment
Hide comment
@Gr33nbl00d

Gr33nbl00d Jan 11, 2018

Thats similar to: it runs on my pc! :P even if it doesnt load it it could be a problem caused by a dependency. Its not like wildfly has some switch if cometd than load compressedresponsewrapper. However i will analyse dependencies and class loading tomorrow to find out who is the bad guy

Gr33nbl00d commented Jan 11, 2018

Thats similar to: it runs on my pc! :P even if it doesnt load it it could be a problem caused by a dependency. Its not like wildfly has some switch if cometd than load compressedresponsewrapper. However i will analyse dependencies and class loading tomorrow to find out who is the bad guy

@Gr33nbl00d

This comment has been minimized.

Show comment
Hide comment
@Gr33nbl00d

Gr33nbl00d Jan 11, 2018

If any class does some static initialisation its enough if the class is somewhere referenced. Even if not used. But i try my best tomorrow to find the cause

Gr33nbl00d commented Jan 11, 2018

If any class does some static initialisation its enough if the class is somewhere referenced. Even if not used. But i try my best tomorrow to find the cause

@Gr33nbl00d

This comment has been minimized.

Show comment
Hide comment
@Gr33nbl00d

Gr33nbl00d Jan 12, 2018

So there was a jetty-servlets.jar leftover in the war file which was causing the problem. After removing i got it running. Maybe for the demo its not needed to have a cross origin filter.

Gr33nbl00d commented Jan 12, 2018

So there was a jetty-servlets.jar leftover in the war file which was causing the problem. After removing i got it running. Maybe for the demo its not needed to have a cross origin filter.

@sbordet

This comment has been minimized.

Show comment
Hide comment
@sbordet

sbordet Jan 12, 2018

Member

The CrossOriginFilter will remain in the CometD demo to show how to set it up, since the deployment cross-origin of CometD is quite common.

Maybe you can use alternative Servlet Containers that do not have classloading bugs, or report the bug to WildFly.

Member

sbordet commented Jan 12, 2018

The CrossOriginFilter will remain in the CometD demo to show how to set it up, since the deployment cross-origin of CometD is quite common.

Maybe you can use alternative Servlet Containers that do not have classloading bugs, or report the bug to WildFly.

@sbordet sbordet closed this Jan 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment