GeeklyX / restclient-tool

Automatically exported from code.google.com/p/restclient-tool
0 stars 0 forks source link

StringIndexOutOfBoundsException on Eclipse 3.7 #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open the RestClient Tool view
2. Enter http://google.com/ in the address bar
3. Hit run

What is the expected output? What do you see instead?
Expected is the HTML code from google.com, instead I see the following:
"Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String 
index out of range: 0)"

Additionally the Eclipse error log shows the following stack trace:
org.eclipse.swt.SWTException: Failed to execute runnable 
(java.lang.StringIndexOutOfBoundsException: String index out of range: 0)
    at org.eclipse.swt.SWT.error(SWT.java:4282)
    at org.eclipse.swt.SWT.error(SWT.java:4197)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    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:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
range: 0
    at java.lang.String.charAt(String.java:694)
    at org.eclipse.swt.browser.WebKit.setUrl(WebKit.java:1300)
    at org.eclipse.swt.browser.Browser.setUrl(Browser.java:1061)
    at org.eclipse.swt.browser.Browser.setUrl(Browser.java:1029)
    at code.google.restclient.ui.MainWindow.populateBrowser(MainWindow.java:579)
    at code.google.restclient.ui.MainWindow.access$900(MainWindow.java:57)
    at code.google.restclient.ui.MainWindow$7$1.run(MainWindow.java:496)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    ... 23 more

What version of the product are you using? On what operating system?
RestClient 1.0.2
Eclipse 3.7
Linux 64bit

Please provide any additional information below.

Original issue reported on code.google.com by sebh...@gmail.com on 24 Jul 2011 at 3:47

GoogleCodeExporter commented 8 years ago
Works fine on galileo eclipse 3.5. Refer attached screen shot.

Did you get chance to check on 64 bit eclipse-3.5?

Original comment by a1yadu on 24 Jul 2011 at 5:13

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by a1yadu on 24 Jul 2011 at 5:14

GoogleCodeExporter commented 8 years ago
I just checked Eclipse 3.5.2 and 3.6.2. Both do not respond to the run-button. 
No errors inside the logs.

Original comment by sebh...@gmail.com on 24 Jul 2011 at 6:50

GoogleCodeExporter commented 8 years ago
how about using http://www.google.com or any other url?

Original comment by a1yadu on 24 Jul 2011 at 6:55

GoogleCodeExporter commented 8 years ago
Tried it with several URLs, with and without http and/or www in front and all 
the available HTTP methods. Only on 3.7 I get a reaction, but that is the stack 
trace posted above.

Original comment by sebh...@gmail.com on 24 Jul 2011 at 7:01

GoogleCodeExporter commented 8 years ago
Thanks for trying out.

There can be an issue with either 64 bit SWT library or its linux version. I'll 
take a look whenever I get such an environment. Just FYI.. It has been built 
and tested on 32 bit SWT. But ideally it should work, out of eclipse, for other 
versions as well, because SWT is supposed to show same behavior no matter what 
kind of environment it's running under.

Original comment by a1yadu on 24 Jul 2011 at 7:11

GoogleCodeExporter commented 8 years ago
I am running Eclipse 3.7.0 on Linux 64 bit and I have the same issue. 
In the response window which is 2nd to last I see that is does have the 
response but gets quickly over written by the error. So something is failing 
after it has the response. Cant' get a screen shot as it happens too quickly.

Original comment by davidcar...@gmail.com on 21 Sep 2011 at 11:28

GoogleCodeExporter commented 8 years ago
I'll take a look. Thanks David, for raising it.

Original comment by a1yadu on 22 Sep 2011 at 2:39

GoogleCodeExporter commented 8 years ago

Original comment by a1yadu on 16 Nov 2011 at 6:53

GoogleCodeExporter commented 8 years ago
I have the same problem running eclipse 3.7.1 on Ubuntu Linux (11.10) 32 bit

Original comment by jan.dhol...@gmail.com on 26 Dec 2011 at 10:42

GoogleCodeExporter commented 8 years ago
Same problem on Eclipse 3.7 on Ubuntu 11.10 32bit as well.  Tool looks nice, 
but is totally nonfunctional.

Original comment by David.H....@gmail.com on 25 Jan 2012 at 12:00

GoogleCodeExporter commented 8 years ago
just installed from the update site, V1.0.3 on Eclipse 3.7, Ubuntu 11.10 64bit, 
and for all the requests I tried I got only: 
"Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String 
index out of range: 0)"

Original comment by davideda...@gmail.com on 23 Mar 2012 at 3:40

GoogleCodeExporter commented 8 years ago
That is a problem from SWT 3.7.0, if the URL is empty, the WebKit class of SWT 
generates a MalformedUrlException and then comes an access to url.char(0). You 
could only catch that exception or use "http://" instead of "".

Original comment by pho...@gmx.de on 14 Aug 2012 at 8:40

GoogleCodeExporter commented 8 years ago
I have changed one line and the exception doesn't longer occur.
You should checkout /trunk/standalone and trunk/plugin as two single projects, 
don't checkout /trunk. Follow the instructions on /trunk/docs/build_process.txt.

Original comment by pho...@gmx.de on 14 Aug 2012 at 10:43

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks phosco, I'll include your fix in next release.

-Yadu

Original comment by a1yadu on 14 Aug 2012 at 2:52

GoogleCodeExporter commented 8 years ago
seeing this issue - Eclipse Juno SR 2 on 64 bit Ubuntu 12.04 vm with RestClient 
Tool 1.0.3

Original comment by dylan.fa...@gmail.com on 11 Apr 2013 at 10:05

GoogleCodeExporter commented 8 years ago

Original comment by a1yadu on 18 Jul 2013 at 7:14

GoogleCodeExporter commented 8 years ago
Same problem - Eclipse 3.8.1.v20130118 - JDK 1.6.0.u43 - Fedora 17 x86_64 - 
RestClient Tool 1.0.3

Original comment by dbennett...@gmail.com on 7 Aug 2013 at 5:41

GoogleCodeExporter commented 8 years ago
Hi, was the fix is available ?

Original comment by j.brady....@gmail.com on 10 Dec 2013 at 7:33