-->
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.  [ 12 posts ] 
Author Message
 Post subject: hibernate-3.x does not work with weblogic 8.1
PostPosted: Fri Sep 30, 2005 11:22 am 
Newbie

Joined: Fri Sep 09, 2005 11:11 am
Posts: 19
I have a simple java client that does the following
Query query = session.createQuery("....hql stmt...");
query.setString("userid", userid);
List list = query.list(); /* PROBLEM OCCUR in weblogic8.1! */


Above codes works smoothly as a standalone program. But when it is deployed into weblogic 8.1 as a web module.....

With hibernate 3.0
----------------------
statement "query.list()" crashs the server. I need to restart weblogic server.

With hibernate 3.1
---------------------
statement "query.list" cause the following exception
[ERROR]org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select x1.mgmtCompanyCode from com.fundserv.aia.persistent.IFPSLoginXRef x1, com.fundserv.aia.persistent.Company m1 where x1.mgmtCompanyCode = m1.companyCode and m1.statusCD = 'A' and x1.userid = :userid]
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
at antlr.CharScanner.<init>(CharScanner.java:51)
at antlr.CharScanner.<init>(CharScanner.java:60)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:56)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:53)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:50)
at org.hibernate.hql.ast.HqlLexer.<init>(HqlLexer.java:26)
at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:45)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:151)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:101)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:468)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1025)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:975)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.fundserv.aia.dao.UserDAO.load(Unknown Source)
at com.fundserv.aia.busobj.IFPSBusinessLogic.findUserBySessionID(Unknown Source)
at com.fundserv.aia.actions.IFPSAuthBaseAction.process(Unknown Source)
at com.fundserv.aia.actions.IFPSBaseAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

Any Idea?
I am a first time user of hibernate. Any information would be grateful.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:27 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
You apparently have some missing JAR files.


Maybe you just copied over your Hibernate3.jar and forgot the others
(ast, cglib, ehcache etc.)

_________________
Vincent Giguère
J2EE Developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:29 am 
Newbie

Joined: Fri Sep 09, 2005 11:11 am
Posts: 19
vgiguere wrote:
You apparently have some missing JAR files.


Maybe you just copied over your Hibernate3.jar and forgot the others
(ast, cglib, ehcache etc.)


The Missing symbol "org.hibernate.hql.ast.HqlToken" is actually in hibernate3.jar file. This jar file is already in WEB-INF/lib directory.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:33 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
Ok.

Is this code executing in the webapp side, or is it executing from and EJB Bean?

_________________
Vincent Giguère
J2EE Developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:34 am 
Newbie

Joined: Fri Sep 09, 2005 11:11 am
Posts: 19
vgiguere wrote:
Ok.

Is this code executing in the webapp side, or is it executing from and EJB Bean?


This code is executing in the webapp side. A BusinessLogic class invoked by a struts action class.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:36 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
Is this business logic class itself located in a jar under WEB-INF/lib?

_________________
Vincent Giguère
J2EE Developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:37 am 
Newbie

Joined: Fri Sep 09, 2005 11:11 am
Posts: 19
vgiguere wrote:
Is this business logic class itself located in a jar under WEB-INF/lib?


This BusinessLogic class is located under WEB-INF/classes


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:50 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
Well well...

Are you sure that there are none of your business classes that would get loaded by accident through weblogic server's classpath? Can you be 100% sure that the class that executes gets loaded from within your web application and not from some other jar that have been left in the server's classpath?

This really does not look like a hibernate problem but more like a web application structure or weblogic classpath problem.

_________________
Vincent Giguère
J2EE Developer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 11:56 am 
Newbie

Joined: Fri Sep 09, 2005 11:11 am
Posts: 19
vgiguere wrote:
Well well...

Are you sure that there are none of your business classes that would get loaded by accident through weblogic server's classpath? Can you be 100% sure that the class that executes gets loaded from within your web application and not from some other jar that have been left in the server's classpath?

This really does not look like a hibernate problem but more like a web application structure or weblogic classpath problem.


My classpath is unset. The complain missing symbol "org.hibernate.hql.ast.HqlToken" is already in hibernate3.jar.


Top
 Profile  
 
 Post subject: parser is the problem
PostPosted: Mon Oct 03, 2005 4:13 pm 
Beginner
Beginner

Joined: Thu Dec 09, 2004 7:04 pm
Posts: 26
Location: Denver, CO
Try using the classic parser. The new ANTLER parser does not play well with weblogic 8 (because it also uses an older version of the same parser).

Also take a look at the Hibernate2 -> Hibernate3 migration guide. It goes into more details on the issues.

Code:
        <!-- bea workaround for class loading... -->
        <property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2005 4:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that is the worst (but ok) workaround.

the best workaround is to place the antlr-*.jar we provide in the classpath of weblogic lib path (per the migration guide)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: if you can change the classpath, do so
PostPosted: Mon Oct 03, 2005 8:37 pm 
Beginner
Beginner

Joined: Thu Dec 09, 2004 7:04 pm
Posts: 26
Location: Denver, CO
max wrote:
that is the worst (but ok) workaround.

the best workaround is to place the antlr-*.jar we provide in the classpath of weblogic lib path (per the migration guide)


Our production people don't allow the changing of the weblogic classpath (which is a bummer). So if you can change the classpath, I'd use max's suggestion (per the migration guide).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

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.