关于Spring事务传播级别PROPAGATION_NESTED的问题

一年前记得做过Nested传播级别的测试,当时结果是同Spring文档上介绍的一致的,即通过创建Savepoint实现嵌套事务,达到内层事务若抛出异常(unchecked exception)则回滚到savepoint处,但不影响外层事务;外层事务的回滚会一起回滚内层事务;
现在碰到的问题是,内层事务抛出unchecked exception,按照上述逻辑应该会回滚内层事务提交的数据,即便外层事务提交的情况下,但测试结果并非如此,外层事务一提交,内层方法创建的数据仍然被提交(debug显示内层事务已调用rollback),不知道是哪地方出了错误,现将测试代码贴上,请大家帮忙分析!
[code="java"]
<?xml version="1.0" encoding="UTF-8"?>

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">

<bean id="orderDao" class="com.liuj.dao.hibernate.OrderHibernateDao" autowire="byType"/>    
<bean id="orderService" class="com.liuj.service.impl.OrderServiceImpl" autowire="byName"/>

<bean id="productDao" class="com.liuj.dao.hibernate.ProductHibernateDao" autowire="byType"/>    
<bean id="productService" class="com.liuj.service.impl.ProductServiceImpl" autowire="byName"/>


<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
    <property name="beanNames">
        <list>                          
            <!-- beanNames for system.deployTargetAdvisor -->
            <value>orderService</value>
            <value>productService</value>
        </list>
    </property>
    <property name="interceptorNames">
        <list>
            <value>system.transactionAdvisor</value>
        </list>
    </property>
</bean> 

<bean id="system.transactionAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
    <property name="advice" ref="system.transactionInterceptor"/>
    <property name="pointcut" ref="system.transactionPointcut"/>        
</bean>

<bean id="system.transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
    <property name="transactionManager"><ref bean="system.platformTransactionManager"/></property>
    <property name="transactionAttributes"> 
        <props> 
            <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> 
            <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>  
            <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
            <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop>
            <prop key="query*">PROPAGATION_REQUIRED,readOnly</prop>     
            <prop key="innerSave*">PROPAGATION_NESTED</prop>
            <prop key="*">PROPAGATION_REQUIRED</prop>
        </props> 
    </property>         
</bean> 
<bean id="system.transactionPointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut">
    <property name="patterns">
        <list>
            <value>com.liuj.service.OrderService.*</value>
            <value>com.liuj.service.ProductService.*</value>
        </list>
    </property>
</bean>     

<!-- Hibernate SessionFactory -->
<bean id="system.sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="system.datasource"/>
    <property name="annotatedClasses">
        <list>
            <value>com.liuj.model.Order</value>
            <value>com.liuj.model.Product</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            <prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
            <prop key="hibernate.max_fetch_depth">3</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
        </props>
    </property>
</bean>


<!-- Local DataSource that works in any environment --> 
<!-- 
<bean id="system.datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="driverClass" value="${jdbc.driverClassName}" />
    <property name="jdbcUrl" value="${jdbc.url}"/>
    <property name="user" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>    
    <property name="initialPoolSize" value="${jdbc.initialPoolSize}" /> 
    <property name="minPoolSize" value="${jdbc.minPoolSize}" />
    <property name="maxPoolSize" value="${jdbc.maxPoolSize}"/>
    <property name="idleConnectionTestPeriod" value="300" />
    <property name="breakAfterAcquireFailure" value="true" />
    <property name="checkoutTimeout" value="100000" />
</bean>
 -->

<bean id="system.datasource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
</bean>

<!--
-->


<bean id="system.propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:jdbc.properties</value>
        </list>
    </property> 
</bean>


[/code]
[code="java"]

public class OrderHibernateDao extends HibernateDaoSupport implements OrderDao {

public void save(Order order) {
    getHibernateTemplate().save(order);
}

}

