Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-11954

[GSS](7.0.z) java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] when javax.ejb.ScheduleExpression.start(java.util.Date s) was invoked

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.8.CR1, 7.0.8.GA
    • None
    • EJB
    • None
    • Hide

      Customer reproduced this issue with below steps,
      ~~~~~
      1. create an ejb project and paste the attached file to it.
      2. run the ejb project in eap 7.0.
      3. a new timer will be created and persisted to db after project starup.
      4. restart jboss eap and you will see the error.
      5. if you comment the line 62 and repeat the above step, there will be no error.
      ~~~~~

      Show
      Customer reproduced this issue with below steps, ~~~~~ 1. create an ejb project and paste the attached file to it. 2. run the ejb project in eap 7.0. 3. a new timer will be created and persisted to db after project starup. 4. restart jboss eap and you will see the error. 5. if you comment the line 62 and repeat the above step, there will be no error. ~~~~~
    • EAP 7.0.8

      Customer use database store ejb timer service.
      When customer restart the server after configuring belows, got the error during startup and the persisted timer was not recreated successfully.

      ~~~~~
      <timer-service thread-pool-name="default" default-data-store="clustered-store">
      <data-stores>
      <database-data-store name="clustered-store" datasource-jndi-name="java:jboss/datasources/WebQuoteDS" database="oracle" refresh-interval="30000"/>
      </data-stores>
      </timer-service>
      ~~~~~

      (error)
      ~~~~~
      14:44:56,157 WARN [org.jboss.as.ejb3] (ServerService Thread Pool – 97) WFLYEJB0161: Failed to reinstate timer 'webquote.WQ_EJB_Utility.TaskScheduleManager' (id=633b0edf-1a14-4497-ae0b-64ca5523eff1) from its persistent state: java.sql.SQLException: Invalid conversion requested
      at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor.java:420)
      at oracle.jdbc.driver.T4CVarcharAccessor.getTimestamp(T4CVarcharAccessor.java:644)
      at oracle.jdbc.driver.GeneratedStatement.getTimestamp(GeneratedStatement.java:360)
      at oracle.jdbc.driver.GeneratedScrollableResultSet.getTimestamp(GeneratedScrollableResultSet.java:1008)
      at org.jboss.jca.adapters.jdbc.WrappedResultSet.getTimestamp(WrappedResultSet.java:2140)
      at org.jboss.as.ejb3.timerservice.persistence.database.DatabaseTimerPersistence.timerFromResult(DatabaseTimerPersistence.java:533)
      at org.jboss.as.ejb3.timerservice.persistence.database.DatabaseTimerPersistence.loadActiveTimers(DatabaseTimerPersistence.java:458)
      at org.jboss.as.ejb3.timerservice.TimerServiceImpl.getActivePersistentTimers(TimerServiceImpl.java:952)
      at org.jboss.as.ejb3.timerservice.TimerServiceImpl.restoreTimers(TimerServiceImpl.java:692)
      at org.jboss.as.ejb3.timerservice.TimerServiceImpl.activate(TimerServiceImpl.java:225)
      at org.jboss.as.ejb3.component.EJBComponent.start(EJBComponent.java:543)
      at org.jboss.as.ejb3.component.stateless.StatelessSessionComponent.start(StatelessSessionComponent.java:114)
      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [wildfly-ee-7.0.0.GA-redhat-2.jar:7.0.0.GA-redhat-2]
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_111]
      at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_111]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_111]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_111]
      at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_111]
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
      at java.sql.Timestamp.valueOf(Unknown Source) [rt.jar:1.8.0_111]
      at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor.java:415)
      ... 18 more
      ~~~~~
      The error seems to be caused by trying to convert a "java.util.Date" object into "java.sql.Timestamp" and persist it into database.
      javax.ejb.ScheduleExpression API only has one method "start(java.util.Date s) " so that's something you can't change.

      I could see we need some patching to the scripts used to create tables and insert data. [1]

      [1] http://www.mastertheboss.com/jboss-server/wildfly-8/creating-clustered-ejb-3-timers

        1. AppSB.java
          3 kB
        2. ejb-timer.zip
          7 kB
        3. test.txt
          18 kB

              rhn-support-wfink Wolf Fink
              rhn-support-mpark Min Woo Park (Inactive)
              Jiří Bílek Jiří Bílek (Inactive)
              Jiří Bílek Jiří Bílek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: