可能是驱动问题。
struts+hibenate+spring 这种架构干嘛用jboss
struts+hibenate+spring 这种架构干嘛用jboss
解决方案 »
- websphere6.0下部署war包,异常javax.naming.NameNotFoundException: Namenotfound java:
- 开源CMS
- java 国际化
- 求ExtJS方面的文档、书籍
- 如何对两个TimeStamp格式的时间进行比较?
- 如何安装NDS?
- 如何在jboss里配置datasource connectionpool 望高手执教 我用的是mysql
- 有关jdbc
- 求救!悬赏*100分*作出此题,一定要详细(给出源代码), 一定给分,谢谢!
- 求高手解决为啥springmvc,提交表单不能用ajx,怎么办给个例子啊谢谢
- STRUCTS问题(急急)
- 我想从事手机软件开发,手机游戏开发,不知道学。NET 好还是JAVA 好?
你们是说使用的sql server驱动么?
但是同样的驱动我用struts+hibenate开发一直很好,也是使用同一个jboss。
这两个工程唯一的不同就是增加了spring,但问题就出现了。
这是我连接数据库的文件,也是spring配置文件。
-----------------------------------------
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close" >
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:microsoft:sqlserver://localhost:1433;Database=Component;selectmethod=cursor</value>
</property>
<property name="username">
<value>collin000</value>
</property>
<property name="password">
<value>68765070</value>
</property>
</bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" destroy-method="close" >
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingResources">
<list>
<value>com/powerapps/model/CompanyInfo.hbm.xml</value>
<value>com/powerapps/model/DepartInfo.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean> <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="departService"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="target">
<ref local="departServiceImpl"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_SUPPORTS</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="departServiceImpl" class="com.powerapps.service.impl.baseinfo.DepartServiceImpl" >
<property name="companyInfoDao"><ref local="companyInfoDao"/></property>
<property name="departInfoDao"><ref local="departInfoDao"/></property>
</bean>
<bean id="companyService"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="target">
<ref local="companyServiceImpl"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_SUPPORTS</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="companyServiceImpl" class="com.powerapps.service.impl.baseinfo.CompanyServiceImpl" >
<property name="companyInfoDao"><ref local="companyInfoDao"/></property>
</bean>
<bean id="companyInfoDao" class="com.powerapps.dao.impl.CompanyInfoDao">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate"/>
</property>
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="departInfoDao" class="com.powerapps.dao.impl.DepartInfoDao">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate"/>
</property>
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean name="/departInfo" class="com.powerapps.action.DepartInfoAction" singleton="false">
<property name="departService">
<ref local="departService" />
</property>
<property name="companyService">
<ref local="companyService" />
</property>
</bean>