- 浏览: 1527007 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (525)
- SEO (16)
- JAVA-EE-Hibernate (6)
- JAVA-EE-Struts (29)
- JAVA-EE-Spring (15)
- Linux (37)
- JAVA-SE (29)
- NetWork (1)
- CMS (14)
- Semantic Research (3)
- RIA-Flex (0)
- Ajax-Extjs (4)
- Ajax-Jquery (1)
- www.godaddy.com (0)
- SSH (34)
- JavaScript (6)
- SoftwareEngineer (9)
- CMMI (0)
- IDE-Myeclipse (3)
- PHP (1)
- Algorithm (3)
- C/C++ (18)
- Concept&Items (2)
- Useful WebSite (1)
- ApacheServer (2)
- CodeReading (1)
- Socket (2)
- UML (10)
- PowerDesigner (1)
- Repository (19)
- MySQL (3)
- SqlServer (0)
- Society (1)
- Tomcat (7)
- WebService (5)
- JBoss (1)
- FCKeditor (1)
- PS/DW/CD/FW (0)
- DesignPattern (11)
- WebSite_Security (1)
- WordPress (5)
- WebConstruction (3)
- XML|XSD (7)
- Android (0)
- Project-In-Action (9)
- DatabaseDesign (3)
- taglib (7)
- DIV+CSS (10)
- Silverlight (52)
- JSON (7)
- VC++ (8)
- C# (8)
- LINQ (1)
- WCF&SOA (5)
- .NET (20)
- SOA (1)
- Mashup (2)
- RegEx (6)
- Psychology (5)
- Stock (1)
- Google (2)
- Interview (4)
- HTML5 (1)
- Marketing (4)
- Vaadin (2)
- Agile (2)
- Apache-common (6)
- ANTLR (0)
- REST (1)
- HtmlAnalysis (18)
- csv-export (3)
- Nucth (3)
- Xpath (1)
- Velocity (6)
- ASP.NET (9)
- Product (2)
- CSS (1)
最新评论
-
lt26w:
理解成门面模式应该比较容易明白吧
FacadePattern-Java代码实例讲解 -
lt26w:
看下面的例子比较明白.
FacadePattern-Java代码实例讲解 -
javaloverkehui:
这也叫文档,别逗我行吗,也就自己看看。
HtmlCleaner API -
SE_XiaoFeng:
至少也应该写个注释吧。
HtmlCleaner API -
jfzshandong:
...
org.springframework.web.filter.CharacterEncodingFilter 配置
在使用SSH添加 <listener> <listener-class>org.springframework.web.context.C
- 博客分类:
- JAVA-EE-Spring
在使用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中定义
- < context-param >
- < param-name > contextConfigLocation </ param-name >
- < param-value > /WEB-INF/context/ApplicationContext-*.xml </ param-value >
- </ context-param >
- < SPAN style = "COLOR: #000000" > < listener >
- < listener-class > < SPAN style = "BACKGROUND-COLOR: #ff6600" > org.springframework.web.context.ContextLoaderListener </ SPAN > </ listener-class >
- </ listener > </ SPAN >
- < context-param >
- < param-name > contextConfigLocation </ param-name >
- < param-value > /WEB-INF/context/ApplicationContext-*.xml </ param-value >
- </ context-param >
- < span style = "color: rgb(0, 0, 0);" > < listener >
- < listener-class > < span style = "background-color: rgb(255, 102, 0);" > org.springframework.web.context.ContextLoaderListener </ span > </ listener-class >
- </ 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文件。发现错误产生在:
- < bean id = "dataSource" class =" < SPAN style=" COLOR : #000000; BACKGROUND-COLOR: #ff6600" > org.apache.commons.dbcp.BasicDataSource </ SPAN > " >
- < 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 >
- < bean id = "dataSource" class =" < span style=" color : rgb(0, 0, 0); background-color: rgb(255, 102, 0);" > org.apache.commons.dbcp.BasicDataSource </ span > " >
- < 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 >
<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是用的是:
- <SPAN style= "COLOR: #000000" >org.springframework.jdbc.datasource.DriverManagerDataSource</SPAN>
- <span style= "color: rgb(0, 0, 0);" >org.springframework.jdbc.datasource.DriverManagerDataSource</span>
org.springframework.jdbc.datasource.DriverManagerDataSource
解决:
- < bean id = "dataSource" class =" < SPAN style=" BACKGROUND -COLOR: #ff6600" > org.springframework.jdbc.datasource.DriverManagerDataSource </ SPAN > " >
- < 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 >
<script type="text/javascript"><!-- google_ad_client = "pub-4348265167276910"; /* 468x60, 个人博客 */ google_ad_slot = "2046406163"; google_ad_width = 468; google_ad_height = 60; //--> </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("ads_core.google_render_ad", google_handleError, google_render_ad);</script>
发表评论
-
找不到 org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
2010-03-15 13:21 3965import or ... -
Spring三种注入IOC注入方式
2010-03-10 09:46 6649Type1 接口注入 我们常常借助接口来将调用者与实现者分离 ... -
Spring中常用的hql查询方法(getHibernateTemplate())
2009-12-09 16:35 1008Spring中常用的hql查询方法(getHibernateT ... -
Spring源码分析-配置文件加载流程
2009-12-07 15:04 3348Spring配置文件加载流程 Spring配置文件 ... -
读Spring源代码之按图索骥(一)Context创建与配置文件加载
2009-12-07 13:57 1547Spring 和 Struts在web.xml中增加的配置 ... -
读Spring源代码之按图索骥(一)Context创建与配置文件加载
2009-12-07 13:56 1093Spring 和 Struts在web.xml中增加的配置 ... -
HTTP Status 404(The requested resource is not available)
2009-12-04 21:08 39260但是SSH中404不一定是以下错误! 是配置问题 HTTP S ... -
'dataSource': no matching editors or conversion strategy found
2009-12-04 19:42 3606the datasource property is look ... -
tomcat启动时出现的 严重: Error listenerStart
2009-12-04 16:15 1287最近看《WebWork.Spring.Hibernate 整 ... -
严重: Error filterStart-楼主竟然不给解决方案 = =
2009-12-04 16:14 2637今天在eclipse+myeclipse+tomcat5 ... -
org.springframework.web.filter.CharacterEncodingFilter 配置
2009-12-04 16:13 13821web.xml文件 <?xml version=&qu ... -
Spring2.0的包的说明
2009-12-04 16:12 1123Spring 压缩包目录说明 ... -
startup failed due to previous errors
2009-12-04 14:20 2623关键字: 异常,tomcat启动出错 ,xfire ,spri ... -
ApplicationContext.xml
2009-12-03 16:22 1199<?xml version="1.0" ...
相关推荐
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Listener log4jConfigLocation --> <listener> <listener-class>org.springframework.web....
-- 配置Hibernate的SessionFactory,用于在Servlet容器启动时初始化SessionFactory对象 --> <listener> <listener-class>org.springframework.orm.hibernate3.HibernateContextListener</listener-class> </listener...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> <!-- 默认找的文件名 --> </listener> <!-- Context Configuration locations for Spring XML files --> <context...
09. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 10. </listener> 11. 12. <servlet> 13. <servlet-name>spring</servlet-name> 14. <servlet-class>org.spring...
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <!-- Proxool 数据库连接池监听器 --> <listener> <listener-class>org.chinasb.framework.core.db....
org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- Struts2 ActionContext清理过滤器 --> <filter> <filter-name>struts-cleanup</filter-name> <filter-class> ...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ``` 3. **Hibernate配置**: - `hibernate.cfg.xml`:Hibernate的配置文件,包含数据库连接信息、实体类...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 配置编码过滤器 --> <filter> <filter-name>Spring character encoding filter</filter-name> ...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ``` 接着,集成Struts2。在项目中添加Struts2的库,包括struts2-core、struts2-spring-plugin等,以支持与...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.Action...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ... <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:META-...
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> </filter> <filter...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <filter> <filter-name>openSessionInViewFilter</filter-name> <filter-class>org.springframework....
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> 在struts.xml中配置对象创建工具为spring <constant name="struts.objectFactory" value="spring" />
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ``` - **字符集过滤器**:为了正确处理中文等非英文字符,需配置字符编码过滤器: ```xml <filter> ...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ``` 3. **字符编码过滤器**:确保请求和响应的字符编码一致,避免乱码问题。 ```xml <filter> <filter-...
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ``` - 设置Spring上下文配置文件的位置: ```xml <context-param> <param-name>...
org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- Struts2 Filter Dispatcher --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache....