5

我已经开始使用 Vaadin 7.2.4 的 Maven 原型构建一个项目,并且遇到了很多与 Atmosphere 启动问题有关的错误。就目前情况而言,我将无法启用使用插件 (OAuthButtonPopup) 所需的推送支持。尽管有很多关于 Atmosphere 的一般性讨论,但我似乎找不到任何特定于这个问题的东西,所以我想知道我这边是否存在安装/配置问题,特别是因为似乎有人尝试实例化与 Jetty 相关的一些类这似乎与我的安装无关。

当前设置如下:Java 8 SDK、Java EE7 JDK、Idea IntelliJ 13、Vaadin 7.2.4 和 Wildfly 8。

任何指针将不胜感激。

部署错误跟踪如下:

[2014-07-17 10:21:10,394] Artifact OAuthPopupTest:war: Artifact is being deployed, please wait...
[0m22:21:10,540 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "OAuthPopupTest-1.0-SNAPSHOT.war" (runtime-name: "OAuthPopupTest-1.0-SNAPSHOT.war")
[0m[33m22:21:12,921 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015960: Class Path entry xml-apis.jar in /content/OAuthPopupTest-1.0-SNAPSHOT.war/WEB-INF/lib/serializer-2.7.1.jar  does not point to a valid jar for a Class-Path reference.
[0m[33m22:21:13,286 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$1 due to an exception (enable DEBUG log level to see the cause)
[0m[33m22:21:13,287 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$2 due to an exception (enable DEBUG log level to see the cause)
[0m[0m22:21:13,540 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-14) JBAS017534: Registered web context: /OAuthPopupTest-1.0-SNAPSHOT
[0m[0m22:21:13,557 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "OAuthPopupTest-1.0-SNAPSHOT.war" (runtime-name : "OAuthPopupTest-1.0-SNAPSHOT.war")
[0m[2014-07-17 10:21:13,578] Artifact OAuthPopupTest:war: Artifact is deployed successfully
[2014-07-17 10:21:13,579] Artifact OAuthPopupTest:war: Deploy took 3,185 milliseconds
[33m22:21:13,949 WARNING [com.vaadin.server.DefaultDeploymentConfiguration] (default task-1) 
=================================================================
Vaadin is running in DEBUG MODE.
Add productionMode=true to web.xml to disable debug features.
To show debug window, add ?debug to your application URL.
=================================================================
[0m[0m22:21:13,989 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-1) Installed AtmosphereHandler com.vaadin.server.communication.PushHandler$1 mapped to context-path: /*
[0m[0m22:21:13,990 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-1) Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushHandler$1
[0m[33m22:21:13,995 WARNING [org.atmosphere.cpr.AtmosphereFramework] (default task-1) SessionSupport error. Make sure you define org.atmosphere.cpr.SessionSupport as a listener in web.xml instead
[0m[0m22:21:14,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-1) Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
[0m[0m22:21:14,003 INFO  [org.atmosphere.cpr.DefaultAnnotationProcessor] (default task-1) AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
[0m[33m22:21:14,005 WARNING [org.atmosphere.cpr.DefaultAnnotationProcessor] (default task-1) Unable to detect annotations. Application may fail to deploy.
[0m[0m22:21:14,039 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-1) Auto detecting WebSocketHandler in /WEB-INF/classes/
[0m[0m22:21:14,047 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-1) Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
[0m[31m22:21:14,054 SEVERE [org.atmosphere.cpr.DefaultAsyncSupportResolver] (default task-1) failed to create comet support class: class org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket, error: null
[0m[31m22:21:14,054 SEVERE [org.atmosphere.cpr.AtmosphereFramework] (default task-1) Failed to initialize Atmosphere Framework: java.lang.IllegalArgumentException: Unable to createclass org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:229) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:288) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:274) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:1591) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:717) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:614) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    at com.vaadin.server.communication.PushRequestHandler.<init>(PushRequestHandler.java:120) [vaadin-server-7.2.4.jar:7.2.4]
    at com.vaadin.server.VaadinServletService.createRequestHandlers(VaadinServletService.java:92) [vaadin-server-7.2.4.jar:7.2.4]
    at com.vaadin.server.VaadinService.init(VaadinService.java:180) [vaadin-server-7.2.4.jar:7.2.4]
    at com.vaadin.server.VaadinServlet.createServletService(VaadinServlet.java:190) [vaadin-server-7.2.4.jar:7.2.4]
    at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:96) [vaadin-server-7.2.4.jar:7.2.4]
    at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:214) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.core.ManagedServlet.getServlet(ManagedServlet.java:157) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:84) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_05]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_05]
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_05]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_05]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_05]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [rt.jar:1.8.0_05]
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:225) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    ... 38 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/WebSocketFactory$Acceptor
    at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.<init>(JettyServlet30AsyncSupportWithWebSocket.java:46) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]
    ... 43 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.websocket.WebSocketFactory$Acceptor from [Module "deployment.OAuthPopupTest-1.0-SNAPSHOT.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
4

4 回答 4

4

根据 rustproofFish 和 Raffael 的先前答案,我能够通过添加这些排除项来修复错误:

   <groupId>com.vaadin</groupId>
   <artifactId>vaadin-client-compiler</artifactId>
   <version>${vaadin.version}</version>
   <exclusions>
        <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlets</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-annotations</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-util</artifactId>
        </exclusion>
    </exclusions>
于 2014-12-22T03:47:16.343 回答
3

感谢指针拉斐尔 - 你是非常正确的。由于将 Vaadin 7.2.4 原型中的一个依赖项从 vaadin-client-compiled 更改为 vaadin-client-compiler 以使项目在首次运行时构建和编译,因此构建中包含了 Jetty 依赖项(请参阅 Vaadin 论坛上题为 GWT compiler error - Vaadin Charts using Maven and IntelliJ https://vaadin.com/forum#!/thread/4751650的帖子。依赖关系树中的错误错误如下:

[INFO] uk.co.awardtech:OAuthPopupTest:war:1.0-SNAPSHOT
[INFO] +- com.vaadin:vaadin-server:jar:7.2.4:compile
[INFO] |  +- com.vaadin:vaadin-sass-compiler:jar:0.9.6:compile
[INFO] |  |  \- com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO] |  +- com.vaadin:vaadin-shared:jar:7.2.4:compile
[INFO] |  |  +- com.vaadin.external.streamhtmlparser:streamhtmlparser-jsilver:jar:0.0.10.vaadin1:compile
[INFO] |  |  +- com.vaadin.external.google:guava:jar:16.0.1.vaadin1:compile
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:compile
[INFO] |  \- org.jsoup:jsoup:jar:1.6.3:compile
[INFO] +- com.vaadin:vaadin-client-compiler:jar:7.2.4:compile
[INFO] |  +- commons-collections:commons-collections:jar:3.1:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] |  +- ant:ant:jar:1.6.5:compile
[INFO] |  +- net.sourceforge.cssparser:cssparser:jar:0.9.11:compile
[INFO] |  +- ant:ant-launcher:jar:1.6.5:compile
[INFO] |  +- org.eclipse.jetty:jetty-annotations:jar:8.1.12.v20130726:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-plus:jar:8.1.12.v20130726:compile
[INFO] |  |  |  +- org.eclipse.jetty.orbit:javax.transaction:jar:1.1.1.v201105210645:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-jndi:jar:8.1.12.v20130726:compile
[INFO] |  |  |     +- org.eclipse.jetty:jetty-server:jar:8.1.12.v20130726:compile
[INFO] |  |  |     |  \- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile
[INFO] |  |  |     \- org.eclipse.jetty.orbit:javax.mail.glassfish:jar:1.4.1.v201005082020:compile
[INFO] |  |  |        \- org.eclipse.jetty.orbit:javax.activation:jar:1.1.0.v201105071233:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-webapp:jar:8.1.12.v20130726:compile
[INFO] |  |  |  +- org.eclipse.jetty:jetty-xml:jar:8.1.12.v20130726:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-servlet:jar:8.1.12.v20130726:compile
[INFO] |  |  |     \- org.eclipse.jetty:jetty-security:jar:8.1.12.v20130726:compile
[INFO] |  |  +- org.eclipse.jetty.orbit:javax.annotation:jar:1.1.0.v201108011116:compile
[INFO] |  |  \- org.eclipse.jetty.orbit:org.objectweb.asm:jar:3.1.0.v200803061910:compile
[INFO] |  +- org.eclipse.jetty:jetty-servlets:jar:8.1.12.v20130726:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-continuation:jar:8.1.12.v20130726:compile
[INFO] |  |  \- org.eclipse.jetty:jetty-client:jar:8.1.12.v20130726:compile
[INFO] |  |     \- org.eclipse.jetty:jetty-http:jar:8.1.12.v20130726:compile
[INFO] |  |        \- org.eclipse.jetty:jetty-io:jar:8.1.12.v20130726:compile
[INFO] |  +- org.eclipse.jetty:jetty-util:jar:8.1.12.v20130726:compile

将 pom.xml 条目改回 vaadin-client-compiled,清理和重建解决了不正确的依赖关系;Atmosphere 现在开始时没有错误/警告,并且根据我迄今为止的有限测试,推送功能似乎存在且正确。

于 2014-07-21T14:29:31.303 回答
2

对我来说,您的 war 包中似乎包含不应打包的库。您可能会查看您的战争以查看包含哪些 jar 依赖项。也许码头的某些部分。你可以使用

mvn dependency:tree

查看它们来自哪里,并在必要时排除它们。

要启用推送,此 wiki 页面描述了所有必需的步骤:https ://vaadin.com/wiki/-/wiki/Main/Enabling%20server%20push

于 2014-07-21T10:45:32.860 回答
1

我对 Tomcat 也有类似的错误。我通过在我的 web.xml 中添加以下内容来修复错误

    <init-param>
        <param-name>org.atmosphere.cpr.asyncSupport</param-name>
        <param-value>org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket</param-value>
    </init-param>

https://github.com/Atmosphere/atmosphere/wiki/ClassNotFoundException-at-startup

于 2016-03-15T22:06:18.113 回答