遇到“配置 org.directwebremoting.servlet.DwrListener 类的应用程序侦听器时出错”

发布于 2024-09-14 23:51:16 字数 2996 浏览 4 评论 0原文

在tomcat6中使用dwr部署应用程序时,我发现错误“配置类org.directwebremoting.servlet.DwrListener的应用程序侦听器时出错”。 这是我的 web.xml

<display-name>DWR (Direct Web Remoting)</display-name>
  <description>A Simple Demo DWR</description>
  <listener>
    <listener-class>org.directwebremoting.servlet.DwrListener</listener-class>
  </listener>


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

<!-- This should NEVER be present in live -->
<init-param>
  <param-name>debug</param-name>
  <param-value>true</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>

<!-- WARNING: allowing JSON-RPC connections bypasses much of the security
protection that DWR gives you. Take this out if security is important -->
<init-param>
  <param-name>jsonRpcEnabled</param-name>
  <param-value>true</param-value>
</init-param>

<!-- WARNING: allowing JSONP connections bypasses much of the security
protection that DWR gives you. Take this out if security is important -->
<init-param>
  <param-name>jsonpEnabled</param-name>
  <param-value>true</param-value>
</init-param>

<!-- data: URLs are good for small images, but are slower, and could OOM for
larger images. Leave this out (or keep 'false') for anything but small images -->
<init-param>
  <param-name>preferDataUrlSchema</param-name>
  <param-value>false</param-value>
</init-param>

<!-- This enables full streaming mode. It's probably better to leave this
out if you are running across the Internet -->
<init-param>
  <param-name>maxWaitAfterWrite</param-name>
  <param-value>-1</param-value>
</init-param>


    <init-param>
  <param-name>org.directwebremoting.extend.ServerLoadMonitor</param-name>
  <param-value>org.directwebremoting.impl.PollingServerLoadMonitor</param-value>
 </init-param>



<!--
For more information on these parameters, see:
- http://getahead.org/dwr/server/servlet
- http://getahead.org/dwr/reverse-ajax/configuration
-->
<load-on-startup>1</load-on-startup>
  </servlet>

i found the error of "Error configuring application listener of class org.directwebremoting.servlet.DwrListener" when deploying application using dwr in tomcat6.
Here is my web.xml

<display-name>DWR (Direct Web Remoting)</display-name>
  <description>A Simple Demo DWR</description>
  <listener>
    <listener-class>org.directwebremoting.servlet.DwrListener</listener-class>
  </listener>


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

<!-- This should NEVER be present in live -->
<init-param>
  <param-name>debug</param-name>
  <param-value>true</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>

<!-- WARNING: allowing JSON-RPC connections bypasses much of the security
protection that DWR gives you. Take this out if security is important -->
<init-param>
  <param-name>jsonRpcEnabled</param-name>
  <param-value>true</param-value>
</init-param>

<!-- WARNING: allowing JSONP connections bypasses much of the security
protection that DWR gives you. Take this out if security is important -->
<init-param>
  <param-name>jsonpEnabled</param-name>
  <param-value>true</param-value>
</init-param>

<!-- data: URLs are good for small images, but are slower, and could OOM for
larger images. Leave this out (or keep 'false') for anything but small images -->
<init-param>
  <param-name>preferDataUrlSchema</param-name>
  <param-value>false</param-value>
</init-param>

<!-- This enables full streaming mode. It's probably better to leave this
out if you are running across the Internet -->
<init-param>
  <param-name>maxWaitAfterWrite</param-name>
  <param-value>-1</param-value>
</init-param>


    <init-param>
  <param-name>org.directwebremoting.extend.ServerLoadMonitor</param-name>
  <param-value>org.directwebremoting.impl.PollingServerLoadMonitor</param-value>
 </init-param>



<!--
For more information on these parameters, see:
- http://getahead.org/dwr/server/servlet
- http://getahead.org/dwr/reverse-ajax/configuration
-->
<load-on-startup>1</load-on-startup>
  </servlet>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌能量女王 2024-09-21 23:51:16

您是否也收到 ClassNotFound 错误?

您是否已将 dwr.jar 放入 Web 应用程序的 WEB-INF/lib 目录中?

Are you are getting a ClassNotFound error as well ?

Have you placed dwr.jar in the WEB-INF/lib directory of your webapp?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文