lanxy88 / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

NPE when listing proesses #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
AIX 6.x
Jegtty 6.1.x

Stacktrace:
2011-03-20 23:21:19,485 [536682493@qtp-501816809-5][][][][][] WARN 
net.bull.javamelody - processes report failed
java.util.NoSuchElementException: null
        at java.util.Scanner.nextLine(Scanner.java:1503) ~[na:na]
        at net.bull.javamelody.ProcessInformations.buildProcessInformations(ProcessInformations.java:122) ~[javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.ProcessInformations.buildProcessInformations(ProcessInformations.java:153) ~[javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.HtmlController.doProcesses(HtmlController.java:214) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.HtmlController.doHtmlPartForSystemActions(HtmlController.java:139) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.HtmlController.doHtmlPart(HtmlController.java:128) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.HtmlController.doHtml(HtmlController.java:97) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.MonitoringController.doCompressedHtml(MonitoringController.java:208) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.MonitoringController.doReportCore(MonitoringController.java:172) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.MonitoringController.doReport(MonitoringController.java:160) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.MonitoringFilter.doMonitoring(MonitoringFilter.java:289) [javamelody-core-1.26.0.jar:1.26.0]
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:122) [javamelody-core-1.26.0.jar:1.26.0]
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) [jetty-6.1.25.jar:6.1.25]
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) [jetty-util-6.1.25.jar:6.1.25]

Original issue reported on code.google.com by davidkar...@gmail.com on 20 Mar 2011 at 10:36

GoogleCodeExporter commented 9 years ago
Can you give the result of 'ps wauxf' and of '/bin/sh -c "ps wauxf"' on AIX?
Thanks

Original comment by evernat@free.fr on 20 Mar 2011 at 11:20

GoogleCodeExporter commented 9 years ago
ps wauxf:
/home/xxxx/logs1 > ps wauxf
Usage: ps [-AMNZaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
                [-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist] [-c classlist] [ -T pid] [ -L pidlist ] 
                [-@ [wparname] ]
Usage: ps [aceglnsuvwxX] [t tty] [processnumber]

'/bin/sh -c "ps wauxf"':
 /bin/sh -c "ps wauxf"
Usage: ps [-AMNZaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
                [-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist] [-c classlist] [ -T pid] [ -L pidlist ] 
                [-@ [wparname] ]
Usage: ps [aceglnsuvwxX] [t tty] [processnumber]

If I remove the f option it works and gives:
root     2425274  0,0  0,0  820  860      - A      21 feb  0:00 /bin/ksh 
/pconsole/lwi/bin/lwistart_src.sh 
root     1835148  0,0  0,0  448  448      - A      21 feb  0:00 rtcmd
root     1900652  0,0  0,0  512  512      - A      21 feb  0:00 kbiod
root     1769614  0,0  0,0  512  512      - A      21 feb  0:00 nfsSM
root     1572994  0,0  0,0  772  800      - A      21 feb  0:00 
/usr/lib/errdemon 
root     1704046  0,0  0,0  448  448      - A      21 feb  0:00 aioPpool
root     2490544  0,0  0,0  332  340      - A      21 feb  0:00 
/usr/sbin/writesrv 
root     2621614  0,0  0,0 7120 7180      - A      21 feb  0:00 
/usr/lpp/OV/lbin/conf/ovconfd 
root     2424986  0,0  0,0  448  448      - A      21 feb  0:00 pofCmdProc
root     2031766  0,0  0,0  940  960      - A      21 feb  0:00 
/usr/sbin/srcmstr 
root     2293914  0,0  0,0 2620 2640      - A      21 feb  0:00 
/usr/sbin/muxatmd 
root      524308  0,0  0,0  448  448      - A      21 feb  0:00 memgrdd
root      983106  0,0  0,0  448  448      - A      21 feb  0:00 lvmbb
root      393232  0,0  0,0  640  640      - A      21 feb  0:00 psmd
root      262156  0,0  0,0  640  640      - A      21 feb  0:00 lrud

Original comment by davidkar...@gmail.com on 21 Mar 2011 at 12:02

GoogleCodeExporter commented 9 years ago
I have committed some changes in trunk (revision 1815) which should fix several 
problems for AIX.
But I have supposed that there was a one line header in the output and that you 
have removed it. Can you say it in case that there was no header and if it is 
usual?

I have made a new build with the fix and it is available at:
http://javamelody.googlecode.com/files/javamelody-20110327.jar
Does it work?

The fix should be released in v1.28.0 in about a month.
Thanks

Original comment by evernat@free.fr on 27 Mar 2011 at 8:07

GoogleCodeExporter commented 9 years ago
You're right - there is a header:
aat-efs-app01:/home/et2448 > ps waux|head -3
USER          PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND
jetty    14287004  0,5  3,0 167436 167488      - A      23 mar 81:04 
/usr/java6/bin/java -Xmx512m -XX:MaxPermSize=128m -Djavax.net.ssl.
jetty    17694874  0,3  4,0 234572 234624      - A      23 mar 37:21 
/usr/java6/bin/java -Xmx512m -XX:MaxPermSize=128m -Djavax.net.ssl.

Original comment by davidkar...@gmail.com on 28 Mar 2011 at 12:48

GoogleCodeExporter commented 9 years ago
So I supposed that it is fixed for v1.28. Thanks.

Original comment by evernat@free.fr on 2 Apr 2011 at 11:35