-->
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.  [ 8 posts ] 
Author Message
 Post subject: Please help! java.lang.ArrayIndexOutOfBoundsException:
PostPosted: Mon Oct 27, 2003 2:57 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
Hi all,

I am getting this at runtime:

java.lang.ArrayIndexOutOfBoundsException: 1
at net.sf.hibernate.util.ArrayHelper.slice(ArrayHelper.java:59)
at net.sf.hibernate.loader.OuterJoinLoader.walkCompositeElementTree(OuterJoinLoader.java:284)
at net.sf.hibernate.loader.OuterJoinLoader.walkCollectionTree(OuterJoinLoader.java:108)
at net.sf.hibernate.loader.CollectionLoader.<init>(CollectionLoader.java:42)
at net.sf.hibernate.collection.CollectionPersister.createCollectionQuery(CollectionPersister.java:277)
at net.sf.hibernate.collection.CollectionPersister.<init>(CollectionPersister.java:268)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at com.db.beans.QoSMain.initHibernate(QoSMain.java:62)
at com.db.beans.QoSMain.go(QoSMain.java:68)
at com.db.beans.QoSMain.main(QoSMain.java:55)
Exception in thread "main"

I need urgent help!
Thanks in advance,

--steve


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 27, 2003 3:59 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 7:53 pm
Posts: 66
Location: Lakeland, Florida USA
Can you show more? Like the code in QoSMain.initHibernate?

Jeff


Top
 Profile  
 
 Post subject: the java code
PostPosted: Mon Oct 27, 2003 4:02 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
private void initHibernate() throws HibernateException {
// Load Configuration and build SessionFactory
Configuration cfg = new Configuration();
sessionFactory = cfg.configure().buildSessionFactory();
//new SchemaExport(cfg).create(true, true);
new SchemaUpdate(cfg).execute(true);
}

please help.

Thx,

--steve


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 27, 2003 4:07 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
And the array mapping:

<array name="connectionRates" cascade="all">
<key>
<column name="rate_key" length="16"/>
</key>
<index column="rate_index"/>
<one-to-many class="com.db.device.LayerRateProxy"/>
</array>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 27, 2003 4:13 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 7:53 pm
Posts: 66
Location: Lakeland, Florida USA
I guess your mapping files are ok otherwise you'd get an error after the cfg.configure().buildSessionFactory(). I'm stumped, sorry,

Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2003 1:00 am 
Senior
Senior

Joined: Tue Sep 23, 2003 8:18 am
Posts: 137
Location: Johannesburg, South Africa
From the stacktrace, I'd agree with JWBoring, that it's the creation of your session factory that is failing. Make sure that you've followed the correct settings in either the properties file or the hibernate.cfg.xml file, and that (if needed) you reference them properly.

-G


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2003 3:45 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Having an arrayoutofbound exception (or in ArrayHelper) does not mean you have a mapping error on <array>.

Set hibernate to debug mode and post it, post your mapping files either (if not too big)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2003 5:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No, it is probably a mapping error. Not enough column mappings for the size of the type.

I'v just gone and added much better validation of that stuff to Hibernate 2.1.


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