-->
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: StringIndexOutOfBoundsException while configuring Hibernate
PostPosted: Thu Oct 30, 2003 12:02 pm 
Newbie

Joined: Thu Oct 30, 2003 11:54 am
Posts: 1
Hi!

I'm trying to create a simple Usermanagment backend. Therefore I have some many-to-many relationships and a one-to-one.

Now when I try

Configuration cfg = (new Configuration()).configure();

I get a StringIndexOutOfBoundsException.
The last thing hibernate "said" before was:

net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings

I'm a little bit confused, cause I have no one-to-many relationships defined.

Someone any ideas?

Thanks, Rico.

StackTrace of the Ex:
[java] java.lang.StringIndexOutOfBoundsException: String index out of range
: 0
[java] at java.lang.String.charAt(String.java:460)
[java] at net.sf.hibernate.mapping.Column.setName(Column.java:43)
[java] at net.sf.hibernate.cfg.Binder.bindColumns(Binder.java:328)
[java] at net.sf.hibernate.cfg.Binder.bindManyToOne(Binder.java:515)
[java] at net.sf.hibernate.cfg.Binder.bindCollectionSecondPass(Binder.j
ava:1050)
[java] at net.sf.hibernate.cfg.Binder.bindSetSecondPass(Binder.java:923
)
[java] at net.sf.hibernate.cfg.Binder$SetSecondPass.secondPass(Binder.j
ava:1187)
[java] at net.sf.hibernate.cfg.Binder$SecondPass.doSecondPass(Binder.ja
va:1135)
[java] at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configur
ation.java:497)
[java] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Config
uration.java:623)
[java] at de.bergmann.usermanagment.persistence.PersistenceManager.init
(Unknown Source)
[java] at de.bergmann.usermanagment.persistence.PersistenceManager.getI
nstance(Unknown Source)
[java] at de.bergmann.usermanagment.persistence.PersistenceManager.main
(Unknown Source)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 12:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Set Hibernate logging to debug and post the output. That will tell you on which mapping file it is choking.


Top
 Profile  
 
 Post subject: thanks, solved it
PostPosted: Mon Jun 23, 2008 3:45 pm 
Beginner
Beginner

Joined: Fri May 16, 2008 3:59 pm
Posts: 30
Thank you so much!

M : )


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 24, 2008 10:16 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
This type of setting in your log4j file will provide very verbose logging:


Code:
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### direct messages to file hibernate.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=hibernate.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### set log levels - for more verbose logging change 'info' to 'debug' ##

log4j.rootLogger=warn, file

log4j.logger.net.sf.hibernate=debug

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace

### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=debug

### log prepared statement cache activity ###
log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=debug

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