Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception while persisting jBatch thing? #447

Closed
jinahya opened this issue Sep 22, 2015 · 4 comments
Closed

An exception while persisting jBatch thing? #447

jinahya opened this issue Sep 22, 2015 · 4 comments
Labels
PR: TESTS REQUIRED PR Requires Tests to be merged

Comments

@jinahya
Copy link

jinahya commented Sep 22, 2015

I just dropped in Payara 4.1.153 to solve GLASSFISH-20886.
It seems work but I got following stacktraces.

I diffed two jsr352-mysql.sqls from GlassFish and Payara and got nothing so I did changed the database.

com.ibm.jbatch.container.exception.PersistenceException: java.sql.SQLException: Value '332015-09-22 19:17:002015-09-22 19:17:000000-00-00 00:00:002015-09-22 19:17:00��p33STARTED�mail' can not be represented as java.sql.Timestamp
        at fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager.jobOperatorGetJobExecution(JBatchJDBCPersistenceManager.java:1472) ~[glassfish-batch-connector.jar:na]
        at com.ibm.jbatch.container.jobinstance.JobExecutionHelper.getPersistedJobOperatorJobExecution(JobExecutionHelper.java:290) ~[payara-jbatch.jar:na]
        at com.ibm.jbatch.container.impl.BatchKernelImpl.getJobExecution(BatchKernelImpl.java:227) ~[payara-jbatch.jar:na]
        at com.ibm.jbatch.container.api.impl.JobOperatorImpl.getJobExecution(JobOperatorImpl.java:168) ~[payara-jbatch.jar:na]
        at com.ibm.jbatch.container.api.impl.JobOperatorImpl.getJobExecution(JobOperatorImpl.java:61) ~[payara-jbatch.jar:na]
        at kr.co.ermind.em21c.ejb.MailService.batchChunkMail(MailService.java:36) ~[MailService.class:na]
        at kr.co.ermind.em21c.ejb.MailService.lambda$batchChunkMailScheduled$0(MailService.java:46) ~[MailService.class:na]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_60]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_60]
        at org.glassfish.enterprise.concurrent.internal.ManagedFutureTask.run(ManagedFutureTask.java:141) ~[javax.enterprise.concurrent.jar:na]
        at org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.access$101(ManagedScheduledThreadPoolExecutor.java:383) ~[javax.enterprise.concurrent.jar:na]
        at org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.run(ManagedScheduledThreadPoolExecutor.java:532) ~[javax.enterprise.concurrent.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_60]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60]
        at org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl$ManagedThread.run(ManagedThreadFactoryImpl.java:250) ~[javax.enterprise.concurrent.jar:na]
Caused by: java.sql.SQLException: Value '332015-09-22 19:17:002015-09-22 19:17:000000-00-00 00:00:002015-09-22 19:17:00��p33STARTED�mail' can not be represented as java.sql.Timestamp
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:935) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.BufferRow.getTimestampFast(BufferRow.java:555) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.ResultSetImpl.getTimestampInternal(ResultSetImpl.java:5956) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:5624) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:5653) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
        at com.sun.gjc.spi.base.ResultSetWrapper.getTimestamp(ResultSetWrapper.java:599) ~[__ds_jdbc_ra.jar:na]
        at fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager.readJobExecutionRecord(JBatchJDBCPersistenceManager.java:1537) ~[glassfish-batch-connector.jar:na]
        at fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager.jobOperatorGetJobExecution(JBatchJDBCPersistenceManager.java:1470) ~[glassfish-batch-connector.jar:na]
        ... 15 common frames omitted]]

@davewinters
Copy link
Contributor

Hi,

Do you have a simple test case so that we can verify here?

The timestamp value seems somewhat weird though whereby this string is at the end of the timestamp value: ��p33STARTED�mail so could it appears to be a case of the timestamp value not being valid here

Caused by: java.sql.SQLException: Value '332015-09-22 19:17:002015-09-22 19:17:000000-00-00 00:00:002015-09-22 19:17:00��p33STARTED�mail' can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:935) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.BufferRow.getTimestampFast(BufferRow.java:555) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.ResultSetImpl.getTimestampInternal(ResultSetImpl.java:5956) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:5624) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:5653) ~[mysql-connector-java-5.1.36-bin.jar:5.1.36]
at com.sun.gjc.spi.base.ResultSetWrapper.getTimestamp(ResultSetWrapper.java:599) ~[__ds_jdbc_ra.jar:na]
at fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager.readJobExecutionRecord(JBatchJDBCPersistenceManager.java:1537) ~[glassfish-batch-connector.jar:na]
at fish.payara.jbatch.persistence.rdbms.JBatchJDBCPersistenceManager.jobOperatorGetJobExecution(JBatchJDBCPersistenceManager.java:1470) ~[glassfish-batch-connector.jar:na]
... 15 common frames omitted]]

@davewinters davewinters added the PR: TESTS REQUIRED PR Requires Tests to be merged label Sep 22, 2015
@jinahya
Copy link
Author

jinahya commented Sep 23, 2015

I added an additional connection property. And the problem's gone.

zeroDateTimeBehavior=convertToNull.

I'm not sure which domain this issue resides in, please take a look at following links.

handling DATETIME values 0000-00-00 00:00:00 in JDBC
5.1 Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J

@smillidge
Copy link
Contributor

Thanks for letting us know. We can add that recommendation to the documentation.

@davidweaver
Copy link
Contributor

Documentation updated

JamesHillyard pushed a commit to JamesHillyard/Payara that referenced this issue Sep 17, 2021
FISH-1058 FISH-5690 FISH-5691 Deploy applications via Micro API outside Application Invocation and fix surrounding trouble
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: TESTS REQUIRED PR Requires Tests to be merged
Projects
None yet
Development

No branches or pull requests

4 participants