我们目前正在使用部署到Tomcat的DWR3.0.RC2开发一个应用程序,在这个应用程序中,DWR被配置并按预期工作。我们正在考虑切换到使用Jetty,我正在研究迁移过程。但是,我在服务器上遇到了导致DWR无法工作的异常,并且想知道是否有人遇到过这种情况或有建议(万一我错过了一些配置,等等)。
应用程序加载并启动。当浏览到时,我们会在浏览器控制台中得到一个错误,并且DWR数据不会按预期推送。服务器日志显示在每个请求期间使用DWR推送的堆栈跟踪。
当前的部署(工作)在Tomcat 7.0.21上,我们试图转移到Jetty 9.2.3.v20140905 (不工作)。有人能提供一些指点吗?
Jetty配置:
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)发布于 2014-09-26 22:47:44
看起来DWR还没有更新他们的7.0.1以来对码头的支持 (那是5年前的)。
这里似乎有一个Servlet3支持选项,您能用/配置来代替吗?(Jetty 9是一个有效的Servlet3.1容器)
https://stackoverflow.com/questions/26068882
复制相似问题