• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am getting the following error while deploying the ear file in WLS 10.3.2 . This works fine in 9.2. I have done the following as work around.

a) Added the following in weblogic-application.xml.

<?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-application>
<prefer-application-packages>
<package-name>antlr.*</package-name>
</prefer-application-packages>
</weblogic-application>

It did not work for me.

b) added the antlr.jar in the PRE_CLASSPATH in startWebLogic.cmd.

This also did not work.

I am not sure whether I need to do any other step associated to the above solution. Please suggest.

Regards,
Prasanth
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The package constrain you configured is for antlr. Not hibernate
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you should set PRE_CLASSPATH in $DOMAIN_HOME/bin/setDomainEnv.sh
Since on this file, PRE_CLASSPATH are set to blank!
 
Prasanth S Pillai
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone. Weblogic had its own antlr jar file reference. Solution Add the respective changes in the weblogic.xml & weblogic-application.xml.
 
Ranch Hand
Posts: 44
Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prashant,

I'd be thankful, if you share the changes you made to weblogic.xml and/or weblogic-application.xml file.
I couldn't able to fix it.
Here is my environment details:
App server: Weblogic 10.3.3
Java: JDK1.6
JPA: hibernate-3.1.jar
 
Prasanth S Pillai
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Murali,

My workaround is published in http://sprasanth.blogspot.com/

Hope it helps
 
Murali Sridhar
Ranch Hand
Posts: 44
Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. But, no luck for me. Did you check the environment I sent to you.
I have both the files weblogic-application.xml in META-INF and weblogic.xml in WEb-INF.
Updates of these files is overriding my local configurations. Lookeing for the fix, where it has no dependencies in my app.

Even I tried with the PRE_CLASSPATH update in setDomainEnv.cmd for antlr-2.7.5.jar file.
Working on this to fix. Let you know the updates, if any.
 
Prasanth S Pillai
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The weblogic.xml changes are required only if you have a EAR file. From the explanation you have given, I presume that you have a windows environment. So you might need only the PRE_CLASSPATH changes in .cmd file.

But first you can verify the following

1. Check if there are more than one occurance of antlr_x_x.jar file in your environment.
2. If there are more occurring, which is obvious as you are getting the exception, then decide from where you want to load it & make changes accordingly.

I am sure this exception occurs due to wrong class loading.

Prasanth
 
Murali Sridhar
Ranch Hand
Posts: 44
Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prasanth,

Your check list helped me with some work around.
For 1. There's no more antlr jar file exists, except the WL10.3 provided.
2. I have loaded the file from 'startWebLogic.cmd' (updates for: set CLASSPATH=%WL_HOME%\common\lib\antlr-2.7.6.jar;%SAVE_CLASSPATH%)
and observed that its also working fine from 'setDomainEnv.cmd' (updates for: PRE_CLASSPATH="%{DOMAIN_HOME}%/../lib/pre_classpath_jar/antlr-2.7.6.jar

Make sure to load the file only once( not sure about the behavior, if we load it more than one).
**Only the antlr version:2.7.6 worked for me.
 
Prasanth S Pillai
Ranch Hand
Posts: 39
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to know that Murali.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic