-->
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.  [ 3 posts ] 
Author Message
 Post subject: ClassCastException org.hibernate.hql.ast.HqlToken
PostPosted: Fri Apr 28, 2006 6:32 pm 
Newbie

Joined: Thu Apr 01, 2004 3:31 pm
Posts: 4
We're using the following environment

1. JBoss 4.0.2
2. Hibernate 3.0
3. ActiveMQ 4.0

We were using ActiveMQ 3.2 without any issues before upgrading to version 4.0. On upgrade we've started getting the following exception. We've even tried upgrading to JBoss 4.0.3 SP1, but that didn't help either.

The sequence is, JBoss deploys our web app on startup and the user logs in. This where we access db tables using hibernate. This works fine. We then leave the app untouched for half hour, and try to relogin back as the app. session timesout. This is when we get the issue. The underlying table content has not changed at all. We're using the antlr jar that was bundled with hibernate3.0 distribution. The hibernate query
and config file content is listed below..


2006-04-14 17:21:37,246 INFO [STDOUT] java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken
2006-04-14 17:21:37,247 INFO [STDOUT] at antlr.CharScanner.makeToken(CharScanner.java:175)
2006-04-14 17:21:37,247 INFO [STDOUT] at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:33)
2006-04-14 17:21:37,247 INFO [STDOUT] at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:632)
2006-04-14 17:21:37,247 INFO [STDOUT] at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:225)
2006-04-14 17:21:37,247 INFO [STDOUT] at antlr.TokenBuffer.fill(TokenBuffer.java:69)
2006-04-14 17:21:37,247 INFO [STDOUT] at antlr.TokenBuffer.LA(TokenBuffer.java:80)
2006-04-14 17:21:37,247 INFO [STDOUT] at antlr.LLkParser.LA(LLkParser.java:52)
2006-04-14 17:21:37,247 INFO [STDOUT] at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:130)
2006-04-14 17:21:37,247 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
2006-04-14 17:21:37,247 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
2006-04-14 17:21:37,248 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
2006-04-14 17:21:37,248 INFO [STDOUT] at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
2006-04-14 17:21:37,248 INFO [STDOUT] at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
2006-04-14 17:21:37,248 INFO [STDOUT] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
2006-04-14 17:21:37,248 INFO [STDOUT] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)




<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>

<session-factory>

<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="connection.url">jdbc:mysql://localhost:3306/userdb?autoReconnect=true</property>
<property name="show_sql">false</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="c3p0.max_size">2</property>
<property name="c3p0.min_size">1</property>
<property name="c3p0.timeout">300</property>
<property name="c3p0.idleTestPeriod">300</property>

<mapping resource="/com/reconnex/analyst/manager/database/ReResourceRole.hbm.xml" />
<mapping resource="/com/reconnex/analyst/manager/database/ReTaskRole.hbm.xml" />
<mapping resource="/com/reconnex/analyst/manager/database/ReUser.hbm.xml" />
<mapping resource="/com/reconnex/analyst/manager/database/ReGroup.hbm.xml" />
<mapping resource="/com/reconnex/analyst/manager/database/Device.hbm.xml" />
<mapping resource="/com/reconnex/analyst/manager/database/Domain.hbm.xml" />
</session-factory>
</hibernate-configuration>



The table hbm.xml file that gives

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="com.reconnex.analyst.manager.database.Domain"
table="ReDomain"
>

<id
name="id"
column="Domain_id"
type="java.lang.Long"
>
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Domain.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<property
name="domainName"
type="java.lang.String"
column="Domain_name"
length="200"
/>

<property
name="domainType"
type="java.lang.String"
column="Domain_type"
length="50"
/>

<property
name="ldapServerName"
type="java.lang.String"
column="Ldap_server_name"
length="100"
/>

<property
name="ldapServerPort"
type="java.lang.String"
column="Ldap_server_port"
length="10"
/>

<property
name="ldapServerBaseDN"
type="java.lang.String"
column="Ldap_server_basedn"
length="400"
/>

<property
name="ldapSSLEnabled"
type="byte"
column="Ldap_ssl_enabled"
access="field"
/>

<property
name="ldapUserName"
type="java.lang.String"
column="Ldap_user_name"
length="200"
/>

<property
name="ldapPassword"
type="java.lang.String"
column="Ldap_password"
length="100"
/>

<property
name="ldapTimeout"
type="java.lang.String"
column="Ldap_timeout"
length="4"
/>

<property
name="ldapRetries"
type="java.lang.String"
column="Ldap_retries"
length="5"
/>

<property
name="ldapScope"
type="java.lang.String"
column="Ldap_scope"
length="10"
/>

<property
name="ldapLoginidAttribute"
type="java.lang.String"
column="Ldap_loginid_attribute"
length="30"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Domain.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>


The code that gives the above exception is

return session.createQuery("from Domain as ldapserver").setCacheable(true).list();


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 5:12 am 
Beginner
Beginner

Joined: Thu Apr 20, 2006 3:44 am
Posts: 32
Not sure is it the problem with Jar or is it the problem with the data which your logic is retrieving after your session time out....

I can suggest you 2 ways

1) Try changing your antlr.jar with another one
2) Check the SQL which your application is trying to execute, before and after session time out.....this shall give you idea , what kind of data is being retrievd in your application in both scenario......it looks like application exception to me and not related to Hibernate....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 5:54 pm 
Newbie

Joined: Thu Apr 01, 2004 3:31 pm
Posts: 4
This issue was resolved by upgrading from Hibernate 3.0 to 3.1 jar files


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.