在dwr中遇到一个麻烦的问题了各位大侠们如果遇到过或者知道的望指点下下啦

summa427 2010-10-12 05:57:25
情况是这样的:
我的web.xml里配置了多个dwr配置文件,当我调用过其中一个dwr后调用另外一个dwr就报错
(我如果首先登陆前台界面调用过/dwrLog/*后,dwrLog的所有操作都正常,然后再去登陆后台就报下面错误,
在后台是调用/dwrAdmin/*的,<如果重启服务器先去登陆后台,前台的dwr有不能用了,提示dwr里的类未定义>
不知道我下面的配置文件是否出问题了,望大侠们指点啦谢谢。)
错误提示如下:

信息: Starting: DWRServlet v3.0.0.116.rc1 on Apache Tomcat/5.5.31 / JDK 1.5.0_11 from Sun Microsystems Inc. at /fash
2010-10-12 17:35:49 org.directwebremoting.impl.DefaultServerContextBuilder get
严重: Error initializing ServerContext because this is not a DWR thread and there is more than one DWR servlet in the current classloader.
2010-10-12 17:35:49 org.directwebremoting.impl.DefaultServerContextBuilder get
严重: This probably means that either DWR has not been properly initialized (in which case you should delay the current action until it has)
2010-10-12 17:35:49 org.directwebremoting.impl.DefaultServerContextBuilder get
严重: or that there is more than 1 DWR servlet is configured in this classloader, in which case you should provide a ServletContext to the get() yourself.
2010-10-12 17:35:49 org.directwebremoting.impl.DefaultCreatorManager addCreator
严重: Error loading class for creator 'SpringCreator[seController]'.
java.lang.NullPointerException
at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:153)
at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:107)
at org.directwebremoting.impl.DefaultCreatorManager.addCreator(DefaultCreatorManager.java:97)
at org.directwebremoting.impl.DefaultCreatorManager.addCreator(DefaultCreatorManager.java:78)

at java.lang.Thread.run(Thread.java:595)
2010-10-12 17:35:49 org.directwebremoting.impl.DefaultCreatorManager getCreator
严重: Class not found: 'adminController'
2010-10-12 17:35:49 org.directwebremoting.impl.DefaultCreatorManager getCreator
警告: Names of known classes are: __System __Data
2010-10-12 17:35:49 org.directwebremoting.servlet.ExceptionHandler handle
警告: Error: java.lang.SecurityException: Class not found
2010-10-12 17:37:27 org.apache.catalina.startup.HostConfig checkResources
信息: Reloading context [/fash]


感觉上是web.xml配置上的问题下面是我的web.xml配置文件相关内容
web.xml

<servlet>
<servlet-name>user-dwr-invoke</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>classes</param-name> <!--启动 classes类型防止服务器启动报错 -->
<param-value>java.lang.Object</param-value>
</init-param>
<init-param>
<param-name>config-user</param-name> <!--前台用户管理dwr路径-->
<param-value>/WEB-INF/classes/config/dwr/dwr-user.xml</param-value>
</init-param>
<init-param>
<param-name>config-load</param-name> <!--游客访问dwr路径 -->
<param-value>/WEB-INF/classes/config/dwr/dwr-user-load.xml</param-value>
</init-param>

</servlet>
<servlet>
<servlet-name>admin-dwr-invoke</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>classes</param-name><!-- 启动 classes类型防止服务器启动报错 -->
<param-value>java.lang.Object</param-value>
</init-param>
<init-param>
<param-name>config-admin</param-name><!-- 后台用户管理dwr路径 -->
<param-value>/WEB-INF/classes/config/dwr/dwr-admin.xml</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>user-dwr-invoke</servlet-name>
<url-pattern>/dwrLog/*</url-pattern><!--当以/dwruser/* 路径 请求时执行 -->
</servlet-mapping>
<servlet-mapping>
<servlet-name>admin-dwr-invoke</servlet-name>
<url-pattern>/dwrAdmin/*</url-pattern><!--当以/dwradmin/* 路径 请求时执行 -->
</servlet-mapping>
...全文
352 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
bluemouse_2008 2010-10-13
为什么要定义两个DWR呢
回复
rodccc 2010-10-13
[Quote=引用 2 楼 kebin0001 的回复:]
錯誤訊息說你的 servlet 的 uk.ltd.getahead.dwr.DWRServlet 定義了兩次

你可以定義一個 servlet,然後兩個 servlet-mapping 用同一個 servlet
[/Quote]
支持这个说法
回复
kebin0001 2010-10-13
錯誤訊息說你的 servlet 的 uk.ltd.getahead.dwr.DWRServlet 定義了兩次

你可以定義一個 servlet,然後兩個 servlet-mapping 用同一個 servlet
回复
liubo_0329 2010-10-12
能够在 dwr 测试页面通过吗?
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2010-10-12 05:57
社区公告
暂无公告