Create your bean.xml something like this...
<?xml version="1.0" encoding="UTF-8"?> <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-3.0.xsd"> <bean id="usrMgmtServiceImpl" class="com.usermanagement.service.impl.UserManagementServiceImpl"> <property name="privService" ref="privService"/> <property name="roleService" ref="roleService"/> <property name="userService" ref="userService"/> </bean> <!-- DB CONFIGURATION BEGINS --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"><value>Connection.properties</value></property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName"> <value>${db.driverClassName}</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> </bean> <bean id="mysessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <!-- These are the POJO objects, you have to mention these here... --> <property name="annotatedClasses"> <list> <value>com.usermanagement.pojo.User</value> <value>com.usermanagement.pojo.Role</value> <value>com.usermanagement.pojo.Privilege</value> <value>com.usermanagement.pojo.Password</value> <value>com.usermanagement.pojo.PasswordPolicy</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <!--<prop key="hibernate.cache.provider_class">org.hibernate.cache.SingletonEhCacheProvider</prop>--> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> </props> </property> </bean> <bean id="template" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="mysessionFactory"></property> </bean> <!-- DB CONFIGURATION ENDS --> <bean id="privService" class="com.usermanagement.service.impl.PrivilegeServiceImpl"> <property name="privDao" ref="privDao"/> </bean> <bean id="roleService" class="com.usermanagement.service.impl.RoleServiceImpl"> <property name="roleDao" ref="roleDao"/> </bean> <bean id="userService" class="com.usermanagement.service.impl.UserServiceImpl"> <property name="userDao" ref="userDao"/> </bean> <bean id="privDao" class="com.usermanagement.dao.impl.PrivilegeDAOImpl" > <property name="template" ref="template"></property> </bean> <bean id="roleDao" class="com.usermanagement.dao.impl.RoleDAOImpl" > <property name="template" ref="template"></property> </bean> <bean id="userDao" class="com.usermanagement.dao.impl.UserDAOImpl"> <property name="template" ref="template"></property> </bean> </beans>
The list of jars that you might need are
- antlr-2.7.6.jar
- asm-1.5.3.jar
- axis2-spring-1.6.1.jar
- cglib-2.1_3.jar
- commons-collections-3.1.jar
- commons-dbcp-1.4.jar
- commons-logging-1.0.4.jar
- commons-pool-1.6.jar
- dom4j-1.6.1.jar
- hibernate-3.2.0.ga.jar
- hibernate-3.2.6.jar
- hibernate-annotations-3.4.0.GA.jar
- hibernate-commons-annotations-3.1.0.GA.jar
- hibernate-core-3.3.0.SP1.jar
- hibernate-entitymanager.jar
- hibernate-jpa-2.0-api-1.0.0.Final.jar
- jta-1.1.jar
- log4j-1.2.14.jar
- ojdbc14.jar
- org.springframework.asm-3.0.0.RELEASE.jar
- org.springframework.beans-3.0.0.RELEASE.jar
- org.springframework.context-3.0.0.RELEASE.jar
- org.springframework.core-3.0.0.RELEASE.jar
- org.springframework.expression-3.0.0.RELEASE.jar
- org.springframework.jdbc-3.0.0.RELEASE.jar
- org.springframework.orm-3.0.0.RELEASE.jar
- org.springframework.web.servlet-3.0.1.RELEASE-A.jar
- slf4j-api-1.6.1.jar
- spring-tx-3.0.0.RELEASE.jar
No comments:
Post a Comment