在我的DWR应用程序中,我发现了这个跟踪,但奇怪的是,从应用程序的角度来看,它没有任何问题,并且只针对同一组步骤记录了一次。
有谁知道/遇到类似的事情?
WARN [org.directwebremoting.dwrp.BaseCallHandler] Exception while processing batch
java.lang.IllegalArgumentException: Failed to find parameter: batchId (check server log for more info).
at org.directwebremoting.dwrp.Batch.extractParameter(Batch.java:143)
at org.directwebremoting.dwrp.Batch.parseParameters(Batch.java:80)
at org.directwebremoting.dwrp.Batch.<init>(Batch.java:60)
at org.directwebremoting.dwrp.CallBatch.<init>(CallBatch.java:46)
at org.directwebremoting.dwrp.BaseCallHandler.handle(BaseCallHandler.java:76)
at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:126)
at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:144)
at org.directwebremoting.servlet.DwrServlet.doGet(DwrServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:1)
您使用的是Internet Explorer吗?
几周前我也遇到了同样的错误。 经过一番调查/调试后发现原因。
Internet Explorer对GET请愿网址的限制为2,083个字符(https://support.microsoft.com/en-us/kb/208427),如果超过该限制,它会自动切割网址以匹配该大小(不说任何内容)。
如果检查DWR代码(engine.js),当发生跨域调用时,您会发现最终使用<script>
标记进行请求。这基本上是一个GET电话。在我的情况下,生成的url大于Internet Explorer的限制,因此它会自动减少到正确的大小。
DWR使用该batchID来识别请求并且通常放在URL的末尾,因此当IE切断URL时,通常batchId会消除该“纠正”,使得dwr抛出该异常,因为无法在URL上找到它
为了解决这个问题,我被迫使用JSONP(http://directwebremoting.org/dwr/introduction/remoting_options.html)
希望它有所帮助。
答案 1 :(得分:0)
是的,我也很难过,但最后我明白了。看来在你使用dwr的页面中定义的一些html元素id或javascript变量与engine.js的代码冲突
示例:将此代码放在使用dwr的页面的body标记内
<div id="attributes" style="position: relative;">
</div>
现在你可以看到错误来了。只有当您可以将id 属性更改为其他内容时,错误才会消失。