Dwr+Spring+hibernate 在Web.xml文件中配制出错

ajhr88 2008-03-09 02:13:28
在一个项目中我需要Dwr+SSH来做

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

但是当在web.xml中加入上面就句话后,在运行时就会出现下面的错误
2008-3-9 13:19:52 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2008-3-9 13:19:52 org.apache.catalina.core.StandardContext start
严重: Context [/Make_friends] startup failed due to previous errors
...全文
82 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ajhr88 2008-03-10
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>makefriends</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>makefriends</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

这是我的web.xml文件
ajhr88 2008-03-10
  • 打赏
  • 举报
回复
我是那样写的,它写上<listener>就出错
Rubenyu 2008-03-10
  • 打赏
  • 举报
回复
org.springframework.web.context.ContextLoaderListener
是在Servlet2.4容器上才有的.以前版本是没有的.你看看你使用的容器是否是Servlet2.4,不是的话.
以前版本是这样用的.
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
yojiwei 2008-03-10
  • 打赏
  • 举报
回复
把你的错误信息提供的更详细一点。
把你的.xml配置文件贴出来哦!
mihaisheng 2008-03-09
  • 打赏
  • 举报
回复
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