-->
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: SessionFactory
PostPosted: Wed Sep 24, 2008 4:34 pm 
Newbie

Joined: Wed Sep 24, 2008 4:30 pm
Posts: 2
Hi,

Im running into this issue....

Initial SessionFactory creation failed.java.lang.StackOverflowError

Here is my code:

Configuration cfg = new Configuration().addResource("User.hbm.xml");
SessionFactory sessionFactory = cfg.buildSessionFactory();
Session session = (Session) sessionFactory.openSession();


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2008 6:09 pm 
Beginner
Beginner

Joined: Wed Sep 24, 2008 5:44 pm
Posts: 34
Does your User object by any chance contain a reference to itself?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 8:39 am 
Newbie

Joined: Wed Sep 24, 2008 4:30 pm
Posts: 2
public class User {
private long userId = 0 ;
private String firstName = "";
private String lastName = "";
private int age = 0;
private String email = "";

public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
}


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.