日期:2014-05-16  浏览次数:20493 次

weblogic连接数据库配置: JNDI方式
weblogic连接数据库配置:http://blog.csdn.net/defonds/article/details/4148254
在hibernate中应用weblogic的数据源时的配置文件: http://blog.csdn.net/yixiaoqingyuz/article/details/2914847
spring中怎么获取weblogic的JNDI:http://www.iteye.com/problems/83661
Spring-JNDI配置:http://jyaitangbo.blog.163.com/blog/static/538403052008112411052536/

startus2+hibernate3+spring2.5+mysql/oracle+jndi+weblogic10.3.3
http://hi.baidu.com/hht_mmtchina/blog/item/f0c24b289b8ab6b94723e8d9.html

Weblogic 10.1 配置JNDI 数据源:http://my.oschina.net/u/194678/blog/37196真的要在web.xml增加那一段?


<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="jdbc/CITYU_DEV_V20"></property>
		 <property name="resourceRef"><value>true</value></property>
	     <property name="jndiEnvironment"> 
		   <props> 
		        <prop key="java.naming.provider.url">t3://localhost:8080</prop> 
		        <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop> 
		   </props> 
		  </property>
</bean>


出现问题,都在上面提供的url中解决,最后出现:

@Autowired
public void setSessionFactory(final SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
}


Caused By: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.asl.jwaf.core.orm.hibernate.SimpleHibernateDao.setSessionFactory(org.hibernate.SessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [hibernate-context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/ISQLServerConnection
......
......
Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAO_CTU_RO_STAFF': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.asl.jwaf.core.orm.hibernate.SimpleHibernateDao.setSessionFactory(org.hibernate.SessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [hibernate-context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/ISQLServerConnection
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
......
......
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DAO_CTU_RO_STAFF': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.asl.jwaf.core.orm.hibernate.SimpleHibernateDao.setSessionFactory(org.hibernate.SessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactor