-->
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: new Annotation() --> java.lang.StackOverflowError
PostPosted: Wed Jul 02, 2008 11:14 am 
Newbie

Joined: Wed Jul 02, 2008 10:56 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hi,
I've a problem.
I'm starting to use hibernate annotation.

I downloaded hibernate core 3 and hibernate annotation libraries.
I have the follow file and the follow class:
hibernate.cfg.xml
..

<session-factory>
<property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:file:C:/database/test.db</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property> -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="show_sql">true</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hibernate.hbm2ddl.auto">update</property>

<mapping package="services"/>
<mapping class="services.User"/>

</session-factory>



User.java
package services;


import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.Entity;


@Entity
public class User {
@Id
@Column(name="CODE_USER")
private String id;
@Column private String name;

public String getId() {
return id;
}

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

.......


when it runs HibernateUtil.java at line:

Annotation a = new Annotation();


it throws this error:
java.lang.StackOverflowError
null
null
null



Can you help me!!?!!

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 11:14 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Stack overflow is usually a programming/JVM problem. You don't have recursive code calling itself somewhere, do you?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: it works
PostPosted: Wed Jul 09, 2008 3:38 am 
Newbie

Joined: Wed Jul 02, 2008 10:56 am
Posts: 2
Thanks, now my software works.
I created new Eclipse project and now it works well.
thanks
T


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 09, 2008 5:19 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Fantastic! I'm glad things finally worked themselves out. I guess the old JVM was just getting tired. :)

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.