1. timemachine
  2. scheduler
Issue #27 resolved

Windows 7 & Apache tomcat 6.0.35 [SchedulerException: Failed to read version file to get published date]

Anonymous created an issue

Hi all, i tried to deploy timemachine-web-1.2.1.war on my tomcat 6, but i have find this exception.

Comments (16)

  1. Zemian Deng

    Hi there, Thank you for the feedback. Can you please show me what are the steps you used to receive that error? And if possible can you print the full stacktrace?

    Thanks, Zemian

  2. Luigi Antonio Mattinò

    Hi Zemian, Thank you for your quick reply ... this is the Apache Tomcat 6.0.35 stacktrace: 22-set-2012 22.05.17 org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() 22-set-2012 22.05.17 org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() 22-set-2012 22.07.58 org.apache.catalina.core.StandardContext listenerStart GRAVE: Exception sending context initialized event to listener instance of class timemachine.scheduler.web.SchedulerContextListener timemachine.scheduler.SchedulerException: Failed to read version file to get published date. at timemachine.scheduler.support.VersionUtils.getSchedulerVersion(VersionUtils.java:73) at timemachine.scheduler.web.SchedulerContextListener.contextInitialized(SchedulerContextListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1385) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1389) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1653) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1662) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1642) at java.lang.Thread.run(Thread.java:662) Caused by: java.text.ParseException: Unparseable date: "Thu Aug 02 22:36:01 EDT 2012" at java.text.DateFormat.parse(DateFormat.java:337) at timemachine.scheduler.support.VersionUtils.getSchedulerVersion(VersionUtils.java:64) ... 17 more 22-set-2012 22.07.58 org.apache.catalina.core.StandardContext listenerStop GRAVE: Exception sending context destroyed event to listener instance of class timemachine.scheduler.web.SchedulerContextListener java.lang.NullPointerException at timemachine.scheduler.web.SchedulerContextListener.contextDestroyed(SchedulerContextListener.java:57) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4245) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4886) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4750) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1385) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1389) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1653) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1662) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1642) at java.lang.Thread.run(Thread.java:662) 22-set-2012 22.30.38 org.apache.catalina.core.StandardContext listenerStart GRAVE: Exception sending context initialized event to listener instance of class timemachine.scheduler.web.SchedulerContextListener timemachine.scheduler.SchedulerException: Failed to read version file to get published date. at timemachine.scheduler.support.VersionUtils.getSchedulerVersion(VersionUtils.java:73) at timemachine.scheduler.web.SchedulerContextListener.contextInitialized(SchedulerContextListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.text.ParseException: Unparseable date: "Thu Aug 02 22:36:01 EDT 2012" at java.text.DateFormat.parse(DateFormat.java:337) at timemachine.scheduler.support.VersionUtils.getSchedulerVersion(VersionUtils.java:64) ... 25 more 22-set-2012 22.30.38 org.apache.catalina.core.StandardContext listenerStop GRAVE: Exception sending context destroyed event to listener instance of class timemachine.scheduler.web.SchedulerContextListener java.lang.NullPointerException at timemachine.scheduler.web.SchedulerContextListener.contextDestroyed(SchedulerContextListener.java:57) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4245) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4886) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4750) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 22-set-2012 22.30.38 org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() 22-set-2012 22.30.38 org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized()

  3. Zemian Deng

    Hum... this is strange. The root cause is

    Caused by: java.text.ParseException: Unparseable date: "Thu Aug 02 22:36:01 EDT 2012"
    	at java.text.DateFormat.parse(DateFormat.java:337)
    	at timemachine.scheduler.support.VersionUtils.getSchedulerVersion(VersionUtils.java:64)
    

    But in VersionUtils.java:64, it is parsing using this line:

    Date date = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").parse(dateStr);
    

    That input is valid though. I don't see a reason for failure. I tested this on my Vista and same Tomcat 6.0.35, and it works.

    I am curious as what is the cause, because there is another user reported similar thing, which I can't reproduce either. http://saltnlight5.blogspot.com/2012/07/kickstart-timemachine-scheduler-with.html

  4. Zemian Deng

    Luigi,

    Even though I can't reproduce the exact error you are having yet, but this error will prevent the war to deploy and startup, so it's not acceptable. I have improved the VersionUtils class to not fail even if we can't parse the date string. It will default to a "0" in this case. I have uploaded a timemachine-web-1.3.0-SNAPSHOT.war on download page that you may give it another try.

    I will be very much interested in knowing how to reproduce your original error though. If you don't mind, can you please give me your exact steps to reproduce this? Do you use a out of box tomcat-6.0.35 and drop our scheduler war file in without modification right? What java version are you using? and what OS?

  5. Zemian Deng

    I just tried your combination of Windows Vista, Java6, JBoss4.2.3 with timemachine-web-1.2.1.war and it deployed without that exception.

    $ bin/run.bat
    ===============================================================================
    
      JBoss Bootstrap Environment
    
      JBOSS_HOME: C:\apps\jboss-4.2.3.GA
    
      JAVA: C:/apps/jdk1.6.0_18\bin\java
    
      JAVA_OPTS:  -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
    
      CLASSPATH: C:/apps/jdk1.6.0_18\lib\tools.jar;C:\apps\jboss-4.2.3.GA\bin\run.jar
    
    ===============================================================================
    
    14:42:51,491 INFO  [Server] Starting JBoss (MX MicroKernel)...
    14:42:51,492 INFO  [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)
    14:42:51,494 INFO  [Server] Home Dir: C:\apps\jboss-4.2.3.GA
    14:42:51,495 INFO  [Server] Home URL: file:/C:/apps/jboss-4.2.3.GA/
    14:42:51,497 INFO  [Server] Patch URL: null
    14:42:51,498 INFO  [Server] Server Name: default
    14:42:51,499 INFO  [Server] Server Home Dir: C:\apps\jboss-4.2.3.GA\server\default
    14:42:51,501 INFO  [Server] Server Home URL: file:/C:/apps/jboss-4.2.3.GA/server/default/
    14:42:51,503 INFO  [Server] Server Log Dir: C:\apps\jboss-4.2.3.GA\server\default\log
    14:42:51,504 INFO  [Server] Server Temp Dir: C:\apps\jboss-4.2.3.GA\server\default\tmp
    14:42:51,506 INFO  [Server] Root Deployment Filename: jboss-service.xml
    14:42:51,687 INFO  [ServerInfo] Java version: 1.6.0_18,Sun Microsystems Inc.
    14:42:51,687 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 16.0-b13,Sun Microsystems Inc.
    14:42:51,688 INFO  [ServerInfo] OS-System: Windows 7 6.1,x86
    14:42:51,963 INFO  [Server] Core system initialized
    14:42:53,327 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083/
    14:42:53,329 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
    14:42:53,598 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
    14:42:53,598 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
    14:42:53,737 INFO  [TransactionManagerService] Starting recovery manager
    14:42:53,786 INFO  [TransactionManagerService] Recovery manager started
    14:42:53,786 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
    14:42:55,307 INFO  [EJB3Deployer] Starting java:comp multiplexer
    14:42:56,625 INFO  [NativeServerConfig] JBoss Web Services - Native
    14:42:56,625 INFO  [NativeServerConfig] jbossws-3.0.1-native-2.0.4.GA (build=200803312044)
    14:42:57,126 INFO  [Embedded] Catalina naming disabled
    14:42:57,218 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\apps\jdk1.6.0_18\bin;.;C:\W
    14:42:57,262 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
    14:42:57,264 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
    14:42:57,266 INFO  [Catalina] Initialization processed in 139 ms
    14:42:57,266 INFO  [StandardService] Starting service jboss.web
    14:42:57,270 INFO  [StandardEngine] Starting Servlet Engine: JBossWeb/2.0.1.GA
    14:42:57,299 INFO  [Catalina] Server startup in 33 ms
    14:42:57,358 INFO  [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jboss-web.deployer/ROOT.war/
    14:42:57,687 INFO  [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
    14:42:57,769 INFO  [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../deploy/jbossws.sar/jbossws-context.war/
    14:42:57,828 INFO  [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    14:42:58,328 INFO  [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
    14:42:58,620 INFO  [MailService] Mail Service bound to java:/Mail
    14:42:58,700 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
    14:42:58,728 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
    14:42:58,747 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
    14:42:58,777 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
    14:42:58,810 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
    14:42:58,867 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
    14:42:58,890 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/quartz-ra.rar
    14:42:58,897 INFO  [QuartzResourceAdapter] start quartz!!!
    14:42:58,936 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
    14:42:58,950 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
    14:42:58,953 INFO  [RAMJobStore] RAMJobStore initialized.
    14:42:58,953 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
    14:42:58,954 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
    14:42:58,956 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
    14:42:59,529 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
    14:42:59,681 INFO  [A] Bound to JNDI name: queue/A
    14:42:59,683 INFO  [B] Bound to JNDI name: queue/B
    14:42:59,684 INFO  [C] Bound to JNDI name: queue/C
    14:42:59,685 INFO  [D] Bound to JNDI name: queue/D
    14:42:59,687 INFO  [ex] Bound to JNDI name: queue/ex
    14:42:59,700 INFO  [testTopic] Bound to JNDI name: topic/testTopic
    14:42:59,702 INFO  [securedTopic] Bound to JNDI name: topic/securedTopic
    14:42:59,704 INFO  [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
    14:42:59,708 INFO  [testQueue] Bound to JNDI name: queue/testQueue
    14:42:59,731 INFO  [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
    14:42:59,751 INFO  [DLQ] Bound to JNDI name: queue/DLQ
    14:42:59,815 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
    14:42:59,836 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
    14:43:00,396 INFO  [TomcatDeployer] deploy, ctxPath=/timemachine-web-1.2.1, warUrl=.../tmp/deploy/tmp8013116187691059932timemachine-web-1.2.1-exp.war/
    14:43:00,481 ERROR [STDERR] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    14:43:00,481 ERROR [STDERR] SLF4J: Defaulting to no-operation (NOP) logger implementation
    14:43:00,482 ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    14:43:00,750 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
    14:43:00,765 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
    14:43:00,775 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 9s:266ms
    

    Noticed I do have SLF4J error, but that's different Issue reported and already fixed here https://bitbucket.org/timemachine/scheduler/issue/28. This error simply disabled the logging output, the war deployed successful and I can visit http://localhost:8080/timemachine-web-1.2.1 url fine.

    So yet I still not able to reproduce the date parsing error. :(

  6. Zemian Deng

    Luigi, can you do me a favor, can you run this little test on your machine and tell me whether this succeed or not?

    Create "C:\test\TestDate.java" file with this

    import java.text.*;
    public class TestDate {
    	public static void main(String[] args) throws Exception {
    		SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
    		System.out.println(df.parse("Thu Aug 02 22:36:01 EDT 2012"));
    	}
    }
    

    Now run:

    C:\test> javac TestDate.java
    C:\test> java TestDate
    Thu Aug 02 22:36:01 EDT 2012
    
  7. Zemian Deng

    I dug further, as I suspect the timezone "EDT" looks little fishy. Google shows quiet a few problematic post about "EDT" time string parsing, including there is a Oracle JDK Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6530336

    This might explains it works on mine env, and not yours, since we have different patch of JDK6 updates.

    Any way, for next release, I would even go further and improve our VersionUtils to ignore this timezone info when parsing the release date string. This should minimize this particular problem.

  8. Luigi Antonio Mattinò

    Hi Zemian, your test doesn't work! it throws an exception, here the Stack trace:

    Exception in thread "main" java.text.ParseException: Unparseable date: "Thu Aug 02 22:36:01 EDT 2012" at java.text.DateFormat.parse(Unknown Source) at org.test.deng.TestDate.main(TestDate.java:12)

    I think you are on right way, this Oracle JDK bug explanis my excepion launch. One question: On which Quartz libraries your project it is supporting? Thanks.

  9. Log in to comment