日期:2014-05-19  浏览次数:20897 次

Could not resolve placeholder 'hibernate.driverClassName'
将Tomcat下的SSH架构的项目移植到weblogic下,tomcat下是可以运行的

在weblogic下部署项目

部署成功,登陆页面点击登录报错No bean named 'sessionFactory' is defined

然后我在weblogic.xml下加入
<container-descriptor>  
  <prefer-web-inf-classes>true</prefer-web-inf-classes>  
  </container-descriptor>

再在weblogic下部署,部署失败,并报错
weblogic.application.ModuleException: :org.springframework.beans.factory.BeanDefinitionStoreException:Invalid bean definition with name 'dataSource' defined in file [D:\SDK\Workspace\Workspace fo MyEclipse\PersonnelPro\WebRoot\WEB-INF\classes\applicationContext-common.xml]: Could not resolve placeholder 'hibernate.driverClassName'

我的applicationContext-common.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="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:hibernate.properties</value>
</list>
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">  
<property name="driverClassName"
value="${hibernate.driverClassName}">
</property>
<property name="url"
value="${hibernate.url}">
</property>
<property name="username" value="${hibernate.username}"></property>
<property name="password" value="${hibernate.password}"></property>
<!-- 最大活动连接数 -->  
  <property name="maxActive" value="100"></property>  
  <!-- 最大可空闲连接数 -->  
  <property name="maxIdle" value="30"></property>  
  <!-- 最大可等待连接数 -->  
  <property name="maxWait" value="500"></property>  
  <!-- 默认的提交方式(如果不需要事务可以设置成true,在实际应用中一般设置为false,默认为false) -->  
  <property name="defaultAutoCommit" value="true"></property>  
</bean>  


<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">  
  <property name="dataSource" ref="dataSource"></property>  

<property name="hibernateProperties">
<props>
<!-- <prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop> -->
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update&l