zcwslnh / javamelody

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

Quartz job CRON expression with '#' causes NullPointerException #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create Quartz task
2. schedule this task/job with a cron expression
3. use a cron expression containing a '#' character, e.g. "0 0 10 ? * 7#1" 
(meaning like 'fire at 10am on 1st Saturday of each month')

What is the expected output?
I expected the list of all 'Jobs' followed by the 'Data caches'.

What do you see instead?
The Java Melody page was built until the point where the NullPointerException 
occurred while writing CRON expression "0 0 10 ? * 7#1".

What version of the product are you using?
Since the CRON expressions have been introduced with Java Melody 1.15.0, it 
occurs in 1.15.0, 1.16.0 an 1.17.0-SNAPSHOT.

On what application server, JDK,
operating system?
- JBoss 4.2.3
- JDK 1.6.0_20 (64bit)
- Fedora Core 13 (64bit)

Please provide any additional information below.
I will attach a screenshot and then append an SVN patch for class 
HtmlJobInformationsReport.
But here the stack trace at first with some additional debug from myself:

2010-06-25 11:15:30,536 INFO  (http-127.0.0.1-8080-1:) [STDOUT] 
net.bull.javamelody.I18N, html: 0 0 10 ? * 7#1
2010-06-25 11:15:30,536 INFO  (http-127.0.0.1-8080-1:) [STDOUT] 
net.bull.javamelody.I18N, index: 12
2010-06-25 11:15:30,536 INFO  (http-127.0.0.1-8080-1:) [STDOUT] 
net.bull.javamelody.I18N, begin: 0
2010-06-25 11:15:30,536 INFO  (http-127.0.0.1-8080-1:) [STDOUT] 
net.bull.javamelody.I18N, index - begin: 12
2010-06-25 11:15:30,536 INFO  (http-127.0.0.1-8080-1:) [STDOUT] 
net.bull.javamelody.I18N, nextIndex: -1
2010-06-25 11:15:30,536 INFO  (http-127.0.0.1-8080-1:) [STDOUT] 
net.bull.javamelody.I18N, key: null
2010-06-25 11:15:30,543 ERROR (http-127.0.0.1-8080-1:) 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/bo].[default]]
 Servlet.service() for servlet default threw exception
java.lang.NullPointerException
        at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
        at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
        at java.util.ResourceBundle.getString(ResourceBundle.java:334)
        at net.bull.javamelody.I18N.writeTo(I18N.java:186)
        at net.bull.javamelody.HtmlJobInformationsReport.write(HtmlJobInformationsReport.java:236)
        at net.bull.javamelody.HtmlJobInformationsReport.writeJobTimes(HtmlJobInformationsReport.java:201)
        at net.bull.javamelody.HtmlJobInformationsReport.writeJobInformations(HtmlJobInformationsReport.java:130)
        at net.bull.javamelody.HtmlJobInformationsReport.toHtml(HtmlJobInformationsReport.java:84)
        at net.bull.javamelody.HtmlCoreReport.writeJobs(HtmlCoreReport.java:469)
        at net.bull.javamelody.HtmlCoreReport.toHtml(HtmlCoreReport.java:222)
        at net.bull.javamelody.HtmlReport.toHtml(HtmlReport.java:63)
        at net.bull.javamelody.MonitoringController.doHtml(MonitoringController.java:316)
        at net.bull.javamelody.MonitoringController.doCompressedHtml(MonitoringController.java:205)
        at net.bull.javamelody.MonitoringController.doReportCore(MonitoringController.java:180)
        at net.bull.javamelody.MonitoringController.doReport(MonitoringController.java:166)
        at net.bull.javamelody.MonitoringFilter.doMonitoring(MonitoringFilter.java:514)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:367)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:619)

Original issue reported on code.google.com by u023...@googlemail.com on 25 Jun 2010 at 11:27

GoogleCodeExporter commented 9 years ago
Here the patch for HtmlJobInformationsReport.java. It works fine now with our 
Quartz job setup...

Original comment by u023...@googlemail.com on 25 Jun 2010 at 11:33

Attachments:

GoogleCodeExporter commented 9 years ago
Here the error screen shot, as promised...

Original comment by u023...@googlemail.com on 25 Jun 2010 at 11:46

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for the issue, it is perfect

Original comment by evernat@free.fr on 25 Jun 2010 at 12:55

GoogleCodeExporter commented 9 years ago
Fixed in trunk of svn (revision 1060) and ready for the next release (v1.17) in 
about a week.
Bye (and thanks again).

Original comment by evernat@free.fr on 25 Jun 2010 at 4:21

GoogleCodeExporter commented 9 years ago
You are welcome! It was a pleasure for me. Thanks for accepting the fix!

javamelody rulez !D

Original comment by u023...@googlemail.com on 25 Jun 2010 at 9:13