-->
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.  [ 9 posts ] 
Author Message
 Post subject: Hibernate Console Configuration: Error fetching children
PostPosted: Fri Aug 03, 2007 3:50 am 
Newbie

Joined: Fri Aug 03, 2007 3:28 am
Posts: 5
Hibernate Tools 3.2.0.beta8, Eclipse 3.3.0, Java 6

I have added in my classpath the mysql.jar and my pojos, but still getting

Error fetching children

Reason:
org.hibernate.console.HibernateConsoleRuntimeException: Could not load AnnotationConfiguration
Could not load AnnotationConfiguration
org.hibernate.MappingException: Unable to load class declared as <mapping class="org.directdemocracyportal.democracy.model.application.Agent"/> in the configuration:
Unable to load class declared as <mapping class="org.directdemocracyportal.democracy.model.application.Agent"/> in the configuration:
org.hibernate.MappingException: Unable to load class declared as <mapping class="org.directdemocracyportal.democracy.model.application.Agent"/> in the configuration:
Unable to load class declared as <mapping class="org.directdemocracyportal.democracy.model.application.Agent"/> in the configuration:
java.lang.ClassNotFoundException: org.directdemocracyportal.democracy.model.application.Agent
org.directdemocracyportal.democracy.model.application.Agent


This is my hibernate configuration:

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

<hibernate-configuration>
<session-factory>

<!-- Mysql version -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/democracy_test</property>
<property name="hibernate.connection.username">democracy</property>
<property name="hibernate.connection.password">directdemocracy</property>

<!-- Hsql version
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.connection.url">jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}democracyDB</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
-->

<property name="hibernate.generate_statistics">false</property>
<property name="hibernate.show_sql">false</property>

<mapping package="org.directdemocracyportal.democracy.model" />
<mapping class="org.directdemocracyportal.democracy.model.Agent"/>
<mapping class="org.directdemocracyportal.democracy.model.BaseEntity"/>
<mapping class="org.directdemocracyportal.democracy.model.Country"/>
<mapping class="org.directdemocracyportal.democracy.model.Election"/>
<mapping class="org.directdemocracyportal.democracy.model.ElectoralArea"/>
<mapping class="org.directdemocracyportal.democracy.model.application.Event"/>
<mapping class="org.directdemocracyportal.democracy.model.Government"/>
<mapping class="org.directdemocracyportal.democracy.model.Organisation"/>
<mapping class="org.directdemocracyportal.democracy.model.Person"/>
<mapping class="org.directdemocracyportal.democracy.model.application.Role"/>
<mapping class="org.directdemocracyportal.democracy.model.application.RoleAction"/>
<mapping class="org.directdemocracyportal.democracy.model.application.User"/>
<mapping class="org.directdemocracyportal.democracy.model.application.Authority"/>
<mapping class="org.directdemocracyportal.democracy.model.application.Portal"/>
<mapping class="org.directdemocracyportal.democracy.model.application.UserSession"/>
<mapping class="org.directdemocracyportal.democracy.model.PoliticalParty"/>
</session-factory>
</hibernate-configuration>

Note: This is from the edemocrazy project hosted on sf.net.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 4:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what is in the classpath ? have you tried just pointing your project to it ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 3:38 pm 
Newbie

Joined: Fri Aug 03, 2007 3:28 am
Posts: 5
Hi max,

thank you for your reply.

I don't know if I have setup my classpath correctly, I surtenly have tried various and many combinations. The sure thing is that Agent.java is included in the classpath so it makes no sense the ClassNotFoundException that gets thrown..

If I can provide you with more information please tell me to do so.

Regards,
enerata


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 04, 2007 8:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
start by showing what is in your classpath - what libs/src/dirs do you have in it?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 4:27 pm 
Newbie

Joined: Fri Aug 03, 2007 3:28 am
Posts: 5
Hi Max,

I tried various combinations for my classpath.

A. Simply adding the "target" folder with my compiled pojos and other compiled classes, gives me the same error.

B. A more sophisticated setup would include

1. mysql-connector-java-5.0.4.jar
2. my lib folder which contains these:
acegi-security-1.0.3.jar
antlr-2.7.6.jar
asm-1.5.3.jar
asm-attrs-1.5.3.jar
cglib-2.1_3.jar
cglib-nodep-2.1_3.jar
commons-beanutils-1.6.jar
commons-codec-1.3.jar
commons-digester-1.6.jar
commons-el-1.0.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
commons-validator-1.3.1.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
hibernate-3.2.1.ga.jar
hibernate-annotations-3.3.0.ga.jar
hibernate-commons-annotations-3.3.0.ga.jar
jasper-runtime-5.5.15.jar
jsp-api-2.0.jar
jstl-1.1.2.jar
jta-1.0.1B.jar
oro-2.0.8.jar
persistence-api-1.0.jar
spring-2.0.6.jar
standard-1.1.2.jar
struts-core-1.3.8.jar
struts-taglib-1.3.8.jar
struts-tiles-1.3.8.jar
3. rt.jar from my jdk installation
4. "target" with my compiled pojos

-

I have uploaded the src folder here:
http://rapidshare.com/files/47183348/src.zip.html

svn address for the whole project under "pressure":
https://edemocrazy.svn.sourceforge.net/ ... edemocrazy


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 4:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the class that is in the error is called org.directdemocracyportal.democracy.model.application.Agent but that is not listed in the cfg.xml...how come?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 4:51 pm 
Newbie

Joined: Fri Aug 03, 2007 3:28 am
Posts: 5
Hi Max,

I think it is listed in the cfg.xml, if that's what you mean:

...
<mapping class="org.directdemocracyportal.democracy.model.Agent"/>
...

my hibernate configuration is in my first post of the current thread.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 5:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
org.directdemocracyportal.democracy.model.application.Agent

is *not* the same as:

org.directdemocracyportal.democracy.model.Agent

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 5:19 pm 
Newbie

Joined: Fri Aug 03, 2007 3:28 am
Posts: 5
omg, how obvious it is that i'm a newbie.

Max thank you, I will revisit the whole process.. again!


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