Thread: JDeveloper 10.1.3 preview and Hibernate 3.0


Permlink Replies: 17 - Pages: 2 [ 1 2 | Next ] - Last Post: Nov 21, 2007 8:20 AM Last Post By: Doug Clarke
lmertins

Posts: 10
Registered: 04/08/00
JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Apr 28, 2005 1:09 PM
Click to report abuse...   Click to reply to this thread Reply
I'm testing JDeveloper Preview 10.1.3.0.2.223 and find some problems when using hibernate 3.0

When I'm using with OC4J, some packages conflicts and Hibernate don't work.

I hava to rename <jdevhome1013>\webservices\lib to <jdevhome1013>\webservices\libold
and replace the file <jdevhome1013>\j2ee\home\lib\asm.jar from file asm.jar that folloies Hibernate 3.0

So, I'd like to know if it's a know bug, a unknow bug or JDeveloper/OC4J won't support applications with Hibernate?

Thanks.
dvohra16

Posts: 6,037
Registered: 07/02/01
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Apr 28, 2005 1:46 PM   in response to: lmertins in response to: lmertins
Click to report abuse...   Click to reply to this thread Reply
In JDeveloper 10.1.3, with Hibernate 2.1.8,
delete orai18n.jar from the <JDeveloper 10.1.3>\jdbc\lib directory for the database schema and Java Bean class to get generated.
Shay Shmeltzer

Posts: 10,328
Registered: 03/08/01
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Apr 28, 2005 1:58 PM   in response to: lmertins in response to: lmertins
Click to report abuse...   Click to reply to this thread Reply
I think that your question is more an OC4J question than a JDeveloper question, so you might want to try posting this on their forum also. It seems that what you are looking to do is replace some of the libraries that come with OC4J by default. This is something that we support in 10.1.3 preview.
See their page for some information on swaping libraries that come with OC4J (for example the JDBC libs or XML parsers):
http://www.oracle.com/technology/tech/java/oc4j/1013/howtos/index.html
jtrobins

Posts: 21
Registered: 04/06/02
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: May 2, 2005 8:28 AM   in response to: lmertins in response to: lmertins
Click to report abuse...   Click to reply to this thread Reply
I have not been able to get hibernate 3.0 to work with the embedded OC4J. The following error is thrown in the CharScanner class

CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

The class referenced is definitely in the class path of the web app. I think it is a class loader problem. If anyone has gotten this combination to work could you please post a solution? If I solve the problem I will do likewise.
dvohra16

Posts: 6,037
Registered: 07/02/01
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: May 2, 2005 8:44 AM   in response to: jtrobins in response to: jtrobins
Click to report abuse...   Click to reply to this thread Reply
Set the property
hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory


in hibernate.properties file.
jtrobins

Posts: 21
Registered: 04/06/02
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: May 2, 2005 9:02 AM   in response to: dvohra16 in response to: dvohra16
Click to report abuse...   Click to reply to this thread Reply
That will work but you loose some of the advanced parser features included in Hibernate 3.0.

I found another solution. The conflict is with the antlr.jar which is included in the toplink folder of the oc4j distribution. If you are not using toplink just remove the entire folder. I can now run my hibernate 3.0 application with the embedded oc4j.

Jim
user457068

Posts: 1
Registered: 10/13/05
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Oct 13, 2005 9:51 AM   in response to: jtrobins in response to: jtrobins
Click to report abuse...   Click to reply to this thread Reply
Jim, you are my Idol!!!!

I'm evaluating JDeveloper (for the first time, not migrating from a previous version), so I'm realy brand new with this environment.

Now that I see that you (maybe) go in the same direction I go, please, give me your opinion about one point.

I can see JDeveloper gives the developer a lot of code-generating advantages if you accept using ADF and the rest of the whole Oracle proposed environment. Specifically, the amazing speed you can get on binding the three tiers: database (with connections and drag-and-drops for tables), Business Objects and logic (with middle tier wizards) and presentation tier (with that great drag-and-drop jsp creation tool). I think all this tools can really make a speed-difference…

But… I don’t like “proprietary solutions”, I like open-source-standards, so… I prefer Hibernate (3.0.5), any structural-framework, like Struts or whichever, and for example JSF for the presentation tier (still evaluating this point)

I’ve seen that tutorial about using Hibernate + JSF with JDeveloper (http://www.oracle.com/technology/pub/articles/vohra_hibernate.html) but it didn’t satisfied me too much: It’s written for Hibernate 2.1.8 and migrating to Hibernate 3.0 is not possible without a headache…


So finally, I decided to import a “neutrally” built Struts + Hibernate 3.0 project and try to “speed it up” using JDeveloper. And then it was when I hit my head against this problem you’ve just solved! Jiiiimy, Jiiiiimy!!!! :-))))))

So, finally, my questions:

1) Would you say that if I’m developing this within this kind of tools, then JDeveloper still gives me much of the speed It gives in the first case? Can I drag-and-speedy-drop from database to model tier, or from model to control or to presentation tiers without introducing any Oracle libraries in my project? How? Do you have any example?
2) In your opinion, which is the best environment for speeding up this whole development process: JDeveloper, Eclipse + Exadel or any other plug-in environment? Any other you may prefer?