public class ProductHibernateDao extends HibernateDaoSupport implements ProductDao {

public void save(Product product) {
    getHibernateTemplate().save(product);
}

}
public class OrderServiceImpl implements OrderService {

private ProductService productService;

private OrderDao orderDao;

public void setOrderDao(OrderDao orderDao) {
    this.orderDao = orderDao;
}

public void setProductService(ProductService productService) {
    this.productService = productService;
}

public void outerSave(Order order) {
    orderDao.save(order);
    try {
        productService.innerSave();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

}
public class ProductServiceImpl implements ProductService {

private ProductDao productDao;

public void setProductDao(ProductDao productDao) {
    this.productDao = productDao;
}

public void innerSave() {
    Product product = new Product();
    product.setName("inner product");
    productDao.save(product);
    if (true) {
        throw new RuntimeException("error happend");
    }
}

}
[/code]
测试代码如下
[code="java"]
public class OrderServiceTest extends DependencyInjectionSpringContextTests {

private OrderService orderService;

@Test
public void testSave() {
    Order order = new Order();
    order.setName("outer order");
    orderService.outerSave(order);
}

public void setOrderService(OrderService orderService) {
    this.orderService = orderService;
}

}
[/code]
按照我的理解,ProductService.innerSave()方法抛出了runtime exception,那么结果应该是Order被保存,Product被回滚,但实际测试结果显示两个对象都被保存(debug显示save point被创建,并被rollback), why???

3个回答

PROPAGATION_NESTED使用了一个单独的物理事务, 这个事务拥有多个可以回滚的保存点。这样部分回滚允许内部事务在它的作用域内触发一个回滚, 并且外部事务能够不受影响的继续。 这通常是对应于JDBC的保存点,所以只会在 JDBC 资源事务管理上起效 (具体请参见 Spring的DataSourceTransactionManager).而DataSourceTransactionManager只会对Spring Jdbc(即JdbcTemplate)或者ibatis等jdbc操作有效,你的配置里使用了hibernate的sessionFacotry来访问,所以不会有效果;

你引用了错误的system.platformTransactionManager

/**
* Execute within a nested transaction if a current transaction exists,
* behave like PROPAGATION_REQUIRED else. There is no analogous feature in EJB.
*

Note: Actual creation of a nested transaction will only work on specific
* transaction managers. Out of the box, this only applies to the JDBC
* DataSourceTransactionManager when working on a JDBC 3.0 driver.
* Some JTA providers might support nested transactions as well.
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
*/
NESTED(TransactionDefinition.PROPAGATION_NESTED);

参加源码里面的javadoc

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JTA使用Propagation.NESTED事务传播方式报错

# JTA使用Propagation.NESTED事务传播方式报错 spring boot配置JTA后,使用Propagation.NESTED事务传播方式,出现异常,切换其他传播方式代码正常。 <br/> 事务配置: A service: @Transactional @Override public void saveOrUpdate(Msg msg) { msgJDBCDAO.save(msg); MsgReceiver msgReceiver = new MsgReceiver(); msgReceiver.setId(msg.getMsgId()); msgReceiver.setMsgId(msg.getMsgId()); msgReceiver.setUserId(1000L); msgReceiver.setReadFlag(0); msgReceiver.setDeleteFlag(0); msgReceiverJDBCService.save(msgReceiver); } B service: @Transactional(propagation = Propagation.NESTED) @Override public void save(MsgReceiver msgReceiver) { msgReceiverJDBCDAO.save(msgReceiver); } <br/> <br/><br/><br/> ## 报错信息如下: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into t_msg_receiver values (?, ?, ?, ?, ?)]; SQL state [null]; error code [0]; Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31; nested exception is com.atomikos.jdbc.AtomikosSQLException: Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1442) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:632) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:861) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:916) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:926) at com.spring.boot.example.dao.jdbc.MsgReceiverJDBCDAO.save(MsgReceiverJDBCDAO.java:16) at com.spring.boot.example.dao.jdbc.MsgReceiverJDBCDAO$$FastClassBySpringCGLIB$$bdb85c72.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.spring.boot.example.dao.jdbc.MsgReceiverJDBCDAO$$EnhancerBySpringCGLIB$$6e56ffb6.save(<generated>) at com.spring.boot.example.service.jdbc.impl.MsgReceiverJDBCServiceImpl.save(MsgReceiverJDBCServiceImpl.java:21) at com.spring.boot.example.service.jdbc.impl.MsgReceiverJDBCServiceImpl$$FastClassBySpringCGLIB$$a40f40ea.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.spring.boot.example.service.jdbc.impl.MsgReceiverJDBCServiceImpl$$EnhancerBySpringCGLIB$$65349f92.save(<generated>) at com.spring.boot.example.service.jdbc.impl.MsgJDBCServiceImpl.saveOrUpdate(MsgJDBCServiceImpl.java:46) at com.spring.boot.example.service.jdbc.impl.MsgJDBCServiceImpl$$FastClassBySpringCGLIB$$a07b1dd9.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) at com.spring.boot.example.service.jdbc.impl.MsgJDBCServiceImpl$$EnhancerBySpringCGLIB$$ecf643bf.saveOrUpdate(<generated>) at com.spring.boot.example.service.MsgJDBCServiceTest.test(MsgJDBCServiceTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: com.atomikos.jdbc.AtomikosSQLException: Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31 at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:29) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:217) at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:122) at com.sun.proxy.$Proxy98.prepareStatement(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1555) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614) ... 63 more Caused by: com.atomikos.datasource.xa.session.InvalidSessionHandleStateException: Failed to suspend branch: XAResourceTransaction: 3139322E3136382E3232372E322E746D313537343036303233343835373030303031:3139322E3136382E3232372E322E746D31 at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.transactionSuspended(BranchEnlistedStateHandler.java:98) at com.atomikos.datasource.xa.session.TransactionContext.transactionSuspended(TransactionContext.java:94) at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:165) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:207) ... 67 more Caused by: com.mysql.cj.jdbc.MysqlXAException: XAER_INVAL: Invalid arguments (or unsupported command) at com.mysql.cj.jdbc.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:344) at com.mysql.cj.jdbc.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:329) at com.mysql.cj.jdbc.MysqlXAConnection.end(MysqlXAConnection.java:267) at com.atomikos.datasource.xa.XAResourceTransaction.xaSuspend(XAResourceTransaction.java:700) at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.transactionSuspended(BranchEnlistedStateHandler.java:94) ... 70 more Caused by: java.sql.SQLException: XAER_INVAL: Invalid arguments (or unsupported command) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764) at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) at

关于spring注解事务传播机制的REQUIRED和REQUIRES_NEW

这是有注解REQUIRED的方法: ``` @Transactional(propagation=Propagation.REQUIRES_NEW) public void updateUserRequired(int sid) { User user = new User(); User user1 = null; user1=getUserInfo("1", null); user.setID("1"); user.setNAME("w`````````````e"); user.setPASSWORD("32141221"); user1=getUserInfo("1", null); System.out.println(user1.getID()+" "+user1.getNAME()+" "+user1.getPASSWORD()); updateUser(user); user1=getUserInfo("1", null); System.out.println(user1.getID()+" "+user1.getNAME()+" "+user1.getPASSWORD()); requiredService.updateTeaRequired_new(); // throw new RuntimeException(); } ``` 这是有注解REQUIRES_NEW的方法: ``` @Transactional(propagation=Propagation.REQUIRES_NEW) public void updateTeaRequired_new(){ // TODO Auto-generated method stub userDao.updateTea(setTeacher()); throw new RuntimeException(); } ``` 如果REQUIRED的方法抛出runtime异常,REQUIRES_NEW不抛出异常,则REQUIRES_NEW提交,REQUIRED回滚。 但是反过来的话却是整体都回滚,这是为什么

spring事务传播异常,事务回滚异常

@Transactional(value="tx2",propagation=Propagation.REQUIRED)//也可以修改为REQUIRED @RequestMapping(value="/TranClass_never",method=RequestMethod.GET) @ResponseBody public void dba_test_never(){ for(int i=0;i<5;i++){ peod.insertPeo(i); } try{ del_never(3); }catch(Exception e){ e.printStackTrace(); } String qq=null; qq.equals(""); } @Transactional(value="tx2",propagation=Propagation.NEVER ) public void del_never(int i){ peod.insertPeo(100); String qq=null; qq.equals(""); peod.delPeo(i); peod.delPeo(i+1); } del_never方法的事务声明为NEVER,系统没有报NEVER的异常;将此方法事务声明为REQUIRES_NEW时,外层事务发生回滚时里面的事务也发生回滚(这两事务应该互不影响的,为什么会发生这种错误?);将此方法事务声明为NESTED时,且将dba_test_never方法中空指针异常的语句清除后,为什么del_never方法无法进行事务回滚?

spring 嵌套事务 的 加锁 问题

有两个service:ServiceA 和 ServiceB [code="java"] ServiceA { methodA() { methodB(); // do many other things ... } } ServiceB { methodB() { ... } } [/code] 现在的 问题是 如果 ServiceB 的 methodB 持有锁(比如 LockMode.UPGRADE),而 ServiceA 中的methodA 在调用 methodB后还要处理很多事情,如果它们在一个事务里就会导致methodB 持有锁过长时间。如果把methodB的传播行为设为PROPAGATION_REQUIRES_NEW的话,如果methodA失败rollback,methodB不会rollback,会产生脏数据。设为PROPAGATION_REQUIRES_NESTED因为是嵌套事务,应该也不会释放锁。 不知道有什么 好的方法可以减少 持锁时间,又可以保证methodA rollback 时,methodB也 rollback 。 先谢过! [b]问题补充:[/b] to joachimz "PROPAGATION_REQUIRED就好了呀,两者同一个事务" 那样的话锁在外部事务结束时才会释放,没有解决我的问题啊。 [b]问题补充:[/b] to joachimz 谢谢你的回复。 “methodB就是需要执行很长时间,怎么可能在没有锁的情况下执行,又有事务的支持呢?” methodB 持有锁,但是它执行的很短,调用它的methodA 会执行很多其他的事情,这样如果它们在一个事务里,methodA 的事务提交之后锁才会释放,锁是独占操作,时间太长影响并发操作了。

碰到个很小白的问题,希望各位大神给抽空解决下

今天试着搭建 struts1+spring+ibatis框架,结果在项目启动时就一直报错,下面是我的配置文件: <?xml version="1.0" encoding="GBK"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" > <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true" > <!-- oracle --> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:ORCL" /> <property name="username" value="wendy"/> <property name="password" value="123"/> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <bean id="sqlMapClientBase" abstract="true" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="/WEB-INF/config/sqlMapConfig.xml" /> <property name="dataSource" ref="com.shunde.spring.dataSource" /> </bean> <bean id="sqlMapClient" parent="sqlMapClientBase"></bean> <!-- 分页查询取总数据量使用 --> <bean id="sqlMapClientCount" parent="sqlMapClientBase"></bean> <!-- 分页查询取部分数据使用 --> <bean id="sqlMapClientPage" parent="sqlMapClientBase"></bean> <bean id="attributeSource" class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource"> <property name="properties"> <props> <!--PROPAGATION_REQUIRED是事务传播行为 如果当前没有事务,就创建一个事务;如果已经存在事务,则加入事务 --> <!-- -Exception指定事务回滚规则 方法内部出现java.lang.Exception及其子类异常事务会自动回滚 可以用逗号分隔多个回滚规则。“-”前缀强制回滚,“+”前缀指定提交(这允许即使抛出unchecked异常时也可以提交事务) --> <prop key="save*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="edit*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="add*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="init*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="delete*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="insert*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="update*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="create*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="getNext*">PROPAGATION_REQUIRED,-Exception</prop> <!--<prop key="query*">PROPAGATION_REQUIRED,readOnly</prop> --><prop key="transaction*">PROPAGATION_REQUIRED,-Exception</prop> </props> </property> </bean> <bean id="abstractTxDefinition" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" lazy-init="true"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="transactionAttributeSource"> <ref bean="attributeSource"/> </property> </bean> <bean id="stmStuInfoDaoImpl" class="com.ssi.sm.dao.impl.StmStuInfoDaoImpl"> <property name="sqlMapClient" ref="sqlMapClient" /> </bean> <bean id="stmStuInfoServiceTarget" class="com.ssi.sm.service.impl.StmStuInfoServiceImpl"> <property name="stmStuInfoDao" ref="stmStuInfoDaoImpl"/> </bean> <bean id="stmStuInfoServiceImpl" parent="abstractTxDefinition"> <property name="target" ref="stmStuInfoServiceTarget"/> </bean> <bean name="/stmStuInfoAction" class="com.ssi.sm.action.StmStuInfoAction"> <property name="stmStuInfoService" ref="stmStuInfoServiceImpl"/> </bean> </beans> 报的错是: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stmStuInfoServiceTarget' defined in ServletContext resource [/WEB-INF/config/transaction-define.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlMapClient' is required at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1068) at org.apache.catalina.core.StandardHost.start(StandardHost.java:822) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:759) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.lang.IllegalArgumentException: Property 'sqlMapClient' is required at org.springframework.orm.ibatis.SqlMapClientTemplate.afterPropertiesSet(SqlMapClientTemplate.java:147) at org.springframework.orm.ibatis.support.SqlMapClientDaoSupport.checkDaoConfig(SqlMapClientDaoSupport.java:108) at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 39 more

spring3与hibernate4整合session问题

[color=red][b]问题描述:[/b][/color] 整合spring3与hibernate4时,发生错误:[u]nested exception is org.hibernate.HibernateException: No Session found for current thread[/u] 之后查找资料,添加[u]:<prop key="hibernate.current_session_context_class">thread</prop>[/u]属性,报错:org.hibernate.HibernateException: createQuery is not valid without active transaction, 查找资料说,删除上面我添加的那个属性,我被陷入死循环了。 [color=red][b]代码如下[/b][/color] [b]配置文件:[/b] [code="java"] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:config/jdbc.properties</value> </list> </property> </bean> <!--数据源--> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>${mysql.driver}</value> </property> <property name="jdbcUrl"> <value>${mysql.url}</value> </property> <property name="user"> <value>${mysql.userName}</value> </property> <property name="password"> <value>${mysql.password}</value> </property> <property name="acquireIncrement"> <value>${c3p0.acquireIncrement}</value> </property> <property name="initialPoolSize"> <value>${c3p0.initialPoolSize}</value> </property> <property name="minPoolSize"> <value>${c3p0.minPoolSize}</value> </property> <property name="maxPoolSize"> <value>${c3p0.maxPoolSize}</value> </property> <property name="maxIdleTime"> <value>${c3p0.maxIdleTime}</value> </property> <property name="idleConnectionTestPeriod"> <value>${c3p0.idleConnectionTestPeriod}</value> </property> <property name="maxStatements"> <value>${c3p0.maxStatements}</value> </property> <property name="numHelperThreads"> <value>${c3p0.numHelperThreads}</value> </property> <property name="testConnectionOnCheckout"> <value>${c3p0.testConnectionOnCheckout}</value> </property> <property name="preferredTestQuery"> <value>${c3p0.preferredTestQuery}</value> </property> </bean> <!-- Session 工厂配置 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan"> <list> <value>com..entity</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <!-- 解决no session found --> <prop key="hibernate.current_session_context_class">thread</prop> </props> </property> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- 配置事物管理器,在*ServiceImpl里写@Transactional就可以启用事物管理 --> <tx:annotation-driven transaction-manager="transactionManager" /> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <!-- 方法对应的传播属性 --> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="create*" propagation="REQUIRED" /> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="merge*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="remove*" propagation="REQUIRED" /> <tx:method name="put*" propagation="REQUIRED" /> <tx:method name="use*" propagation="REQUIRED"/> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="count*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="list*" propagation="REQUIRED" read-only="true" /> <tx:method name="*" read-only="true" /> </tx:attributes> </tx:advice> <!-- 事务控制位置,一般在业务层service --> <aop:config> <aop:pointcut id="txPointcut" expression="execution(* com..service..*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/> </aop:config> </beans> [/code] [b]DAO[/b] [code="java"] package com.test; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; public class BaseDao { @Autowired private SessionFactory sessionFactory; public Session getCurrentSession() { return sessionFactory.getCurrentSession(); } } [/code] [code="java"] package com.test.dao.impl; import java.util.List; import org.hibernate.Query; import org.springframework.stereotype.Repository; import com.test.BaseDao; import com.test.dao.IUserDao; import com.test.entity.User; @Repository public class UserDaoImpl extends BaseDao implements IUserDao{ @SuppressWarnings("unchecked") @Override public List<User> findAllUsers() { String hql = "FROM User"; Query query = getCurrentSession().createQuery(hql); return query.list(); } } [/code] 各层次的ioc都OK的,问题出在哪里,或者解答下原因也可以,我自己查找资料,谢谢了。

apringtask项目使用ssm框架但是并没有使用到mvc项目运行后报很多错 是配置文件有问题嚒

//这是spring-mybatis配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!-- 开启注解配置 --> <context:annotation-config /> <!-- 把SqlSessionFactory交给spring管理 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- 注入数据源 --> <property name="dataSource" ref="dataSource"/> <!-- 注入mybatis配置文件路径 --> <property name="configLocation" value="classpath:mybatis-config.xml" /> <!-- 注入映射文件 mapper/*.xml --> <property name="mapperLocations" value="classpath:com/zznode/qoe/task/mapper/*.xml"></property> </bean> <context:property-placeholder location="classpath:db.properties" ignore-unresolvable="true"/> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driver}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <!--initialSize: 初始化连接--> <property name="initialSize" value="5"/> <!--maxIdle: 最大空闲连接--> <property name="maxIdle" value="10"/> <!--minIdle: 最小空闲连接--> <property name="minIdle" value="5"/> <!--maxActive: 最大连接数量--> <property name="maxActive" value="50"/> <!--removeAbandoned: 是否自动回收超时连接--> <property name="removeAbandoned" value="true"/> <!--removeAbandonedTimeout: 超时时间(以秒数为单位)--> <property name="removeAbandonedTimeout" value="300"/> <!--maxWait: 超时等待时间以毫秒为单位 6000毫秒/1000等于60秒--> <property name="maxWait" value="3000"/> <property name="validationQuery" value="SELECT 1" /> <property name="testOnBorrow" value="true"/> </bean> <!-- 事务管理 transaction manager, use JtaTransactionManager for global tx --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 配置事务拦截器和传播属性 --> <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager" ref="transactionManager" /> <property name="transactionAttributes"> <props> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="query*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="submit*">PROPAGATION_REQUIRED</prop> <prop key="create*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="insert*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="update*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="modify*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="delete*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="remove*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="do*">PROPAGATION_REQUIRED</prop> <prop key="execute*">PROPAGATION_REQUIRED</prop> <prop key="exe*">PROPAGATION_REQUIRED</prop> <prop key="backup">PROPAGATION_REQUIRED,-Exception</prop> <prop key="rollback">PROPAGATION_REQUIRED,-Exception</prop> <prop key="calculate">PROPAGATION_REQUIRED,-Exception</prop> <prop key="batchInsert">PROPAGATION_REQUIRED,-Exception</prop> <prop key="batchUpdate">PROPAGATION_REQUIRED,-Exception</prop> </props> </property> </bean> <!-- Mapper接口所在包名,Spring会自动查找其下的Mapper 不用再配置mapper扫描--> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.zznode.qoe.task.mapper" /> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> </bean> </beans> ``` 报错如下: 01-Apr-2019 10:56:58.839 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 01-Apr-2019 10:56:58.930 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started 01-Apr-2019 10:56:59.219 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Mon Apr 01 10:56:59 CST 2019]; root of context hierarchy 01-Apr-2019 10:56:59.324 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [spring.xml] 01-Apr-2019 10:56:59.632 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [spring-mybatis.xml] 01-Apr-2019 10:56:59.682 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [jobs.xml] 01-Apr-2019 10:57:00.297 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [spring-mybatis.xml] 01-Apr-2019 10:57:00.694 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'mtMonitorServerInfoMapper' and 'com.zznode.qoe.task.mapper.MtMonitorServerInfoMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.697 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'mtServerAlarmMapper' and 'com.zznode.qoe.task.mapper.MtServerAlarmMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.697 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'newTbResultMapper' and 'com.zznode.qoe.task.mapper.NewTbResultMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.698 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'sysAuthInfoMapper' and 'com.zznode.qoe.task.mapper.SysAuthInfoMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.703 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'sysMailUserInfoMapper' and 'com.zznode.qoe.task.mapper.SysMailUserInfoMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.706 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'sysMonitorServerAttrMapper' and 'com.zznode.qoe.task.mapper.SysMonitorServerAttrMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.707 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'sysMonitorServerMapper' and 'com.zznode.qoe.task.mapper.SysMonitorServerMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.708 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbBssUserMapper' and 'com.zznode.qoe.task.mapper.TbBssUserMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.708 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbCbssUserMapper' and 'com.zznode.qoe.task.mapper.TbCbssUserMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.708 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbDistributionMapper' and 'com.zznode.qoe.task.mapper.TbDistributionMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.709 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbresultMapper' and 'com.zznode.qoe.task.mapper.TbresultMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.709 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbSpeedUserCountMapper' and 'com.zznode.qoe.task.mapper.TbSpeedUserCountMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.710 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbUploadFileInfoMapper' and 'com.zznode.qoe.task.mapper.TbUploadFileInfoMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.711 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate Skipping MapperFactoryBean with name 'tbWordbookMapper' and 'com.zznode.qoe.task.mapper.TbWordbookMapper' mapperInterface. Bean already defined with the same name! 01-Apr-2019 10:57:00.711 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.mybatis.spring.mapper.ClassPathMapperScanner.doScan No MyBatis mapper was found in '[com.zznode.qoe.task.mapper]' package. Please check your configuration. 01-Apr-2019 10:57:00.745 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PropertySourcesPlaceholderConfigurer.loadProperties Loading properties file from class path resource [db.properties] 01-Apr-2019 10:57:00.760 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PropertySourcesPlaceholderConfigurer.loadProperties Loading properties file from class path resource [config.properties] 01-Apr-2019 10:57:00.767 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PropertySourcesPlaceholderConfigurer.loadProperties Loading properties file from class path resource [db.properties] 01-Apr-2019 10:57:00.929 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'dataSource' of type [class org.apache.commons.dbcp.BasicDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.671 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sqlSessionFactory' of type [class org.mybatis.spring.SqlSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.672 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sqlSessionFactory' of type [class org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.684 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'mtMonitorServerInfoMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.686 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'mtServerAlarmMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.688 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'newTbResultMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.691 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sysAuthInfoMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.694 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sysMailUserInfoMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.695 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sysMonitorServerAttrMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.697 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sysMonitorServerMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.699 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbBssUserMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.703 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbCbssUserMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.707 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbDistributionMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.710 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbresultMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.714 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbSpeedUserCountMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.715 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbUploadFileInfoMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:01.717 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'tbWordbookMapper' of type [class org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 01-Apr-2019 10:57:02.421 璀﹀憡 [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hbServerMonitoJob' defined in file [E:\ZHIZHEN\springtask\springtask\target\spring-task\WEB-INF\classes\com\zznode\qoe\task\control\HbServerMonitoJob.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zznode.qoe.task.control.HbServerMonitoJob]: Constructor threw exception; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ```

controller中获得hibernate的session方法

环境:Spring+Hibernate,事务由org.springframework.orm.hibernate4.HibernateTransactionManager管理 需求是这样的,带有@Transactional注解的Service类中有两个方法: 1. check()----用来验证数据 2. insert()----用来插入数据 我想在controller方法中显式声明一个事物并把check()和insert()放入这个事务中,代码如下 ``` Session session = transactionManager.getSessionFactory().openSession();//**1** //Session session = transactionManager.getSessionFactory().getCurrentSession();//**2** Transaction tx = session.beginTransaction();//手动开启事务 try{ check(); insert(); tx.commit(); }catch(Exception e){ tx.rollback(); } ``` 现在问题来了,在使用由1标注的方法获取session是可以的,但是用2方法会报 org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: nested transactions not supported 这是什么原因呢?难道进入service必须另外开启事务?

ssh中spring的配置加上事务配置后就出错,恳请大家帮忙

出错信息: 2011-3-27 20:15:08 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\java\bin;D:\Program Files\Tomcat 5.5\bin 2011-3-27 20:15:08 org.apache.coyote.http11.Http11BaseProtocol init 信息: Initializing Coyote HTTP/1.1 on http-1688 2011-3-27 20:15:08 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 406 ms 2011-3-27 20:15:08 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2011-3-27 20:15:08 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/5.5.16 2011-3-27 20:15:08 org.apache.catalina.core.StandardHost start 信息: XML validation disabled 2011-03-27 20:15:09,062 INFO [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/SSHExt]] - Initializing Spring root WebApplicationContext 2011-03-27 20:15:09,062 INFO [org.springframework.web.context.ContextLoader] - Root WebApplicationContext: initialization started 2011-03-27 20:15:09,203 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - Refreshing Root WebApplicationContext: startup date [Sun Mar 27 20:15:09 CST 2011]; root of context hierarchy 2011-03-27 20:15:09,359 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] 2011-03-27 20:15:09,593 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1112) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at org.springframework.transaction.config.TxAdviceBeanDefinitionParser.getBeanClass(TxAdviceBeanDefinitionParser.java:69) at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:66) at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ... 37 more 2011-03-27 20:15:09,593 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/SSHExt]] - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1112) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at org.springframework.transaction.config.TxAdviceBeanDefinitionParser.getBeanClass(TxAdviceBeanDefinitionParser.java:69) at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:66) at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ... 37 more 2011-3-27 20:15:09 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 2011-3-27 20:15:09 org.apache.catalina.core.StandardContext start 严重: Context [/SSHExt] startup failed due to previous errors 2011-03-27 20:15:09,593 INFO [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/SSHExt]] - Closing Spring root WebApplicationContext 2011-3-27 20:15:09 org.apache.coyote.http11.Http11BaseProtocol start 信息: Starting Coyote HTTP/1.1 on http-1688 2011-3-27 20:15:09 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2011-3-27 20:15:09 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/47 config=null 2011-3-27 20:15:09 org.apache.catalina.storeconfig.StoreLoader load 信息: Find registry server-registry.xml at classpath resource 2011-3-27 20:15:09 org.apache.catalina.startup.Catalina start 信息: Server startup in 1703 ms spring的配置信息如下: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" 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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- 配置数据库连接池 --> <!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>oracle.jdbc.OracleDriver</value> </property> <property name="url"> <value>jdbc:oracle:thin:@localhost:1521:orcl</value> </property> <property name="password"> <value>orcl</value> </property> <property name="username"> <value>yhj</value> </property> </bean> <property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property> <property name="connection.url">jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=hibernate</property> --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>net.sourceforge.jtds.jdbc.Driver</value> </property> <property name="url"> <value>jdbc:jtds:sqlserver://127.0.0.1:1433;databaseName=sshtest</value> </property> <property name="password"> <value>sa</value> </property> <property name="username"> <value>sa</value> </property> </bean> <!-- <property name="connection.url"> jdbc:sqlserver://127.0.0.1:1433;databaseName=HTSiteSrv </property> <property name="connection.username">sa</property> <property name="connection.password">sa</property> <property name="connection.driver_class"> com.microsoft.sqlserver.jdbc.SQLServerDriver </property> --> <!-- 配置sessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource"/> </property> <property name="mappingResources"> <list> <value>UserTab.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>--> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <!--AOP的事务管理 --> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!--传播特性 --> <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="get*" read-only="true" /> <tx:method name="search*" read-only="true" /> </tx:attributes> </tx:advice> <!--配置事务管理器应用的范围 --> <aop:config> <aop:pointcut id="userServiceMethods" expression="execution(*com.ssh.test.dao.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="userServiceMethods" /> </aop:config> <!-- dao配置 --> <bean id="userDao" class="com.ssh.test.dao.UserDao" scope="prototype"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- 业务层配置 --> <bean id="userManageBusiness" class="com.ssh.test.business.UserManageBusiness" scope="prototype"> <property name="userDao"> <ref bean="userDao" /> </property> </bean> <!-- action配置 --> <bean id="loginAction" class="com.ssh.test.action.LoginAction" scope="prototype"> </bean> <bean id="userManageAction" class="com.ssh.test.action.UserManageAction" scope="prototype"> <property name="userManageBusiness"> <ref bean="userManageBusiness" /> </property> </bean> <bean id="deptManageAction" class="com.ssh.test.action.DeptManageAction" scope="prototype"> </bean> </beans> 去掉事务的配置就好,但是加上了就错,大家给力啊

