Error creating bean with name 'sqlMapClientBL3' defined in class path resource [config/global.dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [config/app/app.sqlmap.xml]; nested exception is org.powerise.bl3ee.core.orm.xibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: org.powerise.bl3ee.core.orm.xibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Document root element "sqlmap", must match DOCTYPE root "sqlMap".
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClientBL3' defined in class path resource [config/global.dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [config/app/app.sqlmap.xml]; nested exception is org.powerise.bl3ee.core.orm.xibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: org.powerise.bl3ee.core.orm.xibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Document root element "sqlmap", must match DOCTYPE root "sqlMap".
config/global.dao.xml这个文件错了,Document root element "sqlmap", must match DOCTYPE root "sqlMap".
还有就是把配置文件粘贴出来,不然不知道
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- 加载jdbc属性文件 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>jdbc.properties</value>
</list>
</property>
</bean>
<!-- =================== BL3EE平台数据源配置 ================== -->
<!-- Apache Commons DBCP 数据源 -->
<bean id="dataSourceBL3" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${bl3ee.jdbc.driverClassName}" />
<property name="url" value="${bl3ee.jdbc.url}" />
<property name="username" value="${bl3ee.jdbc.username}" />
<property name="password" value="${bl3ee.jdbc.password}" />
<property name="initialSize" value="1" />
<property name="maxActive" value="10" />
<property name="maxIdle" value="15" />
<property name="minIdle" value="5" />
<property name="removeAbandoned" value="true" />
<property name="removeAbandonedTimeout" value="18000" />
<property name="maxWait" value="10000" />
<property name="logAbandoned" value="true" />
</bean>
<!-- JNDI 数据源
<bean id="dataSourceBL3" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>bl3ee</value>
</property>
</bean>
-->
<!-- 配置平台层面的qlmapClientFactory -->
<bean id="sqlMapClientBL3" class="org.powerise.bl3ee.core.orm.xibatis.support.SqlMapClientFactoryBean">
<property name="configLocations">
<list>
<value>config/sys/sys.sqlmap.xml</value>
<value>config/app/app.sqlmap.xml</value>
</list>
</property>
<property name="dataSource" ref="dataSourceBL3" />
</bean>
<!-- 配置平台层面的BL3Reader -->
<bean id="bl3Reader" class="org.powerise.bl3ee.core.model.dao.impl.ReaderImpl">
<property name="sqlMapClient" ref="sqlMapClientBL3" />
</bean>
<!-- 配置平台层面的BL3Dao -->
<bean id="bl3Dao" class="org.powerise.bl3ee.core.model.dao.impl.DaoImpl">
<property name="sqlMapClient" ref="sqlMapClientBL3" />
</bean>
<!-- JDBC事务管理器配置 -->
<bean id="transactionManagerBL3" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref bean="dataSourceBL3" />
</property>
</bean>
<!-- 配置事务代理的基类 -->
<bean id="baseTransactionProxyBL3" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">
<property name="transactionManager">
<ref bean="transactionManagerBL3" />
</property>
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="do*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="insert*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="del*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="drop*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="update*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="edit*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="modify*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="call*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="batch*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="auto*">PROPAGATION_REQUIRES_NEW,-Exception</prop>
<prop key="*">PROPAGATION_SUPPORTS,-Exception</prop>
</props>
</property>
</bean>
这是配置的文件代码
Failed to parse config resource: class path resource [config/app/app.sqlmap.xml];config/app/app.sqlmap.xml这个配置文件不能初始化,之后又提示你
/sqlMapConfig/sqlMap,这个出错了,找的到吗,或是你的这个配置对吗,即你的ibatis配置的头对吗。
ibatis总配置文件(头)
<!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
ibatis的实体的配置文件 (头)
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">