记录hibernate 3学习过程中的报错(未完成)

1。解压缩hibernate-3.0beta1.zip文件
2。copy msbase.jar,msutil.jar,mssqlserver.jar文件到hibernater-3.0/lib目录下
3。编辑etc/hibernate.properties(不在src目录下)。如下:
4。运行 hibernater-3.0/builder eg
报错如下:
 org.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.HashtableCache.Provider

吃亏了:hibernate2.jar和hibernate3.jar包结构完全不同了
例如:hibernate2中的net.sf.hibernate.dialect.SQLServerDialect
在hibernater3中变成了org.hibernate.dialect.SQLServerDialect


报错说:class not found : org.hsqldb.jdbcDriver
在build.xml文件中发现以下这句话:
<echo message="remember to place your JDBC driver in the lib directory"/>
将hsqldb.jar文件拷贝到hibernater-3.0/lib目录下。

在hibernate.properties文件中写
hibernate.dialect org.hibernate.dialect.SQLServerDialect
hibernate.connection.username abc
hibernate.connection.password abc

hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
hibernate.connection.url jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=spitrade;SelectMethod=cursor

去除HypersonicSQL的连接方法,好像成功连接了。

怎么去建立数据库?用Main方法去建立失败,
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/Session

java org.hibernate.auction.Main
缺少classpath cglib.jar hibernate3.jar ehcache.jar commons-collections-2.1.1.jar

set classpath后
报错说:Not binding factory to JNDI, no JNDI name configured


http://www.hibernate.org/114.html ---->  Using Hibernate with Tomcat and JNDI


hibernate.connection.datasource jdbc/soos  失败
可能需要修改hibernate.cfg.xml文件 并增加jta.jar

hibernate.properties not found
将hibernate.properties文件放入classpath找得到的地方 成功。

Could not find datasource: java:comp/env/jdbc/soos
在hibernate.properties中必须写hibernate.connection.datasource jdbc/soos

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值