数据库连接错误

项目架构struts2+hibernate+spring有一个每隔一秒的spring定时器执行数据库的增删改查操作 事物配置如下: <!-- 指定事务管理器 --> <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" /> <!-- 配置事务的传播特性 --> <aop:config proxy-target-class="true"> <!-- 配置一个切入点,匹配dao包下 所有以Impl结尾的类的所有方法的执行 --> <aop:advisor pointcut="execution(* *..*DaoImpl.*(..))" advice-ref="txAdvice" /> <!-- 指定在txAdvice切入点应用txAdvice事务切面 --> </aop:config> <tx:advice id="txAdvice"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="query*" read-only="true" /> <tx:method name="find*" read-only="true"/> <tx:method name="get*" read-only="true"/> <tx:method name="execute*" propagation="REQUIRED"/> <tx:method name="*" propagation="REQUIRED"/> </tx:attributes> </tx:advice> 当使用此配置时(定时任务执行一段时间后)出现如下异常: Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" java.lang.OutOfMemoryError: Java heap space 当使用如下配置时: <!-- 指定事务管理器 --> <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" /> <!-- 配置事务的传播特性 --> <aop:config proxy-target-class="true"> <!-- 配置一个切入点,匹配dao包下 所有以Impl结尾的类的所有方法的执行 --> <aop:advisor pointcut="execution(* com.lyn.job.company.service.impl.UpCompanyMatchManagerServiceImpl.*(..))" advice-ref="txAdvice" /> <!-- 指定在txAdvice切入点应用txAdvice事务切面 --> </aop:config> <tx:advice id="txAdvice"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="query*" read-only="true" /> <tx:method name="find*" read-only="true"/> <tx:method name="get*" read-only="true"/> <tx:method name="execute*" propagation="REQUIRED"/> <tx:method name="*" propagation="REQUIRED"/> </tx:attributes> </tx:advice> 注:此配置事物直接指定到了定时器的service层,但是定时任务执行一段时间后程序报如下错误: 2012-07-30 09:51:19,716 ERROR [org.quartz.core.ErrorLogger] - [Job (DEFAULT.upCompanyMatchJobDetail threw an exception.] org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection] at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534) Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:596) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:354) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:103) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625) at com.lyn.job.company.service.impl.UpCompanyMatchManagerServiceImpl$$EnhancerByCGLIB$$a5f981c9.match(<generated>) at com.lyn.job.company.UpCompanyMatchJob.execute(UpCompanyMatchJob.java:20) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ... 1 more Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354) at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:555) ... 11 more Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 16 more Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 19 more 急求指点,万分感谢!

