我們目前正在開發一個應用程序,使用部署到Tomcat的DWR 3.0.RC2,其中配置了DWR並按預期工作。我們正在考慮切換使用Jetty,並且我正在進行遷移過程。但是,我在服務器上遇到了導致DWR無法正常工作的例外情況,並且想知道是否有人遇到過這個問題或者有過什麼建議(如果我錯過了某些配置等等。)DWR - Jetty 9中的反射異常
應用程序加載並啓動。瀏覽器中,我們在瀏覽器控制檯中發現錯誤,並且DWR數據在預期時不推送。服務器日誌在每個請求期間顯示堆棧跟蹤,並帶有DWR推送。
當前部署(工作)位於Tomcat 7.0.21 ,我們正試圖轉移到碼頭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)