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: IndexOutOfBoundsException - Eclipse Hibernate Tools
PostPosted: Wed Jul 25, 2007 12:07 pm 
Newbie

Joined: Sun Oct 31, 2004 10:16 pm
Posts: 3
Summary: When I attempt to use the Reverse engineering tool from within Eclipse with the Hibernate plug-in I get a IndexOutOfBoundsException originating from the org.hibernate.tool.hbm2x.DocExporter.generatePackageSummary method.

I did not think this was a Eclipse-Hibernate config problem because I was able to reverse engineer a very simple schema (the ImageDb schema from the Spring samples) but now I'm not sure. I've simplified my own schema down to a single very dumb table.

My hibernate.cfg.xml looks correct since I can look at the Hibernate Configurations tab in eclipse and see the table I'm trying to reverse engineer.

When I select the Schema Documentation exporter and attempt the reverse engineering process the assets, entities, tables directories and various Index.html files are created. At that point I see the IndexOutOfBounds Exception.

If I deselect the Schema Documentation exporter and any combination of the other options nothing seems to happen and I don't see anything in the error log.

I've double checked the jave vm (jdk1.5.0_10) and the dialect versus how the MySql tables are being created.

At this point I'm going to bail out of the Hibernate Eclipse tool on the assumption that there is an underlying error that I'm missing and do the mappings by hand.

What would help is if someone could post their Eclipse Configuration Details from a working Hibernate Tools installation so I can rule that out as a problem.

Hibernate version: Hibernate 3.2
Implementation-Title: Hibernate3
Implementation-Version: 3.2.4.sp1
Hibernate-Version: 3.2.4.sp1

Eclipse Version:
Version: 3.2.2
Build id: M20070212-1330

Hibernate Plug-in
Hibernate Tools 3.2.0.beta9a

Name and version of the database you are using:
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)

Hibernate Config file
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/TopicTreeEditor</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>


Full stack trace of any exception that occurs:
!SUBENTRY 1 org.hibernate.eclipse.console 4 666 2007-07-25 10:33:21.250
!MESSAGE java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.remove(ArrayList.java:389)
at org.hibernate.tool.hbm2x.DocExporter.generatePackageSummary(DocExporter.java:386)
at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:161)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate$1.execute(CodeGenerationLaunchDelegate.java:257)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:228)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:130)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:639)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:565)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:754)
at org.eclipse.debug.internal.ui.DebugUIPlugin$5.run(DebugUIPlugin.java:827)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)


Top
 Profile  
 
 Post subject: A bit more Info.
PostPosted: Wed Jul 25, 2007 3:11 pm 
Newbie

Joined: Sun Oct 31, 2004 10:16 pm
Posts: 3
A bit more information.

I created my own hibernate mapping file and the corresponding java class for one of the tables in my database. I added that mapping file to my existing hibernate cfg file. With that configuration I was able to open up a HQL Editor and run queries against that table.

That rules out one set of errors at least.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 31, 2007 9:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i've seen this error before but haven't been able to reproduce it...a minimal set of mappings would be great and submit that to jira so we can look at it.

most likely just a bug in hbm2doc handling of packages.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 01, 2007 9:36 am 
Newbie

Joined: Sun Oct 31, 2004 10:16 pm
Posts: 3
Thanks for the reply!

I've moved on from where I was and everything is working the way it should at the moment. I have not been able to reproduce the problem. I will take some time this weekend to start from a 'clean slate' and try to replicate the steps that caused the problem.

I'll post a reply this weekend.


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.