Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2008

Tip: Looking for answers? Try searching our database.

String index out of range: -1 only occurs when using java.lang.Thread

Thread view: 
phillip.s.powell@gmail.com - 04 Mar 2008 18:02 GMT
I have a JSP script I stripped down to just this one scriptlet:

<%

  Thread t = new Thread(new Runnable() {
       public void run() {
         System.out.println("Hello World");
       }
  });

  t.start();
  t.join(5000);
%>
<html>
<head>
<title>Hello</title>
</head>
<body>Hello World</body>
</html>

Whenever I try to run this I get the following output:

Error 500: String index out of range: -1

It doesn't give line number or any other explanation, furthermore, the
logs have no entry of anything for the time period whereby I ran this
script via browser.

Whenever I take out the Thread reference the script runs just fine,
even if I add other scriptlets with JSP code elsewhere, otherwise, as
long as this "empty" or "useless" thread exists, I get the weird and
very nondescript error.

Ideas?

Phil
Roger Lindsjö - 09 Mar 2008 19:34 GMT
> I have a JSP script I stripped down to just this one scriptlet:
>
[quoted text clipped - 30 lines]
>
> Ideas?

Works fine for me on both tomcat 5.5.26 and 6.0.16. What version are you
running?

Signature

Roger Lindsjö



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.