Because the jar package version is not quite right when you configure it, the AOP package is not available, so declaring the object management is invalid and can only be declared in the method manually
1. Reported:Annotationtransactionattributesource is only available on Java 1.5 and higher error, The mistake is that the annotated statement of things only supports JDK 1.5 and above, meaning that your JDK version is too low,
This is not really the case at all because of the 1.8 jdk, and the JDK version is too high, this error occurs in earlier versions of Spring, either with the latest spring or the JDK version
The configuration of the integrated ORM Framework in 2.Spring: Add in Applicationcontext.xml:
<context:property-placeholder location= "Classpath:jdbc.properties"/>
<!--Configuring the data source JDBC--
<bean id= "DataSource" class= "Org.apache.commons.dbcp.BasicDataSource"
destroy-method= "Close" >
<property name= "Driverclassname" >
<value>${db.driver}</value>
</property>
<property name= "url" >
<value>${db.url}</value>
</property>
<property name= "username" >
<value>${db.username}</value>
</property>
<property name= "Password" >
<value>${db.password}</value>
</property>
<property name= "maxactive" ><!--the maximum number of database connections for the connection pool. Set to 0 to indicate no limit. -
<value>1000</value>
</property>
<property name= "Maxidle" ><!--Maxidle is the largest number of idle connections, indicating that free connections can remain idle even when there is no database connection, and are always on standby. -
<value>10</value>
</property>
<property name= "maxwait" ><!--maximum setup connection wait time. If more than this time will receive an exception--
<value>10000</value>
</property>
</bean>
<bean id= "Sessionfactory" class= "Org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
<property name= "DataSource" ref= "DataSource"/>
<!--used to list all PO mapping files--
<property name= "Mappingresources" >
<list>
<value>com/wang/bean/User.hbm.xml</value>
</list>
</property>
<!--setting Hibernate properties-
<property name= "Hibernateproperties" >
<props>
<!--Configure the dialect of the connected database---
<prop key= "Hibernate.dialect" >org.hibernate.dialect.MySQLDialect</prop>
<!--set whether database tables are automatically established according to the mapping file when Sessionfactory is created —-->
<prop key= "Hibernate.hbm2ddl.auto" >create</prop>
<!--whether to convert SQL statements into well-formed SQL--
<prop key= "Hibernate.format_sql" >true</prop>
</props>
</property>
</bean>
<!--configuring Hibernate's local transaction manager, using the Hibernatetransactionmanager class--
<!--This class implements the Platformtransactionmanager interface, which is a specific implementation class for Hibernate--
<bean id= "TransactionManager" class= "Org.springframework.orm.hibernate3.HibernateTransactionManager" >
<property name= "Sessionfactory" ref= "Sessionfactory"/>
</bean>
Add STRUTS2 filter and Spring Monitor in 3.web.xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<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>
Various errors when manually consolidating the SSH framework