-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Hibernate 3 (RC1)/ WebLogic startup problem
PostPosted: Thu Mar 03, 2005 11:51 am 
Newbie

Joined: Thu Mar 03, 2005 11:41 am
Posts: 6
Upgrading a Hibernate 2.8 app to Hibernate 3. (RC1)
We have updated all the xml config files and made required code changes.
Deploy of app now actually kills the WebLogic 8.1 server process. The end of the log looks like this:

2005-03-03 10:19:17,869 INFO - SessionFactoryImpl.checkNamedQueries(366) | Chec
king 0 named queries
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

C:\bea\user_projects\domains\mydomain>

The confusing part is lots of Hibernate related 'stuff' has been done already by this point - any reason why the 'CharScanner' wouldnt be able to find this HqlToken class?

Mike


Top
 Profile  
 
 Post subject: WLS 8.1 and Antlr HqlToken problem
PostPosted: Thu Mar 03, 2005 12:46 pm 
Newbie

Joined: Mon Feb 28, 2005 11:42 am
Posts: 1
I am also using Weblogic 8.1 and experiencing the same bug. It looks like antlr comes with weblogic.jar and is loaded in the wls classpath. Please let us know if you find a work around.

One developer here mentioned adding the following to weblogic.xml

Code:
<weblogic-web-app>
  <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
  </container-descriptor>
</weblogic-web-app>


I am still looking into this so not sure if this is the best approach.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 3:10 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
do you have antlr in your CP

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 3:19 pm 
Newbie

Joined: Thu Mar 03, 2005 11:41 am
Posts: 6
Yes antlr.jar is in the web-inf/lib dor of the war, but not visible to the higher levels of the ear. I must admit at this point I cannot recall why it was needed or what it was for. Where does it belong?

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 3:30 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It has to be in the same visibility scope as hibernate.jar. This is used for the query parser

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 5:12 pm 
Newbie

Joined: Thu Mar 03, 2005 11:41 am
Posts: 6
I now have the antlr.jar top level with hibernate3.jar. I see the same problem. Perhaps the first response is correct and the antlr classes are in the weblogic classpath and causing classloader issues. Has anyone yet used Hibernate3 with weblogic sucessfully? Any other suggestions?

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 05, 2005 4:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I did but I must admit it was with the old parser

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 9:43 am 
Newbie

Joined: Sun Jun 06, 2004 2:19 pm
Posts: 2
Location: Friedrichshafen, Germany
With release candidate 1 of hibernate3 I am facing the same problems (charscanner panic abort), so I switched back to beta 4 which works fine with Bea 8.1.3 as well as 8.1.4.

I also played a little bit with different configurations and places of the jars but without success. When using "<prefer-web-inf-classes>true</prefer-web-inf-classes>" I get a lot of other errors, mostly inside Spring (using a modified 1.1.5 with hibernate3). So this seems not to be a good solution for me.

Was the parser changed between beta 4 and rc1?


Top
 Profile  
 
 Post subject: Hibernate 3 (RC1) / WebLogic startup problem / CharScanner
PostPosted: Mon Mar 07, 2005 6:36 pm 
Newbie

Joined: Mon Mar 07, 2005 6:15 pm
Posts: 1
Location: London, UK
Hi,

I've also been battling this one.

I was fine using Hibernate 3.0 beta 4 on WebLogic 8.1 SP3/4, but something recent has broken things for me, although I haven't been able to spot quite what yet.

I tried the "<prefer-web-inf-classes>true</prefer-web-inf-classes>" trick (thanks "kurtlingle"), but the SessionFactory being bound to JNDI from a servlet in a WAR was then irretrievable to to the SessionBean I was trying to retrieve it from (when doing the lookup it gave an odd message about failing to instantiate something and lookup returned null).

I couldn't find a similar means of telling the EJB jar to prefer classes in its manifest (as none exists?).

Incidentally, in both the WAR and the EJB jar I had manifest entries referencing the Antlr jar from its parent EAR. Moving the jar to the WAR's WEB-INF/lib made no difference.

The weblogic.jar file does indeed contain some classes in the "antlr" package. Removing them (extract, remove, repackage) resulted in the correct classes being loaded from the WAR, *which worked*, but I'm not happy with it as a solution.

The class "org.hibernate.hql.ast.HqlToken.class" seems to extend "antlr.Token" which I think is the class not accessible. "antlr.CharScanner" gives up using "System.exit" when encountering a ClassNotFoundException.

I'm still not sure quite what changed to cause the problem though.

I've tried recompiling Hibernate against different versions of Antlr without improving anything and adding Antlr to the WebLogic classpath with a similar lack of improvement.

Better solutions, anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 3:29 pm 
Beginner
Beginner

Joined: Thu Feb 17, 2005 4:20 pm
Posts: 29
I am getting this too. However, none of the above solutions seem to work for me. I am putting the hibernate3.jar in the APP-INF/lib directory.

Should this be a JIRA issue?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 4:04 pm 
Beginner
Beginner

Joined: Thu Feb 17, 2005 4:20 pm
Posts: 29
I just found another work around. Place the following jars in front of the weblogic startup classpath:

antlr-2.7.4.jar
cglib-full-2.0.2.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.5.2.jar
ehcache-1.1.jar
log4j-1.2.9.jar
hibernate3.jar

Not sure if this is the best solution...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 5:58 pm 
Beginner
Beginner

Joined: Thu Feb 17, 2005 4:20 pm
Posts: 29
Ignore my previous work around. Here is a solution.

Set this property in your hibernate config file:

hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 8:56 am 
Newbie

Joined: Sun Jun 06, 2004 2:19 pm
Posts: 2
Location: Friedrichshafen, Germany
Does anybody know what the consequences are when using the ClassicQueryTranslatorFactory? Or what the differences are?
I found nothing in the documentation about it.

_________________
Moritz


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 10:20 am 
Newbie

Joined: Thu Mar 03, 2005 11:41 am
Posts: 6
I tried this suggestion and now I get "Invalid SQL Statement" errors for queries that work quite well using 2.1.x.

Anyone from Hibernate have any more info on this?

Mike


Top
 Profile  
 
 Post subject: refactoring?
PostPosted: Thu Mar 10, 2005 5:41 am 
Newbie

Joined: Thu Jan 08, 2004 11:54 am
Posts: 10
I need this to work in Weblogic 8.1 too, though I don't have any existing Hibernate 2.1 queries to port so ClassicQueryTranslatorFactory may be fine for me.

BEA refactor a lot of the open-source packages they use, for example xerces and xalan, into a different package, weblogic.apache.xerces instead of org.apache.xerces. This means you're free to use a different version if you want to. Unfortunately antlr (2.7.1) is one of the packages they haven't refactored.

Has anyone tried refactoring hibernate's antlr 2.7.4 in hibernate?

Or does the custom weblogic classloader hierarchy feature help?
http://e-docs.bea.com/wls/docs81/programming/classloading.html#1083313
I haven't tried these things yet; just wondering if anyone else has.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.