`
gstarwd
  • 浏览: 1490053 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

在使用SSH添加 <listener> <listener-class>org.springframework.web.context.C

阅读更多

在使用SSH添加

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

 

tomcat在启动的时候发生如下错误: 

2008-9-28 11:13:01 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2008-9-28 11:13:01 org.apache.catalina.core.StandardContext start
严重: Context [/xxfire] startup failed due to previous errors

 

 

错误分析:

 

      错误触发在web.xml中定义

Xml代码 复制代码
  1. < context-param >   
  2.          < param-name > contextConfigLocation </ param-name >   
  3.          < param-value > /WEB-INF/context/ApplicationContext-*.xml </ param-value >   
  4. </ context-param >   
  5. < SPAN   style = "COLOR: #000000" > < listener >   
  6.          < listener-class > < SPAN   style = "BACKGROUND-COLOR: #ff6600" > org.springframework.web.context.ContextLoaderListener </ SPAN > </ listener-class >   
  7. </ listener > </ SPAN >   
Xml代码 <embed type="application/x-shockwave-flash" width="14" height="15" src="http://pavel.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Ccontext-param%3E%0A%20%20%20%20%20%20%20%20%3Cparam-name%3EcontextConfigLocation%3C%2Fparam-name%3E%0A%20%20%20%20%20%20%20%20%3Cparam-value%3E%2FWEB-INF%2Fcontext%2FApplicationContext-*.xml%3C%2Fparam-value%3E%0A%3C%2Fcontext-param%3E%0A%3Cspan%20style%3D%22color%3A%20rgb(0%2C%200%2C%200)%3B%22%3E%3Clistener%3E%0A%20%20%20%20%20%20%20%20%3Clistener-class%3E%3Cspan%20style%3D%22background-color%3A%20rgb(255%2C%20102%2C%200)%3B%22%3Eorg.springframework.web.context.ContextLoaderListener%3C%2Fspan%3E%3C%2Flistener-class%3E%0A%3C%2Flistener%3E%3C%2Fspan%3E%0A" quality="high" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
  1. < context-param >   
  2.         < param-name > contextConfigLocation </ param-name >   
  3.         < param-value > /WEB-INF/context/ApplicationContext-*.xml </ param-value >   
  4. </ context-param >   
  5. < span   style = "color: rgb(0, 0, 0);" > < listener >   
  6.         < listener-class > < span   style = "background-color: rgb(255, 102, 0);" > org.springframework.web.context.ContextLoaderListener </ span > </ listener-class >   
  7. </ listener > </ span >   
<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/context/ApplicationContext-*.xml</param-value>
</context-param>
<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

   检查spring配置管理xml文件。发现错误产生在:

 

Xml代码 复制代码
  1. < bean   id = "dataSource"   class =" < SPAN  style=" COLOR : #000000; BACKGROUND-COLOR: #ff6600" > org.apache.commons.dbcp.BasicDataSource </ SPAN > " >   
  2.      < property   name = "driverClassName"   value = "oracle.jdbc.driver.OracleDriver" > </ property >   
  3.      < property   name = "url"   value = "jdbc:oracle:thin:@localhost:1521:orcl" > </ property >   
  4.      < property   name = "username"   value = "sys8" > </ property >   
  5.      < property   name = "password"   value = "sys8" > </ property >   
  6. </ bean >   
Xml代码 <embed type="application/x-shockwave-flash" width="14" height="15" src="http://pavel.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cbean%20id%3D%22dataSource%22%20class%3D%22%3Cspan%20style%3D%22color%3A%20rgb(0%2C%200%2C%200)%3B%20background-color%3A%20rgb(255%2C%20102%2C%200)%3B%22%3Eorg.apache.commons.dbcp.BasicDataSource%3C%2Fspan%3E%22%3E%0A%09%3Cproperty%20name%3D%22driverClassName%22%20value%3D%22oracle.jdbc.driver.OracleDriver%22%3E%3C%2Fproperty%3E%0A%09%3Cproperty%20name%3D%22url%22%20value%3D%22jdbc%3Aoracle%3Athin%3A%40localhost%3A1521%3Aorcl%22%3E%3C%2Fproperty%3E%0A%09%3Cproperty%20name%3D%22username%22%20value%3D%22sys8%22%3E%3C%2Fproperty%3E%0A%09%3Cproperty%20name%3D%22password%22%20value%3D%22sys8%22%3E%3C%2Fproperty%3E%0A%3C%2Fbean%3E" quality="high" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
  1. < bean   id = "dataSource"   class =" < span  style=" color : rgb(0, 0, 0); background-color: rgb(255, 102, 0);" > org.apache.commons.dbcp.BasicDataSource </ span > " >   
  2.     < property   name = "driverClassName"   value = "oracle.jdbc.driver.OracleDriver" > </ property >   
  3.     < property   name = "url"   value = "jdbc:oracle:thin:@localhost:1521:orcl" > </ property >   
  4.     < property   name = "username"   value = "sys8" > </ property >   
  5.     < property   name = "password"   value = "sys8" > </ property >   
  6. </ bean >   
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource
">
	<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
	<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>
	<property name="username" value="sys8"></property>
	<property name="password" value="sys8"></property>
</bean>

   上面所示的代码中,红色代码是产生错误的根源,在spring管理Hibernate的dataSource是用的是:

Java代码 复制代码
  1. <SPAN style= "COLOR: #000000" >org.springframework.jdbc.datasource.DriverManagerDataSource</SPAN>  
Java代码 <embed type="application/x-shockwave-flash" width="14" height="15" src="http://pavel.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cspan%20style%3D%22color%3A%20rgb(0%2C%200%2C%200)%3B%22%3Eorg.springframework.jdbc.datasource.DriverManagerDataSource%3C%2Fspan%3E" quality="high" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
  1. <span style= "color: rgb(0, 0, 0);" >org.springframework.jdbc.datasource.DriverManagerDataSource</span>  
org.springframework.jdbc.datasource.DriverManagerDataSource

 

解决:

Xml代码 复制代码
  1. < bean   id = "dataSource"   class =" < SPAN  style=" BACKGROUND -COLOR: #ff6600" > org.springframework.jdbc.datasource.DriverManagerDataSource </ SPAN > " >   
  2.      < property   name = "driverClassName"   value = "oracle.jdbc.driver.OracleDriver" > </ property >   
  3.      < property   name = "url"   value = "jdbc:oracle:thin:@localhost:1521:orcl" > </ property >   
  4.      < property   name = "username"   value = "sys8" > </ property >   
  5.      < property   name = "password"   value = "sys8" > </ property >   
  6. </ bean >   

<script type="text/javascript">&lt;!-- google_ad_client = &quot;pub-4348265167276910&quot;; /* 468x60, 个人博客 */ google_ad_slot = &quot;2046406163&quot;; google_ad_width = 468; google_ad_height = 60; //--&gt; </script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script><script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"></script><script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"></script><script>google_protectAndRun(&quot;ads_core.google_render_ad&quot;, google_handleError, google_render_ad);</script>

分享到:
评论

相关推荐

    spring和hibernate整合

    在web.Xml中&lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; ... &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt; &lt;/listener&gt;

    ssh框架的搭建

    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;!-- Listener log4jConfigLocation --&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web....

    简单spring MVC 配置

    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;servlet&gt; &lt;servlet-name&gt;test&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet....

    jaxrs-api,javax.ws.rs.Path;

    &lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt; &lt;/listener&gt; &lt;servlet&gt; &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt; &lt;servlet-class&gt;org.jboss.resteasy....

    Spring MVC 框架应用实例

    org.springframework.web.context.ContextLoaderListener &lt;/listener-class&gt; &lt;/listener&gt; &lt;filter&gt; &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt; &lt;filter-class&gt; org.springframework.web.filter....

    生活轨迹SSH服务端

    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;!-- 默认找的文件名 --&gt; &lt;/listener&gt; &lt;!-- Context Configuration locations for Spring XML files --&gt; &lt;context...

    logback-ext-spring

    spring使用logback的扩展,使用起来非常方便。在web.xml中配置: ... &lt;listener-class&gt;ch.qos.logback.ext.spring.web.LogbackConfigListener&lt;/listener-class&gt; &lt;/listener&gt; 即可加载logback配置,使用logback。

    DOS命令使用方法(超全).

    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;!-- 利用spring监听 编码设置 --&gt; &lt;filter&gt; &lt;filter-name&gt;SpringCharacterEncodingFilter&lt;/...

    CXF WebService整合Spring示例工程代码demo

    &lt;listener-class&gt;org.springframework.web.util.IntrospectorCleanupListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;servlet&gt; &lt;servlet-name&gt;CXFService&lt;/servlet-name&gt; &lt;servlet-class&gt;org.apache.cxf.transport...

    springweb3.0MVC注解(附实例)

    &lt;bean class="org.springframework.web.servlet.mvc.annotation. AnnotationMethodHandlerAdapter"/&gt; &lt;!-- ③:对模型视图名称的解析,即在模型视图名称添加前后缀 --&gt; &lt;bean class="org.springframework.web....

    基于java的企业级应用开发:Spring的核心容器.ppt

    spring/applicationContext.xml &lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt; org.springframework.web.context.ContextLoaderListener &lt;/listener-class&gt; &lt;/listener&gt; ApplicationContext * * * *...

    cas 配置client 1.0 &2.0 及proxy DEMO 说明

    &lt;/listener-class&gt; &lt;/listener&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; 5 cas client 2.0 proxy 配置说明 proxy web.xml &lt;?xml version="1.0" ...

    javamelody.jar和 jrobin.jar

    监控器需要的jar,需在web.xml中配置&lt;filter&gt; &lt;filter-name&gt;monitoring&lt;/filter-name&gt; &lt;filter-class&gt;net.bull.javamelody.MonitoringFilter&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;...

    CAS客户端JAR包版本3.3.3

    &lt;filter-class&gt;org.jasig.cas.client.session.SingleSignOutFilter&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;CAS Single Sign Out Filter&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/...

    基于MyEclipse搭建maven+springmvc整合图文教程(含源码0

    &lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;!-- 字符集 过滤器 --&gt; &lt;filter&gt; &lt;filter-name&gt;CharacterEncodingFilter&lt;/filter-name&gt; &lt;filter-class...

    JSP Web.xml标准配置内容

    &lt;listener-class&gt;test.ListenerDemo&lt;/listener-class&gt; &lt;/listener&gt; &lt;!--定义了Web应用程序中会话的超时时限--&gt; &lt;session-config&gt; &lt;session-timeout&gt;10&lt;/session-timeout&gt; &lt;/session-config&gt;

    Axsis and XFire Demo src code

    一 使用Axis和XFire发布Web Service 1.1 准备工作 Axis主页: http://ws.apache.org/ Axis下载:http://archive.apache.org/dist/ws/ XFire主页:http://xfire.codehaus.org/ XFire下载:...

    Proxool-0.9.1

    proxool.0.9.1基础上做了修改。 改jar名称为:proxool-0.9.1.1... &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; 4.修正了proxool在多线程环境下的的错误。

    SSH第7章上机.zip ACCP8.0

    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; 在struts.xml中配置对象创建工具为spring &lt;constant name="struts.objectFactory" value="spring" /&gt;

    javamelogdy-1.51.0

    &lt;listener-class&gt;net.bull.javamelody.SessionListener&lt;/listener-class&gt; &lt;/listener&gt; 2、需监控的web工程引入依赖jar包 jira-javamelody.jar jrobin-1.5.9.1.jar 3、如果您的web项目有SpringSecurity,修改...

Global site tag (gtag.js) - Google Analytics