This issue has been bugging us for some time now. When under load that was emulated using openload, struts-menu 2.3 was crashing, throwing NullPointerException:
java.lang.NullPointerException at net.sf.navigator.taglib.DisplayMenuTag.setLocation(DisplayMenuTag.java:217) at net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:173) at net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:205) at net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:123)
The interesting thing is that it only happend on the Linux server and is not reproducible on WinXP boxes, so it looked like the issue with the jvm implementation. (This was just my guess and so far I have no better explanation). Below are the server details:
JBoss: ------ Version: 4.0.3SP1(build: CVSTag=JBoss_4_0_3_SP1 date=200510231054) Version Name: Zion Built on: October 23 2005 Environment: ------------ Start date: Wed Apr 12 22:38:03 PDT 2006
Hardware: --------- #CPU: 4 OS: Linux 2.6.9-11.ELsmp (i386)
JVM Environment: ---------------- JVM Version: 1.5.0_05-b05 (Sun Microsystems Inc.) JVM Name: Java HotSpot(TM) Server VM
Thank you Lord for open source.
Yes I mean it, if I would not have the access to the source code, how on earth would I be able to figure out the problem?!?!
So here are the details:
According to the stacktrace the exception is thrown here. Looking through the code revealed that menus are reinitialized on every request (should it be static and cached??) and it uses ArrayList to hold the submenu elements, see MenuComponent. Once I substituted ArrayList to Vector, the problem was gone.
2 Comments
Sounds like you found some bugs. ;-) Can you enter them in JIRA at http://issues.appfuse.org/browse/SM?
Thanks,
Matt
Done. http://issues.appfuse.org/browse/SM-12.
BTW. Thanks Matt, for your contributions to the community. It is really inspiring to have people like you.
Post a Comment