-->
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.  [ 4 posts ] 
Author Message
 Post subject: Strange Exception
PostPosted: Wed Mar 16, 2005 12:24 pm 
Newbie

Joined: Tue Mar 15, 2005 8:30 pm
Posts: 5
Hello,

I have a problem with a "createQuery()" in hibernate 3.0 rc1. I have mapped a bean to the Postgresql 7.4 DB and stored the data. When I try to get the data back I get an Exception. It is my first hibernate project please point me in the right direction because I am seriously stuck.

Greetings
Sven

The stacktrace:
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@16672d6 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@cf40f5 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@b82368 [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:postgresql://localhost/sven, properties -> {user=******, password=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> 16672d6 ]

Exception in thread "main" java.lang.NoClassDefFoundError: antlr/ANTLRException
at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:27)
at org.hibernate.impl.SessionFactoryImpl.createQueryTranslators(SessionFactoryImpl.java:344)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:410)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:814)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:773)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:569)
at persistence.HInterface.getUser(HInterface.java:32)
at persistence.Hibernate_Test.main(Hibernate_Test.java:30)

My Java code looks like this:
Transaction ta = s.beginTransaction();
u = (Users) s.createQuery("from Users as u where u.UserName=?").setString(0, username).uniqueResult();
ta.commit();

My Mapping file looks like this:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class
name="persistence.Users"
table="USERS"
lazy="true"
>

<id
name="id"
column="USER_ID"
type="java.lang.Long"
>
<generator class="native">

</generator>
</id>

<property
name="fromhost"
type="java.lang.String"
column="FROMHOST"
/>

<property
name="mbox"
type="java.lang.String"
column="MBOX"
/>

<property
name="passwd"
type="java.lang.String"
column="PASSWD"
/>

<property
name="port"
type="java.lang.Integer"
column="PORT"
/>

<property
name="protocol"
type="java.lang.String"
column="PROTOCOL"
/>

<property
name="tohost"
type="java.lang.String"
column="TOHOST"
/>

<property
name="userName"
type="java.lang.String"
column="USERNAME"
not-null="true"
unique="true"
/>


</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:41 pm 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
Is antlr.jar in your runtime classpath?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 7:45 pm 
Newbie

Joined: Tue Mar 15, 2005 8:30 pm
Posts: 5
Yes ant-antlr-1.6.2.jar is in the class path.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 2:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
antlr.jar!=ant-antlr-1.6.2.jar

-max

_________________
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.  [ 4 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.