Hey, again, thanks a lot!! Oracle should take note of the bug you detected (and maybe pay you some bucks for it :-))

Fer

dvohra16

Posts: 6,037
Registered: 07/02/01
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Oct 13, 2005 10:22 AM   in response to: user457068 in response to: user457068
Click to report abuse...   Click to reply to this thread Reply
Hibernate 3.0 is similar to Hibernate 2.1.8

1. In Hibernate 3.0 the Hibernate 2.1.8 task class net.sf.hibernate.tool.hbm2ddl.SchemaExportTask is replaced with org.hibernate.tool.hbm2ddl.SchemaExportTask

2. Hibernate 3.0 does not provide a task class equivalent to the Hibernate 2.1.8
net.sf.hibernate.tool.hbm2java.Hbm2JavaTask. The Java bean classes are required to be provided prior to developing a Hibernate application.

3. In Hibernate 3.0 the Hibernate 2.1.8 net.sf.hibernate package API is replaced with org.hibernate API.

4. In Hibernate 3.0 the net.sf.hibernate.cfg package is replaced with org.hibernate.cfg package API.

rajvissa

Posts: 149
Registered: 05/11/00
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Oct 14, 2005 6:21 AM   in response to: dvohra16 in response to: dvohra16
Click to report abuse...   Click to reply to this thread Reply
Refer to http://technology.amis.nl/blog/index.php?p=705 for Hibernate 3.0 with JDev 10.1.3
randhawag

Posts: 53
Registered: 10/11/01
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Mar 15, 2006 4:12 PM   in response to: rajvissa in response to: rajvissa
Click to report abuse...   Click to reply to this thread Reply
Thanks to Jim for posting about antlr.jar in toplink distribution...we were having the same class not found exception...

our app works now with hibernate.

Gurinder
Dudu2

Posts: 76
Registered: 11/22/05
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Aug 30, 2006 12:45 PM   in response to: jtrobins in response to: jtrobins
Click to report abuse...   Click to reply to this thread Reply
go to the toplink/lib folder of jdev and replace the antlr.jar by the antlrxxx.jar that comes with libs needed by hibernate.
Doug Clarke

Posts: 1,933
Registered: 06/25/02
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Aug 30, 2006 1:37 PM   in response to: Dudu2 in response to: Dudu2
Click to report abuse...   Click to reply to this thread Reply
TopLink serves several functions in the OC4J install:

1. Allows customers to use our POJO ORM solution
2. Allows customers to use EJB 2.1 as the persistence provider
3. Allows customers to go object-xml mapping (JAXB)
4. Used by several internal application server components for ORM and OXM functionality

For these reasons I would not recommend deleting the toplink folder in an OC4J install.

The ANTLR library is used for parsing of EJB 2.1 QL statements. If you are not using EJB 2.1 CMP/BMP with EJB QL then TopLink will not require this library and replacing it with the 2.7.X (X > 2) version shipped in Hibernate should not cause any negative effects to your OC4J install.

Note: TopLink Essentials JPA is independent of this issue

Doug
Doug Clarke

Posts: 1,933
Registered: 06/25/02
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Sep 6, 2006 8:33 AM   in response to: Doug Clarke in response to: Doug Clarke
Click to report abuse...   Click to reply to this thread Reply
The better solution for handling conflicts between TopLink and other libraries when TopLink is not being used is to remove it as a shared library for you application.

This can be done within the orion-application.xml file with the following:

  <imported-shared-libraries>
    <remove-inherited name="oracle.toplink"/>
  </imported-shared-libraries>


Doug
pmadridb

Posts: 23
Registered: 03/29/07
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Jun 25, 2007 6:06 AM   in response to: Doug Clarke in response to: Doug Clarke
Click to report abuse...   Click to reply to this thread Reply
I was told by an Oracle expert that if you replace/remove any internal component of the application server, you won't be able to receive support from Oracle or any of its partners.

I think the solution posted by Doug is the one recommended by Oracle.
oreo_masta

Posts: 5
Registered: 08/21/07
Re: JDeveloper 10.1.3 preview and Hibernate 3.0
Posted: Aug 21, 2007 6:38 PM   in response to: Doug Clarke in response to: Doug Clarke
Click to report abuse...   Click to reply to this thread Reply
The better solution for handling conflicts between
TopLink and other libraries when TopLink is not being
used is to remove it as a shared library for you
application.

This can be done within the orion-application.xml
file with the following:

  <imported-shared-libraries>
  <remove-inherited name="oracle.toplink"/>
</imported-shared-libraries>

Doug


Thank you, Doug! This saved my day!

Configuration seems much more sensible than deleting files :)

For any others who may still find this post. The errors printed revolved around org.hibernate.hql.ast.HqlToken and other areas where I had used HQL.

The errors came up when I was testing my application on an OC4J server. The conflicting antlr.jar files seem to be the cause of the problem. Doug's fix to the orion-application.xml file is the trick!

Thanks!

EDIT: This configuration worked out slick for my local oc4j server that I test on. When it came time to deploy to my institution's Oracle Application Server the configuration did not stick. I then had to follow the instructions of this article to remove the import upon deploy time:

http://download.oracle.com/docs/cd/B25221_04/web.1013/b14433/classload.htm#CIHFABFI

Message was edited by:
oreo_masta
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums