恶心的glassfish

本文介绍如何在Glassfish应用服务器中使用Hibernate作为持久化提供者。主要包括下载并安装必要的软件,复制所需jar文件到Glassfish的lib目录,以及更新persistence.xml配置文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

很不幸的一件事,需要在netbean 下开发ejb3,整了半天才发现glassfish使用toplink,没带hibernate的包,还要下两个包,然后copy进去,以下是查到的资料,sun太恶心了,想和sun bye bye 了,只为多活几年.


Use Hibernate as a persistence provider with Glassfish

from http://blogs.sun.com/roller/page/GlassFishPersistence#use_hibernate_as_a_persistence
As you must be aware, Glassfish currently has Toplink Essentials as the default persistence provider. The question that frequently gets asked is: How hard it is to to use Hibernate as the persistence provider with Glassfish?
The answer is: Not at all :). Just drop couple of jars reqired by Hibernate in the lib directory of Glassfish and modify your persistence.xml to use Hibernate as the provider and you are ready to go. Lets walk through the steps:

1. Download and install glassfish milestone 6 build or later.
2. Download and install Hibernate3 3.2cr1 or later.
3. Download and install Hibernate EntityManager 3.1 beta7 or later.
4. Copy the required Hibernate jars into Glassfish lib dir. The script here contains the list of jars.
5. Update your persistence.xml to use Hibernate as the persistence provider. Here is a sample persistence.xml
6. Deploy and run your application.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值