You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Doug Reeder <re...@gmail.com> on 2008/11/07 07:29:09 UTC

StringIndexOutOfBoundsException in getClassFileName

I have an app (developed in NetBeans) which passes all the verifier  
tests and runs fine in GlassFish.  I'm able to deploy and start it  
running in Geronimo (2.1.3, Jetty), but when I try to actually access  
one of the JSPs, I get the following error:
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:558)
	at org.apache.jasper.compiler.JspUtil.makeJavaIdentifier(JspUtil.java: 
962)
	at  
org 
.apache 
.jasper 
.JspCompilationContext.getServletClassName(JspCompilationContext.java: 
371)
	at  
org 
.apache 
.jasper 
.JspCompilationContext.getClassFileName(JspCompilationContext.java:511)
	at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:403)
	at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:351)
	at  
org 
.apache 
.jasper.JspCompilationContext.compile(JspCompilationContext.java:582)
	at  
org 
.apache 
.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
	at  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
487)
	at  
org 
.apache 
.geronimo 
.jetty6 
.InternalJettyServletHolder.handle(InternalJettyServletHolder.java:65)
	at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
	at  
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
216)
	at  
org 
.apache 
.geronimo 
.jetty6.handler.JettySecurityHandler.handle(JettySecurityHandler.java: 
114)
	at  
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at  
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
405)
	at org.apache.geronimo.jetty6.handler.TwistyWebAppContext.access 
$101(TwistyWebAppContext.java:40)
	at org.apache.geronimo.jetty6.handler.TwistyWebAppContext 
$TwistyHandler.handle(TwistyWebAppContext.java:65)
	at  
org 
.apache 
.geronimo 
.jetty6 
.handler.ThreadClassloaderHandler.handle(ThreadClassloaderHandler.java: 
46)
	at  
org 
.apache 
.geronimo 
.jetty6 
.handler.InstanceContextHandler.handle(InstanceContextHandler.java:58)
	at  
org 
.apache 
.geronimo 
.jetty6 
.handler.UserTransactionHandler.handle(UserTransactionHandler.java:48)
	at  
org 
.apache 
.geronimo 
.jetty6 
.handler.ComponentContextHandler.handle(ComponentContextHandler.java:47)
	at  
org 
.apache 
.geronimo 
.jetty6.handler.TwistyWebAppContext.handle(TwistyWebAppContext.java:59)
	at  
org 
.mortbay 
.jetty 
.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java: 
206)
	at  
org 
.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java: 
114)
	at  
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
505)
	at org.mortbay.jetty.HttpConnection 
$RequestHandler.headerComplete(HttpConnection.java:828)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at  
org 
.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
395)
	at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214)
	at org.apache.geronimo.pool.ThreadPool 
$ContextClassLoaderRunnable.run(ThreadPool.java:344)
	at java.util.concurrent.ThreadPoolExecutor 
$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor 
$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:613)

1) Is there an analog to the verifier tool for Geronimo?
2) Where should I be looking to fix this? None of the source code  
files in the stack trace are mine!

This is all under Mac OS X 10.5.5 (Java 1.5.0_16) on an intel Mini.


Re: StringIndexOutOfBoundsException in getClassFileName

Posted by Doug Reeder <re...@gmail.com>.
http://myhost.org/FooApp/index.jsp
does work directly (it just generates a redirect to the real page)


On Nov 11, 2008, at 11:37 AM, Kevan Miller wrote:

>
> On Nov 8, 2008, at 12:48 AM, Doug Reeder wrote:
>
>> On Geronimo (Tomcat) 2.1.3, the JSP compiles and runs fine.  I  
>> can't attach my actual app to a Jira, but I'll see if I can pare it  
>> down to a test app.
>
> Thanks for testing that. A test app would be helpful.
>
> I'd guess that using the url http://myhost.org/FooApp/index.jsp ,  
> directly, works?
>
> --kevan
>
>
>>
>>
>>
>> On Nov 7, 2008, at 5:55 PM, Kevan Miller wrote:
>>
>>>
>>> On Nov 7, 2008, at 12:19 PM, Doug Reeder wrote:
>>>
>>>> The URL is the root URL for my web app, i.e. something like
>>>> myhost.org/FooApp   or myhost.org/FooApp/
>>>>
>>>> The welcome-files entry in web.xml includes index.jsp, and that's  
>>>> what I'm expecting to run.  It's a fairly simple JSP, for what  
>>>> that's worth.
>>>>
>>>> Also, the other JSPs in my webapp seem to run fine.
>>>
>>> Can you give your app a try on a Geronimo (Tomcat) server? Would  
>>> be interesting to see if this is common between Tomcat-Jasper and  
>>> Jetty-Jasper. Or, if this is unique to Jetty-Jasper... I suspect  
>>> it's going to be Jetty specific...
>>>
>>> I'd go ahead an open a Jira. If you have a test app that you can  
>>> attach to the Jira, that would be great...
>>>
>>> --kevan
>>>
>>
>


Re: StringIndexOutOfBoundsException in getClassFileName

Posted by Kevan Miller <ke...@gmail.com>.
On Nov 8, 2008, at 12:48 AM, Doug Reeder wrote:

> On Geronimo (Tomcat) 2.1.3, the JSP compiles and runs fine.  I can't  
> attach my actual app to a Jira, but I'll see if I can pare it down  
> to a test app.

Thanks for testing that. A test app would be helpful.

I'd guess that using the url http://myhost.org/FooApp/index.jsp ,  
directly, works?

--kevan


>
>
>
> On Nov 7, 2008, at 5:55 PM, Kevan Miller wrote:
>
>>
>> On Nov 7, 2008, at 12:19 PM, Doug Reeder wrote:
>>
>>> The URL is the root URL for my web app, i.e. something like
>>> myhost.org/FooApp   or myhost.org/FooApp/
>>>
>>> The welcome-files entry in web.xml includes index.jsp, and that's  
>>> what I'm expecting to run.  It's a fairly simple JSP, for what  
>>> that's worth.
>>>
>>> Also, the other JSPs in my webapp seem to run fine.
>>
>> Can you give your app a try on a Geronimo (Tomcat) server? Would be  
>> interesting to see if this is common between Tomcat-Jasper and  
>> Jetty-Jasper. Or, if this is unique to Jetty-Jasper... I suspect  
>> it's going to be Jetty specific...
>>
>> I'd go ahead an open a Jira. If you have a test app that you can  
>> attach to the Jira, that would be great...
>>
>> --kevan
>>
>


Re: StringIndexOutOfBoundsException in getClassFileName

Posted by Doug Reeder <re...@gmail.com>.
On Geronimo (Tomcat) 2.1.3, the JSP compiles and runs fine.  I can't  
attach my actual app to a Jira, but I'll see if I can pare it down to  
a test app.



On Nov 7, 2008, at 5:55 PM, Kevan Miller wrote:

>
> On Nov 7, 2008, at 12:19 PM, Doug Reeder wrote:
>
>> The URL is the root URL for my web app, i.e. something like
>> myhost.org/FooApp   or myhost.org/FooApp/
>>
>> The welcome-files entry in web.xml includes index.jsp, and that's  
>> what I'm expecting to run.  It's a fairly simple JSP, for what  
>> that's worth.
>>
>> Also, the other JSPs in my webapp seem to run fine.
>
> Can you give your app a try on a Geronimo (Tomcat) server? Would be  
> interesting to see if this is common between Tomcat-Jasper and Jetty- 
> Jasper. Or, if this is unique to Jetty-Jasper... I suspect it's  
> going to be Jetty specific...
>
> I'd go ahead an open a Jira. If you have a test app that you can  
> attach to the Jira, that would be great...
>
> --kevan
>


Re: StringIndexOutOfBoundsException in getClassFileName

Posted by Kevan Miller <ke...@gmail.com>.
On Nov 7, 2008, at 12:19 PM, Doug Reeder wrote:

> The URL is the root URL for my web app, i.e. something like
> myhost.org/FooApp   or myhost.org/FooApp/
>
> The welcome-files entry in web.xml includes index.jsp, and that's  
> what I'm expecting to run.  It's a fairly simple JSP, for what  
> that's worth.
>
> Also, the other JSPs in my webapp seem to run fine.

Can you give your app a try on a Geronimo (Tomcat) server? Would be  
interesting to see if this is common between Tomcat-Jasper and Jetty- 
Jasper. Or, if this is unique to Jetty-Jasper... I suspect it's going  
to be Jetty specific...

I'd go ahead an open a Jira. If you have a test app that you can  
attach to the Jira, that would be great...

--kevan


Re: StringIndexOutOfBoundsException in getClassFileName

Posted by Doug Reeder <re...@gmail.com>.
The URL is the root URL for my web app, i.e. something
likemyhost.org/FooApp  or
myhost.org/FooApp/

The welcome-files entry in web.xml includes index.jsp, and that's what I'm
expecting to run.  It's a fairly simple JSP, for what that's worth.

Also, the other JSPs in my webapp seem to run fine.


On Fri, Nov 7, 2008 at 9:45 AM, Kevan Miller <ke...@gmail.com> wrote:

> Hi Doug,
>
>
> On Nov 7, 2008, at 1:29 AM, Doug Reeder wrote:
>
>  I have an app (developed in NetBeans) which passes all the verifier tests
>> and runs fine in GlassFish.  I'm able to deploy and start it running in
>> Geronimo (2.1.3, Jetty), but when I try to actually access one of the JSPs,
>> I get the following error:
>> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
>>        at java.lang.String.charAt(String.java:558)
>>        at
>> org.apache.jasper.compiler.JspUtil.makeJavaIdentifier(JspUtil.java:962)
>>        at
>> org.apache.jasper.JspCompilationContext.getServletClassName(JspCompilationContext.java:371)
>>        at
>> org.apache.jasper.JspCompilationContext.getClassFileName(JspCompilationContext.java:511)
>>        at
>> org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:403)
>>        at
>> org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:351)
>>        at
>> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:582)
>>        at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
>>        at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
>>        at
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>        at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>        at
>> org.apache.geronimo.jetty6.InternalJettyServletHolder.handle(InternalJettyServletHolder.java:65)
>>        at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
>>        at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>        at
>> org.apache.geronimo.jetty6.handler.JettySecurityHandler.handle(JettySecurityHandler.java:114)
>>        at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>        at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
>>        at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>>        at
>> org.apache.geronimo.jetty6.handler.TwistyWebAppContext.access$101(TwistyWebAppContext.java:40)
>>        at
>> org.apache.geronimo.jetty6.handler.TwistyWebAppContext$TwistyHandler.handle(TwistyWebAppContext.java:65)
>>        at
>> org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler.handle(ThreadClassloaderHandler.java:46)
>>        at
>> org.apache.geronimo.jetty6.handler.InstanceContextHandler.handle(InstanceContextHandler.java:58)
>>        at
>> org.apache.geronimo.jetty6.handler.UserTransactionHandler.handle(UserTransactionHandler.java:48)
>>        at
>> org.apache.geronimo.jetty6.handler.ComponentContextHandler.handle(ComponentContextHandler.java:47)
>>        at
>> org.apache.geronimo.jetty6.handler.TwistyWebAppContext.handle(TwistyWebAppContext.java:59)
>>        at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>>        at
>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>        at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>        at org.mortbay.jetty.Server.handle(Server.java:324)
>>        at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>>        at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
>>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
>>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
>>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
>>        at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>        at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214)
>>        at
>> org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:344)
>>        at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>        at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>        at java.lang.Thread.run(Thread.java:613)
>>
>> 1) Is there an analog to the verifier tool for Geronimo?
>>
>
> No.
>
>
>> 2) Where should I be looking to fix this? None of the source code files in
>> the stack trace are mine!
>>
>
> Tomcat source code, in this case. Jetty uses the Jasper compiler for JSP
> compilation. In particular --
> http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_18/java/org/apache/jasper/JspCompilationContext.java?revision=678601&view=markup
>
> What's the URI of your JSP?
>
> Tomcat is looking for the last '/' character in your URI, creating a
> substring based on the remainder of the URI, and trying to create a unique
> java classname based on this substring. In your case, the substring is a
> zero length string. Massaging your uri should work-around the problem...
>
> --kevan
>
>

Re: StringIndexOutOfBoundsException in getClassFileName

Posted by Kevan Miller <ke...@gmail.com>.
Hi Doug,

On Nov 7, 2008, at 1:29 AM, Doug Reeder wrote:

> I have an app (developed in NetBeans) which passes all the verifier  
> tests and runs fine in GlassFish.  I'm able to deploy and start it  
> running in Geronimo (2.1.3, Jetty), but when I try to actually  
> access one of the JSPs, I get the following error:
> java.lang.StringIndexOutOfBoundsException: String index out of  
> range: 0
> 	at java.lang.String.charAt(String.java:558)
> 	at  
> org.apache.jasper.compiler.JspUtil.makeJavaIdentifier(JspUtil.java: 
> 962)
> 	at  
> org 
> .apache 
> .jasper 
> .JspCompilationContext 
> .getServletClassName(JspCompilationContext.java:371)
> 	at  
> org 
> .apache 
> .jasper 
> .JspCompilationContext.getClassFileName(JspCompilationContext.java: 
> 511)
> 	at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:403)
> 	at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:351)
> 	at  
> org 
> .apache 
> .jasper.JspCompilationContext.compile(JspCompilationContext.java:582)
> 	at  
> org 
> .apache 
> .jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
> 	at  
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 
> 342)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> 	at  
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6 
> .InternalJettyServletHolder.handle(InternalJettyServletHolder.java:65)
> 	at  
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
> 362)
> 	at  
> org 
> .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
> 216)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6 
> .handler.JettySecurityHandler.handle(JettySecurityHandler.java:114)
> 	at  
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 
> 181)
> 	at  
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 
> 726)
> 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
> 405)
> 	at org.apache.geronimo.jetty6.handler.TwistyWebAppContext.access 
> $101(TwistyWebAppContext.java:40)
> 	at org.apache.geronimo.jetty6.handler.TwistyWebAppContext 
> $TwistyHandler.handle(TwistyWebAppContext.java:65)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6 
> .handler 
> .ThreadClassloaderHandler.handle(ThreadClassloaderHandler.java:46)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6 
> .handler.InstanceContextHandler.handle(InstanceContextHandler.java:58)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6 
> .handler.UserTransactionHandler.handle(UserTransactionHandler.java:48)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6 
> .handler.ComponentContextHandler.handle(ComponentContextHandler.java: 
> 47)
> 	at  
> org 
> .apache 
> .geronimo 
> .jetty6.handler.TwistyWebAppContext.handle(TwistyWebAppContext.java: 
> 59)
> 	at  
> org 
> .mortbay 
> .jetty 
> .handler 
> .ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
> 	at  
> org 
> .mortbay 
> .jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at  
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 
> 139)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at  
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
> 505)
> 	at org.mortbay.jetty.HttpConnection 
> $RequestHandler.headerComplete(HttpConnection.java:828)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
> 	at  
> org 
> .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
> 395)
> 	at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214)
> 	at org.apache.geronimo.pool.ThreadPool 
> $ContextClassLoaderRunnable.run(ThreadPool.java:344)
> 	at java.util.concurrent.ThreadPoolExecutor 
> $Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor 
> $Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:613)
>
> 1) Is there an analog to the verifier tool for Geronimo?

No.

>
> 2) Where should I be looking to fix this? None of the source code  
> files in the stack trace are mine!

Tomcat source code, in this case. Jetty uses the Jasper compiler for  
JSP compilation. In particular -- http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_18/java/org/apache/jasper/JspCompilationContext.java?revision=678601&view=markup

What's the URI of your JSP?

Tomcat is looking for the last '/' character in your URI, creating a  
substring based on the remainder of the URI, and trying to create a  
unique java classname based on this substring. In your case, the  
substring is a zero length string. Massaging your uri should work- 
around the problem...

--kevan