启动服务器如下错误求助求助

启动服务器报错。idea中使用的maven ``` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [spring/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:116) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4900) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5363) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1730) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetPublicMethods(Class.java:2902) at java.lang.Class.getMethods(Class.java:1615) ``` 配置文件 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd"> <!-- 数据库连接池 --> <!-- 加载配置文件 --> <context:property-placeholder location="classpath:properties/*.properties" /> <!-- 数据库连接池 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close"> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="driverClassName" value="${jdbc.driver}" /> <property name="maxActive" value="10" /> <property name="minIdle" value="5" /> </bean> <!-- 让spring管理sqlsessionfactory 使用mybatis和spring整合包中的 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- 数据库连接池 --> <property name="dataSource" ref="dataSource" /> <!-- 加载mybatis的全局配置文件 --> <property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml" /> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.taotao.mapper" /> </bean> <!--service层--> <!-- 包扫描器,扫描带@Service注解的类 --> <context:component-scan base-package="com.taotao.service"/> <!--事务层--> <!-- 事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <!-- 数据源 --> <property name="dataSource" ref="dataSource" /> </bean> <!-- 通知 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <!-- 传播行为 --> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="create*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="find*" propagation="SUPPORTS" read-only="true" /> <tx:method name="select*" propagation="SUPPORTS" read-only="true" /> <tx:method name="get*" propagation="SUPPORTS" read-only="true" /> </tx:attributes> </tx:advice> <!-- 切面 --> <aop:config> <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.taotao.service.*.*(..))" /> </aop:config> </beans> ```

spring与quartz 整合报错

<p>帮忙看看这个是什么问题,谢谢</p> <pre name="code" class="java">public class MyTaskService { public void run(){ System.out.println("任务开始了!"); } } </pre> <p> </p> <p>applicationContext.xml:</p> <pre name="code" class="java">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"&gt; &lt;!--dataSource数据源--&gt; &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt; &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/&gt; &lt;property name="url" value="jdbc:oracle:thin:@192.168.0.201:1521:osap"/&gt; &lt;property name="username" value="webadmin"/&gt; &lt;property name="password" value="123456"/&gt; &lt;/bean&gt; &lt;!--配置sessin工厂--&gt; &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt; &lt;property name="dataSource"&gt; &lt;ref local="dataSource" /&gt; &lt;/property&gt; &lt;property name="hibernateProperties"&gt; &lt;props&gt; &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.Oracle9Dialect&lt;/prop&gt; &lt;!-- 设置二级缓冲 --&gt; &lt;prop key="hibernate.cache.provider_class"&gt; org.hibernate.cache.EhCacheProvider &lt;/prop&gt; &lt;!-- 设置二级缓冲,打开查询缓冲 --&gt; &lt;prop key="hibernate.cache.use_query_cache"&gt;true&lt;/prop&gt; &lt;!-- 设置显示Hibernate操作的SQL语句 --&gt; &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;property name="mappingDirectoryLocations"&gt; &lt;list&gt; &lt;value&gt; classpath:/com/solex/sysmanage/model/config &lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!--给DAO注入sessionFactory--&gt; &lt;bean id="dao" class="com.solex.sysmanage.dao.impl.BaseDaoImpl"&gt; &lt;property name="sessionFactory"&gt; &lt;ref local="sessionFactory"/&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!--基础的服务类--&gt; &lt;bean id="baseDao" class="com.solex.sysmanage.service.impl.BaseServiceImpl"&gt; &lt;property name="baseDao"&gt; &lt;ref local="dao"/&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!--自定义服务类--&gt; &lt;bean id="manageService" class="com.solex.sysmanage.service.impl.ManageServiceImpl"&gt; &lt;property name="baseDao"&gt; &lt;ref local="dao" /&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!--给interceptor注入事务--&gt; &lt;bean id="interceptor" class="com.solex.sysmanage.web.LoginInterceptor"&gt; &lt;property name="manageService"&gt; &lt;ref local="manageService" /&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!-- 配置事务管理器 --&gt; &lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt; &lt;property name="sessionFactory"&gt; &lt;ref local="sessionFactory"/&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!--监听器的test--&gt; &lt;bean id="myTask" class="com.solex.sysmanage.service.impl.MyTaskService"&gt; &lt;/bean&gt; &lt;bean id="scheduledReportJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"&gt; &lt;property name="targetObject"&gt; &lt;ref bean="myTask" /&gt; &lt;/property&gt; &lt;property name="targetMethod"&gt; &lt;value&gt;run&lt;/value&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="cronReportTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"&gt; &lt;property name="jobDetail"&gt; &lt;ref bean="scheduledReportJobDetail" /&gt; &lt;/property&gt; &lt;property name="cronExpression"&gt; &lt;value&gt;0 * * * *&lt;/value&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"&gt; &lt;property name="triggers"&gt; &lt;list&gt; &lt;ref bean="cronReportTrigger" /&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!-- 配置事务特性 ,配置add、delete和update开始的方法,事务传播特性为required--&gt; &lt;tx:advice id="txAdvice" transaction-manager="transactionManager"&gt; &lt;tx:attributes&gt; &lt;tx:method name="insert*" propagation="REQUIRED"/&gt; &lt;tx:method name="save*" propagation="REQUIRED"/&gt; &lt;tx:method name="delete*" propagation="REQUIRED"/&gt; &lt;tx:method name="update*" propagation="REQUIRED"/&gt; &lt;tx:method name="*" read-only="true"/&gt; &lt;/tx:attributes&gt; &lt;/tx:advice&gt; &lt;!-- 配置那些类的方法进行事务管理,当前cn.com.jobedu.oa.service包中的子包、类中所有方法需要,还需要参考tx:advice的设置 --&gt; &lt;aop:config&gt; &lt;aop:pointcut id="allManagerMethod" expression="execution (* com.solex.sysmanage.service.*.*(..))"/&gt; &lt;aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/&gt; &lt;/aop:config&gt; &lt;/beans&gt;</pre> <p>   </p> <p> </p> <p> </p> <p>报告代码:</p> <pre name="code" class="java">org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cronReportTrigger' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'cronExpression' threw exception; nested exception is java.text.ParseException: Unexpected end of expression. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1277) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'cronExpression' threw exception; nested exception is java.text.ParseException: Unexpected end of expression. at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1274) ... 40 more</pre> <p> </p>

SSHpersistence.xml和beans.xml配置遇到错误求救

配置文件persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="Gloomy" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" /> <property name="hibernate.max_fetch_depth" value="3" /> <property name="hibernate.hbm2ddl.auto" value="update" /> <property name="hibernate.jdbc.fetch_size" value="18" /> <property name="hibernate.jdbc.batch_size" value="10" /> <property name="hibernate.show_sql" value="true" /> <property name="hibernate.format_sql" value="true" /> </properties> </persistence-unit> </persistence> 配置文件bean.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 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.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <aop:aspectj-autoproxy /> <context:annotation-config></context:annotation-config> <context:component-scan base-package="com.gloomy" /> <!-- 加载数据库属性配置文件 --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:jdbc.properties</value> </property> </bean> <!-- 配置数据源 --> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp2.BasicDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <!-- session工厂 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <!-- 自动扫描注解方式配置的hibernate类文件 --> <property name="packagesToScan"> <list> <value>com.gloomy.model</value> </list> </property> </bean> <!-- 配置实体管理工厂 --> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <!-- <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /> --> <property name="persistenceUnitName" value="Gloomy" /> <property name="loadTimeWeaver"> <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" /> </property> </bean> <!-- 配置事务管理 --> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <!-- 配置事务通知属性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <!-- 定义事务传播属性 --> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="edit*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="new*" propagation="REQUIRED" /> <tx:method name="set*" propagation="REQUIRED" /> <tx:method name="remove*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="change*" propagation="REQUIRED" /> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="load*" propagation="REQUIRED" read-only="true" /> <tx:method name="*" propagation="REQUIRED" read-only="true" /> </tx:attributes> </tx:advice> <!-- 配置事务切面 --> <aop:config> <aop:pointcut id="serviceOperation" expression="execution(* com.bufoon.service.*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" /> </aop:config> </beans> 报错信息: 警告: Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: Gloomy] Unable to build Hibernate SessionFactory Caused by: javax.persistence.PersistenceException: [PersistenceUnit: Gloomy] Unable to build Hibernate SessionFactory Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [alter table tb_order add constraint FKt9x5bn0a6216tfqg5udhfyhn4 foreign key (productno) references tb_producttype (producttypename)] Caused by: java.sql.SQLException: Cannot add foreign key constraint

Cannot open connection

HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" 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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- 加载jdbc.properties文件 --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:jdbc.properties</value> </property> </bean> <!-- 定义数据源 --> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" ></property> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <!-- 配置sessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.autoReconnect">true</prop> </props> </property> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- 配置事务的传播特性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="query*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="*" read-only="true" /> </tx:attributes> </tx:advice> <!-- 那些类的哪些方法参与事务 --> <aop:config> <aop:pointcut id="allManagerMethod" expression="execution(* cn.ittx.service.impl.*.*(..))" /> <aop:advisor pointcut-ref="allManagerMethod" advice-ref="txAdvice" /> </aop:config> </beans>

ssm框架连接配置applicationContext.xml运行时报错

**严重: 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 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory** at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:116) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844) **Caused by: java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory** at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119) at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3144) at java.base/java.lang.Class.getMethods(Class.java:1863) at org.springframework.beans.ExtendedBeanInfoFactory.supports(ExtendedBeanInfoFactory.java:54) at org.springframework.beans.ExtendedBeanInfoFactory.getBeanInfo(ExtendedBeanInfoFactory.java:46) at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:275) at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:188) at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:327) at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:359) at org.springframework.beans.BeanWrapperImpl.isWritableProperty(BeanWrapperImpl.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1458) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ... 24 more **Caused by: java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSessionFactory** at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119) ... 38 more db.properties文件,mysql8.0 ``` jdbc_username=root jdbc_password=aaa jdbc_driver=com.mysql.cj.jdbc.Driver jdbc_url=jdbc\:mysql\://localhost\:3306/aaaaa_db?useSSL\=false&serverTimezone\=GMT ``` applicationContext.xml代码如下 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <!-- 配置扫描包 --> <context:component-scan base-package="com.ls.dao"/> <context:component-scan base-package="com.ls.service"/> <!-- 数据库连接相关配置 --> <!-- 加载配置文件 --> <context:property-placeholder location="classpath:conf/db.properties" /> <!-- 数据库连接池 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close"> <property name="url" value="${jdbc_url}" /> <property name="username" value="${jdbc_username}" /> <property name="password" value="${jdbc_password}" /> <property name="driverClassName" value="${jdbc_driver}" /> <property name="maxActive" value="10" /> <property name="minIdle" value="5" /> </bean> <!-- 配置mybatis的sqlSessionFactory --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!-- 配置自动扫描mapper.xml文件 --> <property name="mapperLocations" value="classpath:com/ls/mapper/*.xml"/> <!-- mybatis的配置文件 --> <property name="configLocation" value="classpath:mybatis-config.xml"/> </bean> <!-- Dao接口所在包名,Spring会自动查找其下的类 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.ls.dao"/> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <!-- 配置事务管理器管理哪些方法 --> <!-- 配置事务通知属性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <!-- 定义事务传播属性 --> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="upd*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="query*" propagation="REQUIRED" read-only="true" /> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="*" propagation="REQUIRED" read-only="true" /> </tx:attributes> </tx:advice> <!-- 配置具体那些包下面的那些类下面的那些方法进行事务管理器 --> <aop:config> <aop:pointcut id="servicePoint" expression="execution(* com.service.*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="servicePoint"/> </aop:config> </beans> ```

s2sh整合问题,弄了一天了都没弄出来,拜托大家了!

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [C:\Program Files\apache-tomcat-6.0.28\webapps\System\WEB-INF\classes\applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2722) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at org.springframework.transaction.config.TxAdviceBeanDefinitionParser.getBeanClass(TxAdviceBeanDefinitionParser.java:69) at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:66) at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ... 37 more Caused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 55 more 配置文件代码:web.xml [code="java"]<?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"> <!-- 开始监听 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 配置spring监听器 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:*Context.xml</param-value> </context-param> <filter> <filter-name>openSessionInView</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>sessionFactory</param-value> </init-param> </filter> <filter-mapping> <filter-name>openSessionInView</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- <filter> <filter-name>lazyLoadingFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>singleSession</param-name> <param-value>false</param-value> </init-param> </filter> <filter-mapping> <filter-name>lazyLoadingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> --> <!-- 配置OpenSessionInViewFilter,必须在struts,用来解决could not initialize proxy-no Session报错问题,配置自己写的filter --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- <listener> <listener-class>com.hyit.ttmsoge.listener.FactoryLoaderListener</listener-class> </listener> --> <welcome-file-list> <welcome-file>Login.html</welcome-file> </welcome-file-list> </web-app> [/code] applicationContext: [code="java"]<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" 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-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"> </property> <property name="url" value="jdbc:mysql://localhost:8080/ttmsoge"> </property> <property name="username" value="root"></property> <property name="password" value="0429"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> </props> </property> <property name="mappingResources"> <list> <value>com/hyit/ttmsoge/model/Register.hbm.xml</value> <value>com/hyit/ttmsoge/model/User.hbm.xml</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 配置Advice(事务的传播特性) --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="get*" propagation="SUPPORTS" read-only="true" /> <tx:method name="search*" propagation="SUPPORTS" read-only="true" /> </tx:attributes> </tx:advice> </beans> [/code]

ssh框架,连接SQLServer2000 出错

<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>spring管理hibernate4,连接SQLServer2000时,提示<br>Transaction not successfully started</p> <p> </p> <pre name="code" class="java">Messages: Transaction not successfully started Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: Transaction not successfully started File: org/hibernate/engine/transaction/spi/AbstractTransactionImpl.java Line number: 170 Stacktraces org.springframework.transaction.TransactionSystemException: Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: Transaction not successfully started org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:472) org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:392) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) $Proxy16.createQuery(Unknown Source) cn.com.service.impl.BaseService.createQuery(BaseService.java:55) cn.com.action.NewsAction.getNews1OneNewsTop30(NewsAction.java:123) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source) org.hibernate.TransactionException: Transaction not successfully started org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:170) org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:468) org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:392) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) $Proxy16.createQuery(Unknown Source) cn.com.service.impl.BaseService.createQuery(BaseService.java:55) cn.com.action.NewsAction.getNews1OneNewsTop30(NewsAction.java:123) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source)</pre> <p> </p> <p>配置文件</p> <pre name="code" class="xml">&lt;!-- 配置SessionFactory,由Spring容器来管理Hibernate --&gt; &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt; &lt;property name="dataSource" ref="dataSource" /&gt; &lt;!-- 配置自动扫描包下的实体,也可使用annotatedClasses属性进行单个实体配置 --&gt; &lt;property name="packagesToScan" value="cn.com.entity"&gt;&lt;/property&gt; &lt;!-- 配置Hibernate属性 --&gt; &lt;property name="hibernateProperties"&gt; &lt;props&gt; &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.SQLServerDialect&lt;/prop&gt; &lt;!-- &lt;prop key="hibernate.current_session_context_class"&gt;thread&lt;/prop&gt; --&gt; &lt;!-- &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt; --&gt; &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; &lt;prop key="hibernate.query.substitutions"&gt;true 1, false 0, yes 'Y', no 'N'&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;!-- &lt;property name="configLocation"&gt; &lt;value&gt;classpath:hibernate.cfg.xml&lt;/value&gt; &lt;/property&gt; --&gt; &lt;/bean&gt; &lt;!-- 配置事务管理器 --&gt; &lt;bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt; &lt;property name="sessionFactory" ref="sessionFactory"&gt;&lt;/property&gt; &lt;/bean&gt; &lt;!-- 加载事务管理器 &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt; --&gt; &lt;!-- 配置事务的传播特性 --&gt; &lt;tx:advice id="txAdvice" transaction-manager="transactionManager"&gt; &lt;tx:attributes&gt; &lt;tx:method name="save*" propagation="REQUIRED" /&gt; &lt;tx:method name="update*" propagation="REQUIRED" /&gt; &lt;tx:method name="delete*" propagation="REQUIRED" /&gt; &lt;tx:method name="*" read-only="true" /&gt; &lt;/tx:attributes&gt; &lt;/tx:advice&gt; &lt;!-- 配置参与事务的类或方法 --&gt; &lt;aop:config&gt; &lt;aop:pointcut id="allServiceMethod" expression="execution(* cn.com.dao.*.*.*(..))" /&gt; &lt;aop:advisor pointcut-ref="allServiceMethod" advice-ref="txAdvice" /&gt; &lt;/aop:config&gt; </pre> <p> </p> <p>basedao</p> <pre name="code" class="java">@SuppressWarnings("unchecked") public List&lt;T&gt; createQuery(Class&lt;T&gt; clazz, String hql) { Session session = getSession(); List&lt;T&gt; list = new ArrayList&lt;T&gt;(); try { // session.beginTransaction(); list = session.createQuery(" from " + clazz.getName() + " " + hql) .list(); // session.getTransaction().commit(); } catch (HibernateException e) { e.printStackTrace(); if (session != null) session.getTransaction().rollback(); return null; } return list; }</pre> <p> </p> <p> </p> </div>

启动Tomcat控制台报错:Could not parse mapping document from input stream

启动Tomcat控制台报错如下 ``` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AccountHistorySVCImpl': Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AccountHistoryDaoImpl' defined in ServletContext resource [/WEB-INF/dataAccessContext-local.xml]: Cannot resolve reference to bean 'SessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in ServletContext resource [/WEB-INF/dataAccessContext-local.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:292) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1859) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AccountHistoryDaoImpl' defined in ServletContext resource [/WEB-INF/dataAccessContext-local.xml]: Cannot resolve reference to bean 'SessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in ServletContext resource [/WEB-INF/dataAccessContext-local.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:435) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:409) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:537) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:180) at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:289) ... 29 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in ServletContext resource [/WEB-INF/dataAccessContext-local.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269) ... 47 more Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:508) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:631) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 57 more Caused by: org.dom4j.DocumentException: Error on line 21 of document : 元素类型 "class" 必须由匹配的结束标记 "</class>" 终止。 Nested exception: 元素类型 "class" 必须由匹配的结束标记 "</class>" 终止。 at org.dom4j.io.SAXReader.read(SAXReader.java:482) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499) ... 61 more ``` dataAccessContext-local.xml配置文件内容如下 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" 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"> <bean id="dataSource2" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/> <property name="jdbcUrl" value="jdbc:oracle:thin:@192.168.1.2:1521:CEMP" /> <property name="user" value="cs_imrs" /> <property name="password" value="123123" /> <property name="maxPoolSize" value="15"/> <property name="minPoolSize" value="10"/> <property name="initialPoolSize" value="5"/> <property name="maxIdleTime" value="60"/> </bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/> <property name="jdbcUrl" value="jdbc:oracle:thin:@192.168.0.92:1521:ORCL" /> <property name="user" value="CS_IMRS" /> <property name="password" value="CS_IMRS" /> <property name="maxPoolSize" value="15"/> <property name="minPoolSize" value="10"/> <property name="initialPoolSize" value="5"/> <property name="maxIdleTime" value="60"/> </bean> <bean id="dataSource3" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/> <property name="jdbcUrl" value="jdbc:oracle:thin:@192.168.1.177:1521:orcl" /> <property name="user" value="energy" /> <property name="password" value="energy" /> <property name="maxPoolSize" value="15"/> <property name="minPoolSize" value="10"/> <property name="initialPoolSize" value="5"/> <property name="maxIdleTime" value="60"/> </bean> <bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="mappingResources"> <list> <value>com/hd/imrs/log/map/LogEntity.hbm.xml</value> <value>com/hd/imrs/system/map/SubSystemEntity.hbm.xml</value> <value>com/hd/imrs/system/map/ModuleEntity.hbm.xml</value> <value>com/hd/imrs/system/map/OperationEntity.hbm.xml</value> <value>com/hd/imrs/system/map/RoleEntity.hbm.xml</value> <value>com/hd/imrs/system/map/SystemParamEntity.hbm.xml</value> <value>com/hd/imrs/system/map/UserEntity.hbm.xml</value> <value>com/hd/imrs/system/map/SendingEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/BuildingEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/ConcentratorEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/CollectorEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/OrganizationEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/FactoryEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/MeterEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/FaultEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/ArchiveEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/SiteEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/RoomEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/ModelEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/YxvEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/MarketingEntity.hbm.xml</value> <value>com/hd/imrs/archive/map/SimEntity.hbm.xml</value> <value>com/hd/imrs/rate/map/RateItem.hbm.xml</value> <value>com/hd/imrs/rate/map/BasicWaterRate.hbm.xml</value> <value>com/hd/imrs/rate/map/Rate.hbm.xml</value> <value>com/hd/imrs/rate/map/OverDue.hbm.xml</value> <value>com/hd/imrs/rate/map/RateSet.hbm.xml</value> <value>com/hd/imrs/rate/map/RateSubSidy.hbm.xml</value> <value>com/hd/imrs/rate/map/AreaUser.hbm.xml</value> <value>com/hd/imrs/rate/map/SubSidySend.hbm.xml</value> <value>com/hd/imrs/rate/map/SubSidySendDetal.hbm.xml</value> <value>com/hd/imrs/rate/map/Dayily.hbm.xml</value> <value>com/hd/imrs/rate/map/Month.hbm.xml</value> <value>com/hd/imrs/rate/map/RecordEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/RunTaskEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/WarningSetEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/WarningInfoEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/DayusedtempEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/BlacklistEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/BlacklistEntityResult.hbm.xml</value> <value>com/hd/imrs/maintain/map/FaultmEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/ChangeEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/FreezeEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/SwitchEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/MtCountEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/MessageEntity.hbm.xml</value> <value>com/hd/imrs/maintain/map/DataCommunicationEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/MeterHourCurveEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/MeterDayCurveEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/MeterMonthCurveEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/MeterDayLoss.hbm.xml</value> <value>com/hd/imrs/monitor/map/MeterMonthLoss.hbm.xml</value> <value>com/hd/imrs/monitor/map/MeterDayConsuEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/BuildMonthConstituteEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/UnitHourcurveEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/UnitDaycurveEntity.hbm.xml</value> <value>com/hd/imrs/monitor/map/UnitMonthcurveEntity.hbm.xml</value> <value>com/hd/imrs/account/map/AccountEntity.hbm.xml</value> <value>com/hd/imrs/account/map/AccountHistoryET.hbm.xml</value> <value>com/hd/imrs/payment/map/PaymentEntity.hbm.xml</value> <value>com/hd/imrs/payment/map/NetworkEntity.hbm.xml</value> <value>com/hd/imrs/statistical/map/SubmitDayEntity.hbm.xml</value> <value>com/hd/imrs/statistical/map/SubmitMonthEntity.hbm.xml</value> <value>com/hd/imrs/statistical/map/DosageEntity.hbm.xml</value> <value>com/hd/imrs/statistical/map/MeterDayilyEntity.hbm.xml</value> <value>com/hd/imrs/statistical/map/FeedayilyEntity.hbm.xml</value> <value>com/hd/quartz/msg/map/MsgEntity.hbm.xml</value> <value>com/hd/quartz/msg/map/BillEntity.hbm.xml</value> <value>com/hd/quartz/map/JobBeanEntity.hbm.xml</value> <value>com/hd/imrs/decision/map/PsEntity.hbm.xml</value> <value>com/hd/imrs/decision/map/FeeEntity.hbm.xml</value> <value>com/hd/imrs/decision/map/MrrEntity.hbm.xml</value> <value>com/hd/imrs/decision/map/FmrrEntity.hbm.xml</value> <value>com/hd/imrs/decision/map/FaultsEntity.hbm.xml</value> <value>com/hd/imrs/master/map/SimmEntity.hbm.xml</value> <value>com/hd/imrs/master/map/MasterEntity.hbm.xml</value> <value>com/hd/imrs/master/map/CommunicationEntity.hbm.xml</value> <value>com/hd/imrs/presm/map/PresmDetailEntity.hbm.xml</value> <value>com/hd/imrs/presm/map/PresmSetEntity.hbm.xml</value> <value>com/hd/imrs/community/map/PersonnelEntity.hbm.xml</value> <value>com/hd/imrs/community/map/SpecialEntity.hbm.xml</value> <value>com/hd/imrs/community/map/SpecialWarnEntity.hbm.xml</value> <value>com/hd/imrs/scene/map/DesignEntity.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.bytecode.use_reflection_optimizer">true</prop> <prop key="hibernate.connection.release_mode">auto</prop> <prop key="hibernate.cglib.use_reflection_optimizer">true</prop> <prop key="hibernate.jdbc.batch_size">20</prop> </props> </property> </bean> <!-- 配置事务管理器 --> <bean id="TransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <!-- 配置事务传播特性 --> <tx:advice id="txAdvice" transaction-manager="TransactionManager"> <tx:attributes> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="execute*" propagation="REQUIRED" /> <tx:method name="create*" propagation="REQUIRED" /> <tx:method name="find*" read-only="true" /> <tx:method name="query*" read-only="true" /> </tx:attributes> </tx:advice> <!-- 通知织入接口 --> <aop:config> <aop:pointcut id="ServicePointcut" expression="execution(* com.hd.imrs.*.service.impl.*ServiceImpl.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="ServicePointcut" /> </aop:config> <bean id="HibernateDaoImpl" class="com.hd.imrs.dao.HibernateDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="LogDaoImpl" class="com.hd.imrs.log.dao.impl.LogDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="UserDaoImpl" class="com.hd.imrs.system.dao.impl.UserDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RoleDaoImpl" class="com.hd.imrs.system.dao.impl.RoleDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="OperationDaoImpl" class="com.hd.imrs.system.dao.impl.OperationDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ModuleDaoImpl" class="com.hd.imrs.system.dao.impl.ModuleDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SubSystemDaoImpl" class="com.hd.imrs.system.dao.impl.SubSystemDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SystemParamDaoImpl" class="com.hd.imrs.system.dao.impl.SystemParamDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SendingDaoImpl" class="com.hd.imrs.system.dao.impl.SendingDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="BuildingDaoImpl" class="com.hd.imrs.archive.dao.impl.BuildingDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="OrganizationDaoImpl" class="com.hd.imrs.archive.dao.impl.OrganizationDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ConcentratorDaoImpl" class="com.hd.imrs.archive.dao.impl.ConcentratorDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="CollectorDaoImpl" class="com.hd.imrs.archive.dao.impl.CollectorDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ConsumeDaoImpl" class="com.hd.imrs.archive.dao.impl.ConsumeDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SiteDaoImpl" class="com.hd.imrs.archive.dao.impl.SiteDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FactoryDaoImpl" class="com.hd.imrs.archive.dao.impl.FactoryDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterDaoImpl" class="com.hd.imrs.archive.dao.impl.MeterDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FaultDaoImpl" class="com.hd.imrs.archive.dao.impl.FaultDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SwitchDaoImpl" class="com.hd.imrs.maintain.dao.impl.SwitchDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MtCountDaoImpl" class="com.hd.imrs.maintain.dao.impl.MtCountDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ArchiveDaoImpl" class="com.hd.imrs.archive.dao.impl.ArchiveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RoomDaoImpl" class="com.hd.imrs.archive.dao.impl.RoomDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ModelDaoImpl" class="com.hd.imrs.archive.dao.impl.ModelDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="YxvDaoImpl" class="com.hd.imrs.archive.dao.impl.YxvDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MarketingDaoImpl" class="com.hd.imrs.archive.dao.impl.MarketingDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SimDaoImpl" class="com.hd.imrs.archive.dao.impl.SimDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RunTaskDaoImpl" class="com.hd.imrs.maintain.dao.impl.RunTaskDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="WarningSetDaoImpl" class="com.hd.imrs.maintain.dao.impl.WarningSetDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="WarningInfoDaoImpl" class="com.hd.imrs.maintain.dao.impl.WarningInfoDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="DayusedtempDaoImpl" class="com.hd.imrs.maintain.dao.impl.DayusedtempDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="BlacklistDaoImpl" class="com.hd.imrs.maintain.dao.impl.BlacklistDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MessageDaoImpl" class="com.hd.imrs.maintain.dao.impl.MessageDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="BlacklistResultDaoImpl" class="com.hd.imrs.maintain.dao.impl.BlacklistResultDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FaultmDaoImpl" class="com.hd.imrs.maintain.dao.impl.FaultmDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ChangeDaoImpl" class="com.hd.imrs.maintain.dao.impl.ChangeDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterHourCurveDaoImpl" class="com.hd.imrs.monitor.dao.impl.MeterHourCurveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterDayCurveDaoImpl" class="com.hd.imrs.monitor.dao.impl.MeterDayCurveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterMonthCurveDaoImpl" class="com.hd.imrs.monitor.dao.impl.MeterMonthCurveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="UnitHourCurveDaoImpl" class="com.hd.imrs.monitor.dao.impl.UnitHourCurveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="UnitDayCurveDaoImpl" class="com.hd.imrs.monitor.dao.impl.UnitDayCurveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="UnitMonthCurveDaoImpl" class="com.hd.imrs.monitor.dao.impl.UnitMonthCurveDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterDayLossDaoImpl" class="com.hd.imrs.monitor.dao.impl.MeterDayLossDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterMonthLossDaoImpl" class="com.hd.imrs.monitor.dao.impl.MeterMonthLossDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MeterDayConsuDaoImpl" class="com.hd.imrs.monitor.dao.impl.MeterDayConsuDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="AccountDaoImpl" class="com.hd.imrs.account.dao.impl.AccountDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <!-- <bean id="AccountHistoryDaoImpl" class="com.hd.imrs.account.dao.impl.AccountHistoryDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> --> <bean id="AccountHistoryDaoImpl" class="com.hd.imrs.account.dao.impl.AccountHistoryDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RateDaoImpl" class="com.hd.imrs.rate.impl.RateDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RateItemDaoImpl" class="com.hd.imrs.rate.impl.RateItemDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="NewRateItemDaoImpl" class="com.hd.imrs.rate.impl.NewRateItemDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="BasicWaterRateDaoImpl" class="com.hd.imrs.rate.impl.BasicWaterRateDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="OverDueDaoImpl" class="com.hd.imrs.rate.impl.OverDueDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RateSetDaoImpl" class="com.hd.imrs.rate.impl.RateSetDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SubSidyDaoImpl" class="com.hd.imrs.rate.impl.SubSidyDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SubSidySendDaoImpl" class="com.hd.imrs.rate.impl.SubSidySendDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SubSidySendDetalDaoImpl" class="com.hd.imrs.rate.impl.SubSidySendDetalDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="AreaDaoImpl" class="com.hd.imrs.rate.impl.AreaDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="DayilyDaoImpl" class="com.hd.imrs.rate.impl.DayilyDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MonthDaoImpl" class="com.hd.imrs.rate.impl.MonthDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="RecordDaoImpl" class="com.hd.imrs.rate.impl.RecordDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="PaymentDaoImpl" class="com.hd.imrs.payment.dao.impl.PaymentDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="NetworkDaoImpl" class="com.hd.imrs.payment.dao.impl.NetworkDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="DesignDaoImpl" class="com.hd.imrs.scene.dao.impl.DesignDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SubmitDayDaoImpl" class="com.hd.imrs.statistical.dao.impl.SubmitDayDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SubmitMonthDaoImpl" class="com.hd.imrs.statistical.dao.impl.SubmitMonthDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="CostDaoImpl" class="com.hd.imrs.statistical.dao.impl.CostDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="PsDaoImpl" class="com.hd.imrs.decision.dao.impl.PsDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FeeDaoImpl" class="com.hd.imrs.decision.dao.impl.FeeDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MrrDaoImpl" class="com.hd.imrs.decision.dao.impl.MrrDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FmrrDaoImpl" class="com.hd.imrs.decision.dao.impl.FmrrDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FaultsDaoImpl" class="com.hd.imrs.decision.dao.impl.FaultsDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SimmDaoImpl" class="com.hd.imrs.master.dao.impl.SimmDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MasterDaoImpl" class="com.hd.imrs.master.dao.impl.MasterDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="DetailDaoImpl" class="com.hd.imrs.presm.dao.impl.DetailDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="PresmSetDaoImpl" class="com.hd.imrs.presm.dao.impl.PresmSetDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="FreezeDaoImpl" class="com.hd.imrs.maintain.dao.impl.FreezeDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="CommunicationDaoImpl" class="com.hd.imrs.master.dao.impl.CommunicationDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="PersonnelDaoImpl" class="com.hd.imrs.community.dao.impl.PersonnelDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SpecialDaoImpl" class="com.hd.imrs.community.dao.impl.SpecialDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="SpecialWarnDaoImpl" class="com.hd.imrs.community.dao.impl.SpecialWarnDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="ControlSetDaoImpl" class="com.hd.imrs.maintain.dao.impl.ControlSetDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="MsgDaoImpl" class="com.hd.quartz.msg.dao.impl.MsgDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="BillDaoImpl" class="com.hd.quartz.msg.dao.impl.BillDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="DataCommunicationDaoImpl" class="com.hd.imrs.maintain.dao.impl.DataCommunicationDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="JobBeanDaoImpl" class="com.hd.quartz.dao.impl.JobBeanDaoImpl"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean id="JobBeanServiceImpl" class="com.hd.quartz.msg.service.impl.JobBeanServiceImpl"/> <bean id="HibernateHelper" class="com.hd.imrs.dao.HibernateHelper"> <property name="sessionFactory"> <ref local="SessionFactory" /> </property> </bean> <bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="applicationContextSchedulerContextKey" value="applicationContextKey"/> <property name="configLocation" value="classpath:quartz.properties"/> <!--这个是必须的,QuartzScheduler 延时启动,应用启动完后 QuartzScheduler 再启动--> <property name="startupDelay" value="45"/> <!--这个是可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了--> <property name="overwriteExistingJobs" value="true"/> <property name="jobDetails" > <list> <ref bean="jobDetail"/> </list> </property> </bean> <bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass"> <value> com.hd.quartz.job.TaskJobBean </value> </property> </bean> <!-- <bean id="timerClose" class="com.hd.quartz.job.TimerCloseJobBean" /> <bean id="timerHang" class="com.hd.quartz.job.TimerHangJobBean" /> <bean id="oweHang" class="com.hd.quartz.job.OweHangJobBean" /> <bean id="meterExPmc" class="com.hd.quartz.pmc.MeterExceptionPMC" /> <bean id="pwdOuttimePmc" class="com.hd.quartz.pmc.PasswordOuttimePMC" /> <bean id="usedEx" class="com.hd.quartz.job.UsedExceptionJobBean" /> --> <bean id="quartzDao" class="com.hd.quartz.dao.QuartzDao" > </bean> <bean id="schedulerService" class="com.hd.quartz.service.SchedulerServiceImpl" > </bean> <!-- 使加密狗正常工作而添加 --> <bean id="MsgServiceImpl" class="com.hd.quartz.msg.service.impl.MsgServiceImpl"/> <bean id="ModuleServiceImpl" class="com.hd.imrs.system.service.impl.ModuleServiceImpl"/> <bean id="OperationServiceImpl" class="com.hd.imrs.system.service.impl.OperationServiceImpl"/> <bean id="RoleServiceImpl" class="com.hd.imrs.system.service.impl.RoleServiceImpl"/> <bean id="SubSystemServiceImpl" class="com.hd.imrs.system.service.impl.SubSystemServiceImpl"/> <bean id="SystemParamServiceImpl" class="com.hd.imrs.system.service.impl.SystemParamServiceImpl"/> <bean id="UserServiceImpl" class="com.hd.imrs.system.service.impl.UserServiceImpl"/> <bean id="SubmitServiceImpl" class="com.hd.imrs.statistical.service.impl.SubmitServiceImpl"/> <bean id="AreaServiceImpl" class="com.hd.imrs.rate.service.impl.AreaServiceImpl"/> <bean id="DayilyServiceImpl" class="com.hd.imrs.rate.service.impl.DayilyServiceImpl"/> <bean id="ManualServiceImpl" class="com.hd.imrs.rate.service.impl.ManualServiceImpl"/> <bean id="MonthServiceImpl" class="com.hd.imrs.rate.service.impl.MonthServiceImpl"/> <bean id="OverDueServiceImpl" class="com.hd.imrs.rate.service.impl.OverDueServiceImpl"/> <bean id="RateServiceImpl" class="com.hd.imrs.rate.service.impl.RateServiceImpl"/> <bean id="RateSetServiceImpl" class="com.hd.imrs.rate.service.impl.RateSetServiceImpl"/> <bean id="SubSidySendServiceImpl" class="com.hd.imrs.rate.service.impl.SubSidySendServiceImpl"/> <bean id="SubSidyServiceImpl" class="com.hd.imrs.rate.service.impl.SubSidyServiceImpl"/> <bean id="PaymentServiceImpl" class="com.hd.imrs.payment.service.impl.PaymentServiceImpl"/> <bean id="MeterMonitorServiceImpl" class="com.hd.imrs.monitor.service.impl.MeterMonitorServiceImpl"/> <bean id="BasicParamServiceImpl" class="com.hd.imrs.maintain.service.impl.BasicParamServiceImpl"/> <bean id="ConcentratorCmdServiceImpl" class="com.hd.imrs.maintain.service.impl.ConcentratorCmdServiceImpl"/> <bean id="ControlServiceImpl" class="com.hd.imrs.maintain.service.impl.ControlServiceImpl"/> <bean id="DataMaintainServiceImpl" class="com.hd.imrs.maintain.service.impl.DataMaintainServiceImpl"/> <bean id="ArchiveServiceImpl" class="com.hd.imrs.archive.service.impl.ArchiveServiceImpl"/> <bean id="BuildingServiceImpl" class="com.hd.imrs.archive.service.impl.BuildingServiceImpl"/> <bean id="ConcentratorServiceImpl" class="com.hd.imrs.archive.service.impl.ConcentratorServiceImpl"/> <bean id="CollectorServiceImpl" class="com.hd.imrs.archive.service.impl.CollectorServiceImpl"/> <bean id="ConsumeServiceImpl" class="com.hd.imrs.archive.service.impl.ConsumeServiceImpl"/> <bean id="FactoryServiceImpl" class="com.hd.imrs.archive.service.impl.FactoryServiceImpl"/> <bean id="FaultServiceImpl" class="com.hd.imrs.archive.service.impl.FaultServiceImpl"/> <bean id="MeterServiceImpl" class="com.hd.imrs.archive.service.impl.MeterServiceImpl"/> <bean id="OrganizationServiceImpl" class="com.hd.imrs.archive.service.impl.OrganizationServiceImpl"/> <bean id="RoomServiceImpl" class="com.hd.imrs.archive.service.impl.RoomServiceImpl"/> <bean id="SiteServiceImpl" class="com.hd.imrs.archive.service.impl.SiteServiceImpl"/> <bean id="AccountHistorySVCImpl" class="com.hd.imrs.account.service.impl.AccountHistorySVCImpl"/> <bean id="AccountServiceImpl" class="com.hd.imrs.account.service.impl.AccountServiceImpl"/> <bean id="SchedulerServiceImpl" class="com.hd.quartz.service.SchedulerServiceImpl"/> <bean id="LogServiceImpl" class="com.hd.imrs.log.service.impl.LogServiceImpl"/> <bean id="HdBasicParamServiceImpl" class="com.hd.imrs.maintain.service.impl.HdBasicParamServiceImpl"/> <bean id="HBBasicParamServiceImpl" class="com.hd.imrs.maintain.service.impl.HBBasicParamServiceImpl"/> <bean id="HdControlServiceImpl" class="com.hd.imrs.maintain.service.impl.HdControlServiceImpl"/> <bean id="HdDataMaintainServiceImpl" class="com.hd.imrs.maintain.service.impl.HdDataMaintainServiceImpl"/> <bean id="WarningInfoServiceImpl" class="com.hd.imrs.maintain.service.impl.WarningInfoServiceImpl"/> <bean id="WarningSetServiceImpl" class="com.hd.imrs.maintain.service.impl.WarningSetServiceImpl"/> <bean id="NetworkServiceImpl" class="com.hd.imrs.payment.service.impl.NetworkServiceImpl"/> <bean id="BillServiceImpl" class="com.hd.quartz.msg.service.impl.BillServiceImpl"/> <bean id="DayusedtempServiceImpl" class="com.hd.imrs.maintain.service.impl.DayusedtempServiceImpl"/> </beans> ```

MySQL 8.0.19安装教程(windows 64位)

话不多说直接开干 目录 1-先去官网下载点击的MySQL的下载​ 2-配置初始化的my.ini文件的文件 3-初始化MySQL 4-安装MySQL服务 + 启动MySQL 服务 5-连接MySQL + 修改密码 先去官网下载点击的MySQL的下载 下载完成后解压 解压完是这个样子 配置初始化的my.ini文件的文件 ...

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉系统全面的介绍。

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

navicat(内含激活码)

navicat支持mysql的可视化操作,内涵激活码,不用再忍受弹框的痛苦。

HTML期末大作业

这是我自己做的HTML期末大作业,花了很多时间,稍加修改就可以作为自己的作业了,而且也可以作为学习参考

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

基于STM32的电子时钟设计

时钟功能 还有闹钟功能,温湿度功能,整点报时功能 你值得拥有

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:itxy41)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

Java8零基础入门视频教程

这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

零基础学C#编程—C#从小白到大咖

本课程从初学者角度出发,提供了C#从入门到成为程序开发高手所需要掌握的各方面知识和技术。 【课程特点】 1 由浅入深,编排合理; 2 视频讲解,精彩详尽; 3 丰富实例,轻松易学; 4 每章总结配有难点解析文档。 15大章节,228课时,1756分钟与你一同进步!

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

多功能数字钟.zip

利用数字电子计数知识设计并制作的数字电子钟(含multisim仿真),该数字钟具有显示星期、24小时制时间、闹铃、整点报时、时间校准功能

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

机器学习实战系列套餐(必备基础+经典算法+案例实战)

机器学习实战系列套餐以实战为出发点,帮助同学们快速掌握机器学习领域必备经典算法原理并结合Python工具包进行实战应用。建议学习顺序:1.Python必备工具包:掌握实战工具 2.机器学习算法与实战应用:数学原理与应用方法都是必备技能 3.数据挖掘实战:通过真实数据集进行项目实战。按照下列课程顺序学习即可! 课程风格通俗易懂,用最接地气的方式带领大家轻松进军机器学习!提供所有课程代码,PPT与实战数据,有任何问题欢迎随时与我讨论。

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

几率大的Redis面试题(含答案)

本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

u-boot-2015.07.tar.bz2

uboot-2015-07最新代码,喜欢的朋友请拿去

php+mysql学生成绩管理系统

学生成绩管理系统,分三个模块:学生,教师和管理员。 管理员模块:负责学生、老师信息的增删改;发布课程信息的增删改,以便让学生选课;审核老师提交的学生成绩并且打印成绩存档;按照课号查询每个课号的学生成绩

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问