-->
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.  [ 5 posts ] 
Author Message
 Post subject: Strange error
PostPosted: Thu Dec 22, 2005 1:15 pm 
Newbie

Joined: Wed Dec 21, 2005 4:03 pm
Posts: 11
Location: Pittsburgh
I've looked at this for awhile now. I don't know how it came about. More complex queries have been working in my app.

Table TIME_ZONE_CODE with columns
PK_TZCODE and DESCRIPTION

Java class Time_zone_code
public class Time_zone_code {
private String id;

private String description;

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getId() {
return id;
}

public void setId(String pk_tzcode) {
this.id = pk_tzcode;
}

}

HBM file Time_zone_code.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.fedex.ground.facility.model.objects.Time_zone_code" table="TIME_ZONE_CODE">
<id column="PK_TZCODE" name="id" type="string">
<generator class="native"/>
</id>
<property lazy="false" name="description"/>
</class>
</hibernate-mapping>

Error (queryin bold)
...
Caused by: org.springframework.orm.hibernate3.HibernateQueryException: in expected: time_zone_code [select time_zone_code from Time_zone_code time_zone_code]; nested exception is org.hibernate.QueryException: in expected: time_zone_code [select time_zone_code from Time_zone_code time_zone_code]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:652)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:413)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:370)
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:337)
at com.fedex.ground.facility.model.dao.hibernate.InternalOrgDAOImpl.getGenericQueryResults(InternalOrgDAOImpl.java:33)
at com.fedex.ground.facility.model.service.spring.OrgServiceImpl.getTimeZones(OrgServiceImpl.java:159)
at com.fedex.ground.facility.view.bean.FacilityBean.init(FacilityBean.java:690)
at com.fedex.ground.facility.view.bean.BaseBean.setServiceLocator(BaseBean.java:33)
... 48 more
Caused by: org.hibernate.QueryException: in expected: time_zone_code [select time_zone_code from Time_zone_code time_zone_code]
at org.hibernate.hql.classic.FromParser.token(FromParser.java:106)
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:86)
at org.hibernate.hql.classic.PreprocessingParser.end(PreprocessingParser.java:121)
at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:29)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:178)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:154)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:72)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:52)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:108)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1178)
at $Proxy9.createQuery(Unknown Source)
at com.fedex.ground.facility.model.dao.hibernate.InternalOrgDAOImpl$2.doInHibernate(InternalOrgDAOImpl.java:40)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365)

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 22, 2005 1:39 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
there is no time_zone_code field in the Time_zone_code class...

the query you are trying to execute doesn't make sense.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 22, 2005 1:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
any particular reason you are using Hibernate3, but then using Spring's Hibernate2 support stuff and having it use the older "classic" parser?

I would assume something in that combination is causing you problems.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 8:53 am 
Newbie

Joined: Wed Dec 21, 2005 4:03 pm
Posts: 11
Location: Pittsburgh
Steve,

I'm using the old parser because I'm running weblogic 8 and weblogic 8 has a problem with Hibernate 3's antlr jar file.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 9:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
update weblogics buggy antlr.jar with the one from hibernate - problem solved ;)

_________________
Max
Don't forget to rate


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