论坛首页 Java企业应用论坛

[提问] weblogic配置问题

浏览 3363 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2004-01-13  
问题一:hibernate.properties如下:
hibernate.dialect net.sf.hibernate.dialect.OracleDialect
hibernate.connection.datasource mySource
hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider
hibernate.session_factory_name hibernate.session_factory

请问上面datasource 是(Tx )Data Sources  的Name,JNDI Name还是Pool Name?

问题二:在
Configuration conf = new Configuration();.addClass(Cat.class);;   
中Cat.class 是从example中来的吗?

问题三:weblogic起动后抛出如下错误是何原因引起的?
- Initializing connection provider: net.sf.hibernate.connection.DatasourceConnec
tionProvider
- Could not instantiate connection provider
java.lang.ClassNotFoundException: net/sf/hibernate/connection/DatasourceConnecti
onProvider
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:120)
        at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:7
5)
        at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionPr
ovider(ConnectionProviderFactory.java:54)
        at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.ja
va:64)
        at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1
078)
        at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:724)
        at com.fankai.HibernateStartUp.startup(HibernateStartUp.java:15)
        at weblogic.t3.srvr.StartupClassRunner.invokeStartup(StartupClassRunner.
java:112)
        at weblogic.t3.srvr.StartupClassRunner.invokeClass(StartupClassRunner.ja
va:93)
        at weblogic.t3.srvr.StartupClassRunner.run(StartupClassRunner.java:61)
        at java.lang.Thread.run(Thread.java:484)
   发表时间:2004-01-13  
1、是DataSouce的JNDI名称

2、是的

3、DataSource没有配好。
0 请登录后投票
   发表时间:2004-01-14  
非常感谢!
但是程序运行到
SessionFactory sf = conf.buildSessionFactory();;
又抛出下面错误,为何?
- Hibernate 2.1 final
- loaded properties from resource hibernate.properties: {hibernate.jdbc.fetch_si
ze=50, hibernate.cglib.use_reflection_optimizer=true, hibernate.transaction.mana
ger_lookup_class=net.sf.hibernate.transaction.WeblogicTransactionManagerLookup,
hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.max_fetch_de
pth=1, hibernate.jdbc.use_streams_for_binary=true, hibernate.query.substitutions
=true 1, false 0, yes 'Y', no 'N', hibernate.jdbc.batch_size=25, hibernate.sessi
on_factory_name=hibernate/session_factory, hibernate.connection.datasource=csms2
sysjndi, hibernate.connection.provider_class=net.sf.hibernate.connection.Datasou
rceConnectionProvider, hibernate.show_sql=true, hibernate.connection.pool_size=1
}
- using java.io streams to persist binary types
- using CGLIB reflection optimizer
- JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disab
led
- using workaround for JVM bug in java.sql.Timestamp
- Mapping resource: myhibernate/Person.hbm.xml
- Mapping class: myhibernate.Person -> person
****- processing one-to-many association mappings
- processing one-to-one association property references
- processing foreign key constraints
- Using dialect: net.sf.hibernate.dialect.OracleDialect
- JDBC result set fetch size: 50
- Maximim outer join fetch depth: 1
- Use outer join fetching: true
- Initializing connection provider: net.sf.hibernate.connection.DatasourceConnec
tionProvider
- JNDI InitialContext properties:{}
- Using datasource: csms2sysjndi
- instantiating TransactionManagerLookup: net.sf.hibernate.transaction.WeblogicT
ransactionManagerLookup
- instantiated TransactionManagerLookup
- Use scrollable result sets: true
- JDBC 2 max batch size: 25
- echoing all SQL to stdout
- Query language substitutions: {false=0, no='N', yes='Y', true=1}
- cache provider: net.sf.ehcache.hibernate.Provider
- instantiating and configuring caches
- building session factory
java.lang.NoSuchMethodError: net.sf.hibernate.persister.AbstractEntityPersister:
 method getTableName();Ljava/lang/String; not found
        at net.sf.hibernate.persister.AbstractEntityPersister.generateSelectVers
ionString(AbstractEntityPersister.java:1188);
        at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.jav
a:916);
        at net.sf.hibernate.persister.PersisterFactory.createClassPersister(Pers
isterFactory.java:41);
        at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.ja
va:136);
        at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:726);
        at com.fankai.HibernateStartUp.startup(HibernateStartUp.java:16);
        at weblogic.t3.srvr.StartupClassRunner.invokeStartup(StartupClassRunner.
java:112);
        at weblogic.t3.srvr.StartupClassRunner.invokeClass(StartupClassRunner.ja
va:93);
        at weblogic.t3.srvr.StartupClassRunner.run(StartupClassRunner.java:61);
        at java.lang.Thread.run(Thread.java:484);
0 请登录后投票
   发表时间:2004-01-14  
大概是映射文件写的不对。
0 请登录后投票
   发表时间:2004-01-16  
搞定了:)

原来是weblogic版本的问题,
我在6.1上按照楼猪的步骤配置就是报错,
换成7.0后 ok了
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics