Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue starting javamelody-1.11.1.war (in standalone mode) #12

Closed
GoogleCodeExporter opened this issue Jun 21, 2015 · 5 comments
Closed

Comments

@GoogleCodeExporter
Copy link

I use the following cli : 
bash-3.00$ java -jar javamelody-1.11.1.war --ajp13Port -1 --httpPort 9094
Here the output :
INFO: ZipFile.name trick did not work (java.lang.NullPointerException), 
using fallback
Running from: /var/tmp/javamelody6947296167696076400.jar
[Winstone 2010/02/05 10:03:28] - Beginning extraction from war file
[Winstone 2010/02/05 10:03:30] - Error starting listener instance
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcce
ssorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru
ctorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at winstone.Launcher.spawnListener(Launcher.java:232)
        at winstone.Launcher.<init>(Launcher.java:201)
        at winstone.Launcher.main(Launcher.java:391)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
9)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at net.bull.javamelody.Main.main(Main.java:184)
Caused by: java.lang.NumberFormatException: For input string: "true"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:4
8)
        at java.lang.Integer.parseInt(Integer.java:449)
        at java.lang.Integer.parseInt(Integer.java:499)
        at winstone.HttpListener.<init>(HttpListener.java:55)
        ... 12 more

[Winstone 2010/02/05 10:03:30] - Error starting listener instance
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcce
ssorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru
ctorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at winstone.Launcher.spawnListener(Launcher.java:232)
        at winstone.Launcher.<init>(Launcher.java:202)
        at winstone.Launcher.main(Launcher.java:391)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
9)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at net.bull.javamelody.Main.main(Main.java:184)
Caused by: java.lang.NumberFormatException: For input string: "true"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:4
8)
        at java.lang.Integer.parseInt(Integer.java:449)
        at java.lang.Integer.parseInt(Integer.java:499)
        at winstone.ajp13.Ajp13Listener.<init>(Ajp13Listener.java:73)
        ... 12 more

[Winstone 2010/02/05 10:03:30] - Winstone Servlet Engine v0.9.10 running: 
controlPort=disabled
^C[Winstone 2010/02/05 10:03:46] - Winstone shutdown successfully
[Winstone 2010/02/05 10:03:46] - Control thread shutdown successfully
bash-3.00$ java -jar javamelody-1.11.1.war --ajp13Port=-1 --httpPort=9094
INFO: ZipFile.name trick did not work (java.lang.NullPointerException), 
using fallback
Running from: /var/tmp/javamelody4735162552986826088.jar
[Winstone 2010/02/05 10:03:52] - Beginning extraction from war file
[Winstone 2010/02/05 10:03:54] - HTTP Listener started: port=9094
[Winstone 2010/02/05 10:03:54] - Winstone Servlet Engine v0.9.10 running: 
controlPort=disabled
[Winstone 2010/02/05 10:04:11] - Untrapped Error in Servlet
java.lang.StringIndexOutOfBoundsException: String index out of range: -36
        at java.lang.String.substring(String.java:1937)
        at 
winstone.WinstoneResponseWriter.write(WinstoneResponseWriter.java:54)
        at net.bull.javamelody.I18N.writeTo(I18N.java:161)
        at net.bull.javamelody.I18N.writelnTo(I18N.java:173)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeln(HtmlRep
ort.java:104)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeAddAndRemo
veApplicationLinks(HtmlReport.java:57)
        at 
net.bull.javamelody.HtmlReport.writeAddAndRemoveApplicationLinks(HtmlReport
.java:221)
        at 
net.bull.javamelody.CollectorServlet.writeOnlyAddApplication(CollectorServl
et.java:382)
        at 
net.bull.javamelody.CollectorServlet.doGet(CollectorServlet.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:104)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
        at 
winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
        at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
        at 
winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
        at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
        at java.lang.Thread.run(Thread.java:619)

[Winstone 2010/02/05 10:04:11] - Untrapped Error in Servlet
java.lang.StringIndexOutOfBoundsException: String index out of range: -36
        at java.lang.String.substring(String.java:1937)
        at 
winstone.WinstoneResponseWriter.write(WinstoneResponseWriter.java:54)
        at net.bull.javamelody.I18N.writeTo(I18N.java:161)
        at net.bull.javamelody.I18N.writelnTo(I18N.java:173)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeln(HtmlRep
ort.java:104)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeAddAndRemo
veApplicationLinks(HtmlReport.java:57)
        at 
net.bull.javamelody.HtmlReport.writeAddAndRemoveApplicationLinks(HtmlReport
.java:221)
        at 
net.bull.javamelody.CollectorServlet.writeOnlyAddApplication(CollectorServl
et.java:382)
        at 
net.bull.javamelody.CollectorServlet.doGet(CollectorServlet.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:104)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
        at 
winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
        at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
        at 
winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
        at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
        at java.lang.Thread.run(Thread.java:619)

