-->
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.  [ 14 posts ] 
Author Message
 Post subject: Hibernate Tools IndexOutOfBoundsException
PostPosted: Tue Nov 20, 2007 7:22 am 
Newbie

Joined: Tue Nov 20, 2007 6:45 am
Posts: 1
Hi,

I have just started with hibernate and found this Hibernate Tool.
I was able to install it and creating a hibernate.cfg.xml.

When I now go to the HibernateConfigurations and add a configuratin with my database it shows me all the tables available. But when I try to start the code generation, I get the following Exception in Eclipse:


Image

Does anybody know what this could be?

Thanks and best regards,

Dennis


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 10:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
which exporters are you running in the code generation and what is in the error log ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 4:31 pm 
Newbie

Joined: Thu Nov 22, 2007 4:20 pm
Posts: 4
Djunker,

I'm getting the same thing in Eclipse 3.3.1 and Hibernate-tools-3.2.1.cr1 when trying to create pojos from Mysql5 schema.

I'll bet you are using Eclipse version > 3.2.x

Unfortunately for me & you it appears that Eclipse 3.3.1 is too new. See this:

http://www.hibernate.org/hib_docs/tools ... setup.html

Quote:

Hibernate tools can be used "standalone" via Ant 1.6.x or fully integrated into a Eclipse 3.2.x based IDE.

Regards.
Adam.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 5:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no - 3.3 works fine.

please look in error log and tell me what the stacktrace is...my guess is you are getting this while using hbm2doc - correct?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 5:56 pm 
Newbie

Joined: Thu Nov 22, 2007 4:20 pm
Posts: 4
max wrote:
no - 3.3 works fine.

please look in error log and tell me what the stacktrace is...my guess is you are getting this while using hbm2doc - correct?


Hi Max,

My Exporters selected for this test:

Use Java 5 Syntax
Generate EJB3 Annotations

Domain Code (.java)
DAO Code (.java)
Schema Documentation (.html)

Error:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0
<No message>

Log:

at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.remove(Unknown Source)
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:256)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:226)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:134)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:985)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)


Regards,
Adam.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 7:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yup so you hit a bug in hbm2doc ...disable that exporter and the rest should be fine.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 11:39 pm 
Newbie

Joined: Thu Nov 22, 2007 4:20 pm
Posts: 4
max wrote:
yup so you hit a bug in hbm2doc ...disable that exporter and the rest should be fine.


Hi Max,

Thanks again for taking the time to respond.

I did try for many hours to get it to work. I reinstalled a completely fresh installation with a new workspace. Now I get this:

org.hibernate.console.HibernateConsoleRuntimeException: Could not compute classpath
Could not compute classpath
org.eclipse.debug.core.DebugException: Launch configuration Adameclipse2 at C:\eclipse2_workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\Adameclipse2.launch does not exist.
Launch configuration Adameclipse2 at C:\eclipse2_workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\Adameclipse2.launch does not exist.
org.eclipse.debug.core.DebugException: Launch configuration Adameclipse2 at C:\eclipse2_workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\Adameclipse2.launch does not exist.
Launch configuration Adameclipse2 at C:\eclipse2_workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\Adameclipse2.launch does not exist.

Regards,
Adam.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 4:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that bug is fixed in svn.

workaround: remember to press apply before pressing ok ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 2:18 pm 
Newbie

Joined: Thu Nov 22, 2007 4:20 pm
Posts: 4
max wrote:

workaround: remember to press apply before pressing ok ;)


Ahhh…

It works.

Thanks again Max!

Next question: Is it possible for me to give you a rate not having started this thread?

Regards,
Adam.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 6:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
unfortunately not - only the starter can give points.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Hibernate Tools IndexOutOfBoundsException
PostPosted: Wed Dec 16, 2009 10:44 am 
Newbie

Joined: Tue Dec 15, 2009 9:01 am
Posts: 5
Hi Max,
I am getting the following error .
Error:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0
<No message>

i have selected Exporters for this
Use Java 5 Syntax
Domain Code (.java)
Schema Documentation (.html)

My eclipse version is 3.3


Top
 Profile  
 
 Post subject: Re: Hibernate Tools IndexOutOfBoundsException
PostPosted: Tue Dec 22, 2009 8:43 am 
Newbie

Joined: Tue Dec 22, 2009 8:30 am
Posts: 2
I have Hibernate tool version 3.2.4.v200909151014R-H192-GA configured in eclipse
I am getting same error
In error log


