DWR - Jetty 9中的破坏反射异常

时间:2014-09-26 21:58:07

标签: java tomcat jetty dwr

我们目前正在使用部署到Tomcat的DWR 3.0.RC2开发应用程序,其中DWR已配置并按预期工作。我们正在考虑转换使用Jetty,我正在进行迁移过程。但是,我在服务器上遇到异常导致DWR无法正常工作,并且想知道是否有人遇到过这个或有过建议(如果我错过了一些配置等等。

应用程序加载和启动。浏览时,我们在浏览器控制台中收到错误,并且在预期时不会推送DWR数据。服务器日志通过DWR推送显示每个请求期间的堆栈跟踪。

当前部署(正在运行)是在Tomcat 7.0.21上,我们正在尝试迁移到Jetty 9.2.3.v20140905(无法正常工作)。有人可以提供一些指示吗?

码头配置:

100%默认值(已为此用户新下载),但已运行java -jar start.jar --add-to-startd=https以启用HTTPS。

相关的web.xml配置:

<servlet>
  <description>Direct Web Remoting Servlet</description>
  <display-name>DWR Servlet</display-name>
  <servlet-name>dwr-invoker</servlet-name>
  <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>

  <!-- We're currently using Java annotations instead of a separate dwr.xml 
       config file. -->
  <init-param>
      <!-- The "classes" servlet parameter must provide a comma-separated 
           list of the fully-qualified class names of all annotated classes 
           to be used with DWR. -->
      <param-name>classes</param-name>
      <param-value>
          org.ourdomain.ourapp.ApplicationDWR, 
          org.ourdomain.ourapp.DataImportDWR
      </param-value>
  </init-param>

    <!-- Remove this unless you want to use active reverse ajax -->
    <init-param>
      <param-name>activeReverseAjaxEnabled</param-name>
      <param-value>true</param-value>
    </init-param>

    <!-- By default DWR creates application scope objects when they are first
    used. This creates them when the app-server is started -->
    <init-param>
      <param-name>initApplicationScopeCreatorsAtStartup</param-name>
      <param-value>true</param-value>
    </init-param>

    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
  </servlet-mapping>

错误:

客户端:

Error: Object {name: "dwr.engine.missingData", message: "No data received from server"}

服务器:

13:12:09,621 ERROR JettyContinuationSleeper:181 - Broken reflection
java.lang.NullPointerException
        at org.directwebremoting.util.Continuation.resume(Continuation.java:107)
        at org.directwebremoting.server.jetty.JettyContinuationSleeper.wakeUp(JettyContinuationSleeper.java:177)
        at org.directwebremoting.impl.TimedAlarm$1.run(TimedAlarm.java:46)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

1 个答案:

答案 0 :(得分:0)

看起来DWR没有更新他们的support for Jetty since 7.0.1(5年前)。

似乎有一个Servlet3 support option,您可以使用/配置吗? (Jetty 9是一个有效的Servlet 3.1容器)