2009-9-25 14:38:23 org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
Caused by: java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapClientFactoryBean.java:72)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.<clinit>(SqlMapClientFactoryBean.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
2009-9-25 14:38:23 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
Caused by: java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapClientFactoryBean.java:72)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.<clinit>(SqlMapClientFactoryBean.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)==============================================================web.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>struts2</display-name><filter>
<filter-name>characterEncoding</filter-name>
<filter-class>com.chinaventure.cvsource.util.filter.CharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>characterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping><filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter><filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping><context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/conf/applicationContext.xml,
/WEB-INF/conf/scheduler-context.xml
/WEB-INF/conf/service-context.xml
/WEB-INF/conf/dao-context.xml
</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<session-config>
<session-timeout>30</session-timeout>
</session-config> <resource-ref>
<res-ref-name>jdbc/CVSource81</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref><welcome-file-list>
<welcome-file>logon.jsp</welcome-file>
</welcome-file-list></web-app>
=================================================================applicationContext.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<!--
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://10.10.11.81:3306/cvsource?useUnicode=true&characterEncoding=UTF-8</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>root</value>
</property>
</bean>
-->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/CVSource81</value>
</property>
</bean>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>WEB-INF/conf/integration-sql-map-config.xml</value>
</property>
<!--
<property name="dataSource">
<ref bean="dataSource"/>
</property>
-->
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
</bean>
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="saveGroup">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="updateFunction">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveOrganizationStrategy">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="updateOrganizationStrategyInfo">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveFundStrategy">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="updateFundStrategyInfo">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveFundCollect">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<idref bean="groupService"/>
<idref bean="functionService"/>
<idref bean="organizationService"/>
<idref bean="fundService"/>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value>
</list>
</property>
</bean>
<bean class="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor">
<property name="transactionInterceptor" ref="transactionInterceptor"/>
</bean>
</beans>
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
Caused by: java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapClientFactoryBean.java:72)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.<clinit>(SqlMapClientFactoryBean.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
2009-9-25 14:38:23 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
Caused by: java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapClientFactoryBean.java:72)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.<clinit>(SqlMapClientFactoryBean.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)==============================================================web.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>struts2</display-name><filter>
<filter-name>characterEncoding</filter-name>
<filter-class>com.chinaventure.cvsource.util.filter.CharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>characterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping><filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter><filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping><context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/conf/applicationContext.xml,
/WEB-INF/conf/scheduler-context.xml
/WEB-INF/conf/service-context.xml
/WEB-INF/conf/dao-context.xml
</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<session-config>
<session-timeout>30</session-timeout>
</session-config> <resource-ref>
<res-ref-name>jdbc/CVSource81</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref><welcome-file-list>
<welcome-file>logon.jsp</welcome-file>
</welcome-file-list></web-app>
=================================================================applicationContext.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<!--
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://10.10.11.81:3306/cvsource?useUnicode=true&characterEncoding=UTF-8</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>root</value>
</property>
</bean>
-->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/CVSource81</value>
</property>
</bean>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>WEB-INF/conf/integration-sql-map-config.xml</value>
</property>
<!--
<property name="dataSource">
<ref bean="dataSource"/>
</property>
-->
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
</bean>
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="saveGroup">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="updateFunction">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveOrganizationStrategy">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="updateOrganizationStrategyInfo">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveFundStrategy">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="updateFundStrategyInfo">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="saveFundCollect">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<idref bean="groupService"/>
<idref bean="functionService"/>
<idref bean="organizationService"/>
<idref bean="fundService"/>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value>
</list>
</property>
</bean>
<bean class="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor">
<property name="transactionInterceptor" ref="transactionInterceptor"/>
</bean>
</beans>
解决方案 »
- web 开发jsp问题!!!!
- org.springframework.beans.factory.BeanCreationException
- jquery 单击事件 局部变量 越界 问题
- 配置struts 的数据源后找不到action的问题
- dwr和servlet怎么一起用
- script脚本问题!!!!!!!
- Jsp中如何实现不打开log文件,查找log文件中是否存在“导出成功”字符串?
- 怎样才能使dreamwear识别struts标签?
- 由javascript 定义的function 的调用的问题
- jsp中存取Blob類型數據﹖﹖﹖
- 关于ide IntelliJ IDEA 的问题
- 请问各位高手 公司对 Javaweb程序员的要求
---------------------------------------------------------------------------
创建bean实例化失败,应该是配置文件有问题!
Error creating bean with name 'sqlMapClient'
创建sqlMapClient的时候失败
Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.client.SqlMapClientBuilder
看看你的SqlMapClientBuilder的这个类或者类内部是不是出问题了
com.ibatis.sqlmap.client.SqlMapClientBuilder
导入
org.springframework.orm.ibatis.SqlMapClientFactoryBean
有错误或者什么的