!ENTRY org.hibernate.eclipse.console 4 666 2009-12-22 17:38:06.828
!MESSAGE java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.remove(Unknown Source)
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:250)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:94)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:225)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:138)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


But when I deselects Schema Documentation
It neither gives any error nor generates any mapping or source code.....

I have simply created one Java project and then created one hibernate configuration file....
Am I missing something ?


Top
 Profile  
 
 Post subject: Re: Hibernate Tools IndexOutOfBoundsException
PostPosted: Tue Dec 22, 2009 10:05 am 
Newbie

Joined: Tue Dec 22, 2009 8:30 am
Posts: 2
Problem is solved I missed to check on
Reverse engineer from JDBC Connection on main tab without reveng.xml.

But when I provide reveng.xml ....no code or mapping are generated....


Top
 Profile  
 
 Post subject: Re: Hibernate Tools IndexOutOfBoundsException
PostPosted: Fri Mar 25, 2011 6:29 am 
Newbie

Joined: Thu Jan 13, 2011 11:54 am
Posts: 4
abhijitmhaske wrote:
Problem is solved I missed to check on
Reverse engineer from JDBC Connection on main tab without reveng.xml.

But when I provide reveng.xml ....no code or mapping are generated....


Can anyone tell me how to do this in the maven pom?

I'm trying to run hbm2doc from my pom and am getting an error. Error and pom snippet below:

Code:
2011-03-25 10:24:40,129:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/doc-style.css[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,129:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/doc-style.css[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-tools-3
.2.0.ga.jar!/doc/doc-style.css
2011-03-25 10:24:40,254:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/index.html[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,254:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/index.html[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-tools-3.2.
0.ga.jar!/doc/index.html
2011-03-25 10:24:40,270:INFO:main:org.hibernate.tool.hbm2x.DocExporter:Skipping entitygraph creation since dot.executable is empty or not-specified.
2011-03-25 10:24:40,270:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/tables/index.ftl[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,286:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/tables/index.ftl[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-tool
s-3.2.0.ga.jar!/doc/tables/index.ftl
2011-03-25 10:24:40,301:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/tables/summary.ftl[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,301:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/tables/summary.ftl[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-to
ols-3.2.0.ga.jar!/doc/tables/summary.ftl
2011-03-25 10:24:40,317:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/common.ftl[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,317:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/common.ftl[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-tools-3.2.
0.ga.jar!/doc/common.ftl
2011-03-25 10:24:40,348:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/tables/schema-list.ftl[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,364:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/tables/schema-list.ftl[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernat
e-tools-3.2.0.ga.jar!/doc/tables/schema-list.ftl
2011-03-25 10:24:40,379:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/tables/table-list.ftl[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,379:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/tables/table-list.ftl[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate
-tools-3.2.0.ga.jar!/doc/tables/table-list.ftl
2011-03-25 10:24:40,395:DEBUG:main:freemarker.cache:Could not find template in cache, creating new one; id=[doc/entities/index.ftl[en_IE,Cp1252,parsed] ]
2011-03-25 10:24:40,395:DEBUG:main:freemarker.cache:Compiling FreeMarker template doc/entities/index.ftl[en_IE,Cp1252,parsed]  from jar:file:/C:/.m2/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-to
ols-3.2.0.ga.jar!/doc/entities/index.ftl
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.203s
[INFO] Finished at: Fri Mar 25 10:24:40 GMT 2011
[INFO] Final Memory: 9M/495M
2011-03-25 10:24:40,489:INFO:Finalizer:org.hibernate.connection.DriverManagerConnectionProvider:cleaning up connection pool: jdbc:mysql://localhost:3306/ads
[INFO] ------------------------------------------------------------------------
2011-03-25 10:24:40,489:INFO:Finalizer:org.hibernate.connection.DriverManagerConnectionProvider:cleaning up connection pool: jdbc:mysql://localhost:3306/ads
[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2doc (hbm2doc) on project application: Execution hbm2doc of goal org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2doc f
ailed: Index: 0, Size: 0 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.


Quote:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>hbm2doc</id>
<phase>install</phase>
<goals>
<goal>hbm2doc</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2doc</name>

<implementation>annotationconfiguration</implementation>

<outputDirectory>target/htmlDocs/test</outputDirectory>
</component>
</components>
<componentProperties>

<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
<revengfile>src/main/resources/hibernate.reveng.xml</revengfile>

<jdk5>true</jdk5>
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<type>jar</type>
<version>5.0.8</version>
</dependency>
</dependencies>
</plugin>


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