[Winstone 2010/02/05 10:04:27] - Untrapped Error in Servlet
java.lang.StringIndexOutOfBoundsException: String index out of range: -36
        at java.lang.String.substring(String.java:1937)
        at 
winstone.WinstoneResponseWriter.write(WinstoneResponseWriter.java:54)
        at net.bull.javamelody.I18N.writeTo(I18N.java:161)
        at net.bull.javamelody.I18N.writelnTo(I18N.java:173)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeln(HtmlRep
ort.java:104)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeAddAndRemo
veApplicationLinks(HtmlReport.java:57)
        at 
net.bull.javamelody.HtmlReport.writeAddAndRemoveApplicationLinks(HtmlReport
.java:221)
        at 
net.bull.javamelody.CollectorServlet.writeOnlyAddApplication(CollectorServl
et.java:382)
        at 
net.bull.javamelody.CollectorServlet.doGet(CollectorServlet.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:104)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
        at 
winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
        at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
        at 
winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
        at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
        at java.lang.Thread.run(Thread.java:619)

[Winstone 2010/02/05 10:04:27] - Untrapped Error in Servlet
java.lang.StringIndexOutOfBoundsException: String index out of range: -36
        at java.lang.String.substring(String.java:1937)
        at 
winstone.WinstoneResponseWriter.write(WinstoneResponseWriter.java:54)
        at net.bull.javamelody.I18N.writeTo(I18N.java:161)
        at net.bull.javamelody.I18N.writelnTo(I18N.java:173)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeln(HtmlRep
ort.java:104)
        at 
net.bull.javamelody.HtmlReport$HtmlAddAndRemoveApplications.writeAddAndRemo
veApplicationLinks(HtmlReport.java:57)
        at 
net.bull.javamelody.HtmlReport.writeAddAndRemoveApplicationLinks(HtmlReport
.java:221)
        at 
net.bull.javamelody.CollectorServlet.writeOnlyAddApplication(CollectorServl
et.java:382)
        at 
net.bull.javamelody.CollectorServlet.doGet(CollectorServlet.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:104)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
        at 
winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
        at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
        at 
winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
        at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
        at java.lang.Thread.run(Thread.java:619)


Original issue reported on code.google.com by oliver.lamy@gmail.com on 5 Feb 2010 at 9:06

@GoogleCodeExporter
Copy link
Author

You have 2 problems in your logs.
The first one is NumberFormatException: For input string: "true" with the 
command
line java -jar javamelody-1.11.1.war --ajp13Port -1 --httpPort 9094

It is a problem for the Winstone servlet container which is included in the
javamelody "war". And it is because you forgot "=" for the parameters. There is 
even
an issue for this :
http://sourceforge.net/tracker/index.php?func=detail&aid=1821821&group_id=98922&
atid=622497

The second problem is StringIndexOutOfBoundsException: String index out of 
range: -36
at java.lang.String.substring(String.java:1937)
at 
winstone.WinstoneResponseWriter.write(WinstoneResponseWriter.java:54)

It occurs only with Winstone (and not Tomcat) and I think only when you have 
not yet
defined an application in the centralized collect server.
I think that it is a Winstone bug because WinstoneResponseWriter at line 54 (
http://winstone.cvs.sourceforge.net/viewvc/winstone/winstone/src/java/winstone/W
instoneResponseWriter.java?revision=1.3&view=markup
) defines a write(string, offset, length) method and calls
String.substring(beginIndex, endIndex) with offset and length.

To workaround this Winstone bug, you can deploy the same war in Tomcat, or you 
can
add in your temporary directory an application.properties file with has the 
following
content: "myapp=http\://host\:port/context" (with the host, port and context of 
your
webapp to monitor).
I will try to include a workaround in the next release of javamelody.

Do you have the time to write an issue for Winstone :
http://sourceforge.net/tracker/?group_id=98922&atid=622497 ?

bye, Emeric

Original comment by evernat@free.fr on 5 Feb 2010 at 6:58

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by evernat@free.fr on 5 Feb 2010 at 6:59

  • Changed title: Issue starting javamelody-1.11.1.war (in standalone mode)

@GoogleCodeExporter
Copy link
Author

I need to correct myself:
To workaround this Winstone bug, you can deploy the same war in Tomcat, or you 
can
add in *the subdirectory javamelody* of your temporary directory an
*applications.properties* file with has the following
content: "myapp=http\://host\:port/context" 

For example, in the file "/tmp/javamelody/applications.properties"

Original comment by evernat@free.fr on 5 Feb 2010 at 7:06

@GoogleCodeExporter
Copy link
Author

thanks works fine in tomcat.
I have an other issue. I will open an other issue.

Original comment by oliver.lamy@gmail.com on 5 Feb 2010 at 9:04

@GoogleCodeExporter
Copy link
Author

A workaround for the centralized collect server in Winstone (standalone) is 
ready for
next release (1.12). It should fix the StringIndexOutOfBoundsException.

Original comment by evernat@free.fr on 6 Feb 2010 at 11:07

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant