当前位置: 代码迷 >> Web前端 >> 用的是hibernate, 但是weblogic集群上 JNDI找不到啊
  详细解决方案

用的是hibernate, 但是weblogic集群上 JNDI找不到啊

热度:176   发布时间:2012-11-18 10:51:21.0
用的是hibernate, 但是weblogic集群下 JNDI找不到啊?
各位仁兄:

   我用的是struts + hibernate + weblogic ,
   但是weblogic集群下 JNDI找不到啊? hibernate.cfg.xml 如下

<session-factory>
<property name="connection.datasource">oracleDataSource</property>
<property name="jndi.url">t3://localhost:7002,localhost:7004</property>
<property name="jndi.class">
weblogic.jndi.WLInitialContextFactory
</property>
<property name="connection.username">weblogic</property>
<property name="connection.password">weblogic</property>
<property name="dialect">
org.hibernate.dialect.OracleDialect
</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.jdbc.fetch_size">50</property>
<property name="hibernate.jdbc.batch_size ">25</property>


.....
但是 集群下 ,找不到oracleDataSource啊? 我集群是
adminServer     192.168.0.100: 7001
managedServer  192.168.0.100: 7002
managedServer  192.168.0.100: 7004
ProxyServer    192.168.0.100:9001

我想过 在HibernateSessionFactory 初始化里来找oracleDataSource,类似:
  ctx = new InitialContext(ht); ctx.lookup("oracleDataSource");
也没有成功.

各位仁兄, 我该怎么解决啊?整了几天了, 郁闷....


  相关解决方案