-->
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-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Wed Nov 24, 2010 9:16 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
Hello!

I am using Hibernate Tools version 3.3.0.v20101016-0359-H111-Beta1 on Eclipse 3.6 Helios Service Release 1.
When I edit a HQL query and I tru to get auto-completion, in the Error Log I get the following error:

Error while performing HQL completion. If i expand the error, I get 2 nested errors which I think are identical:

java.lang.StringIndexOutOfBoundsException: String index out of range: 118

This is the stack trace:
Code:
java.lang.StringIndexOutOfBoundsException: String index out of range: 118
   at java.lang.String.<init>(Unknown Source)
   at java.lang.String.valueOf(Unknown Source)
   at org.hibernate.tool.ide.completion.HQLAnalyzer.getSubQueries(HQLAnalyzer.java:206)
   at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleSubQueries(HQLAnalyzer.java:130)
   at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleEntityNames(HQLAnalyzer.java:142)
   at org.hibernate.tool.ide.completion.HQLCodeAssist.codeComplete(HQLCodeAssist.java:41)
   at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeProposals(HQLCompletionProcessor.java:138)
   at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeCompletionProposals(HQLCompletionProcessor.java:81)
   at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1834)
   at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
   at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
   at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
   at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:376)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
   at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

This is the session data:
Code:
eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


Does anybody have an idea ?

Thank you in advance !


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Thu Nov 25, 2010 5:40 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
My query is very basic, something like:
Code:
select t1 from TableName1 t1


If I try to have HQL completion on the fields of t1 (adding . and pressing ctrl+space) that error occurs.
Code:
select t1.[text cursor here] from TableName1 t1


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Thu Nov 25, 2010 5:50 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Probably it is related to https://jira.jboss.org/browse/JBIDE-7339


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Thu Nov 25, 2010 9:34 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
It is probably related.
And yes, tatacalu, you should try to use the latest hibernate tools


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Thu Nov 25, 2010 2:02 pm 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
I will post the contents of the pojo and hbm.xml tomorrow morning.
I saw that the latest version of JBoss Tools 3.2 is Beta1:

https://www.jboss.org/tools/download/dev.html

ALso I checked for updates using Eclipse and it said that there are no updates available. Are you sure that Beta2 has been published on the update site ?

Thank you !


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Tue Dec 14, 2010 9:52 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
Hello,

Sorry for the late reply. I have updated to Beta2 of Hibernate Tools 3.3 and the problem persists. Here is the way I reproduced it:

First I wrote:
Code:
select

from TableName t1


afterwards i tried to use the auto-completion feature between select and from:

Code:
select
t1.[cursor here, ctrl-space]
from TableName t1


In the error log appears StringIndexOutOfBoundsException while in the Console [java console] appears:
Quote:
2010-12-14 15:50:25,619 ERROR main org.hibernate.hql.PARSER - line 3:6: unexpected token: fr
2010-12-14 15:50:25,619 WARN main org.hibernate.hql.ast.HqlParser - processEqualityExpression() : No expression to process!


do you have any idea about what could be the problem ?

thank you


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Tue Dec 14, 2010 10:04 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
tatacalu, do you have hibernate-tools.jar and hibernate.jar in your project classpath, which versions?


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Tue Dec 14, 2010 10:17 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
I am using the Hibernate Tools 3.3 Beta2 package for Eclipse IDE 3.6:
In the plugins directory i have:
org.hibernate.eclipse_3.4.0.v20101206-2100-H28-Beta2

This is the MANIFEST.MF of hibernate-tools.jar:
Quote:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: dgeraskov
Build-Jdk: 1.6.0_20
Implementation-Title: Hibernate Tools Core
Implementation-URL: http://www.hibernate.org/subprojects/tools.html
Implementation-Vendor: hibernate.org
Implementation-Vendor-Id: hibernate.org
Implementation-Version: 3.4.0.Beta2


This is the MANFIEST.MF of hibernate3.jar:
Quote:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: gbadner
Build-Jdk: 1.5.0_16
Specification-Title: Hibernate Distribution
Specification-Version: 3.5.6-Final
Specification-Vendor: Hibernate.org
Implementation-Title: Hibernate Distribution
Implementation-Version: 3.5.6-Final
Implementation-Vendor-Id: org.hibernate
Implementation-Vendor: Hibernate.org
Implementation-URL: http://hibernate.org


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Tue Dec 14, 2010 10:48 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
I asked about your project (in workspace).
Can you share your project with jars (and console configuration file - look for file "${ConsoleConfigurationName}.launch" in project or at ${workspace}/.metadata/.plugins/org.eclipse.debug.core/.launches directories)


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Tue Dec 14, 2010 11:10 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
For Eclipse Hibernate Tools I use a custom project which contains only:

hibernate.cfg.xml
*.xbm.xml files
*.java files [POJOs]
*.class files [the compiled java files]

I rely on the .jars provided by eclipse Hibernate Tools. The only jar I use is the JDBC connector.

i have no .launch files, i set up my Hibernate Configuration to automatically allocate a console:
[Edit Configuration -> Common->Allocate Console (necessary for input)]

So basically I have a project only for Hibernate queries.

Would you still like me to share the project ?


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Wed Dec 15, 2010 3:53 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
tatacalu, in your HQL Editor at the top panel you have selected console configuration. I guess you name it "Hibernate Configuration".
The console configuration is stored in a file. As you said there is no "${ConsoleConfigurationName}.launch" file in your project, it should be in "${workspace}/.metadata/.plugins/org.eclipse.debug.core/.launches" directory.
I would like to look at it.
The issue is really strange.


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Thu Dec 16, 2010 9:22 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
Oh, now I understood what you wanted. Here is the launch file:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType">
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;TATACALU_IFY_OJDBC&quot; path=&quot;3&quot; type=&quot;3&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;TATACALU_IFY_REVENG_CLASSES&quot; path=&quot;3&quot; type=&quot;3&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;TATACALU_IFY_REVENG_HBM_XML&quot; path=&quot;3&quot; type=&quot;3&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.hibernate.eclipse.launch.CFG_XML_FILE" value="\IFY_reveng_project\reverse_engineer\hibernate.cfg.xml"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="CORE"/>
<listAttribute key="org.hibernate.eclipse.launch.FILE_MAPPINGS"/>
<stringAttribute key="org.hibernate.eclipse.launchDIALECT" value="org.hibernate.dialect.Oracle10gDialect"/>
</launchConfiguration>


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Thu Dec 23, 2010 11:54 am 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
so, did anybody found out the cause of this behavior ?
thanks!


Top
 Profile  
 
 Post subject: Re: Hibernate Tools-HQL Editor-StringIndexOutOfBoundsException
PostPosted: Tue Jan 04, 2011 2:27 pm 
Newbie

Joined: Tue Oct 05, 2010 10:49 am
Posts: 13
Sorry for the late reply.
Thank you for your support regarding this issue!
So, just out of curiosity, this will be fixed in Beta3 ?

Cheers !


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.