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

Error parsing dates #8

Closed
spatzle opened this issue Nov 22, 2012 · 16 comments
Closed

Error parsing dates #8

spatzle opened this issue Nov 22, 2012 · 16 comments
Assignees

Comments

@spatzle
Copy link

spatzle commented Nov 22, 2012

Hi,

Looking at http://localhost:8080/resque/failed

I get this error message

Can not construct instance of java.util.Date from String value '2012/11/20 15:03:52 CET': not a valid representation (error: Can not parse date "2012/11/20 15:03:52 CET": not compatible with any of standard forms ("yyyy-MM-dd'T'HH:mm:ss.SSSZ", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "EEE, dd MMM yyyy HH:mm:ss zzz", "yyyy-MM-dd"))

I am running jruby-rack-worker with resque gem in tomcat

@gresrun
Copy link
Owner

gresrun commented Nov 24, 2012

So, Resque running on JRuby is formatting dates like "yyyy/MM/dd HH:mm:ss zzz"?
Resque on Ruby creates dates of the format: "yyyy-MM-dd HH:mm:ss Z"

It is no big deal to have another date format but could you see if there is a setting on your side to make it format the dates like Resque normally does?

@ghost ghost assigned gresrun Nov 24, 2012
@gresrun
Copy link
Owner

gresrun commented Nov 24, 2012

After re-reading your statement again, I realized I'm not quite sure I understand completely.

Is the exception being thrown in Jesque? Jesque-Web? Or is it in the JRuby Resque gem?
Can you give me the full stacktrace of the exception?

Thanks!

@gresrun
Copy link
Owner

gresrun commented Nov 30, 2012

@spatzle Can you clarify what you meant here? If I don't hear back, I'll just close this bug.

@spatzle
Copy link
Author

spatzle commented Mar 6, 2013

Hi @gresrun, sorry forgot to check messages, this is being thrown by jesque-web, I am deploying the the war, when I go to the failed job page, I see the above message

@spatzle
Copy link
Author

spatzle commented Mar 6, 2013

Here are more info on the error

at net.greghaines.jesque.utils.PoolUtils.doWorkInPoolNicely(PoolUtils.java:70)
at net.greghaines.jesque.meta.dao.impl.FailureDAORedisImpl.getFailures(FailureDAORedisImpl.java:73)
at net.greghaines.jesque.web.controller.JesqueController.failed(JesqueController.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.codehaus.jackson.map.JsonMappingException: Can not construct instance of java.util.Date from String value '2013/03/06 09:58:23 EST': not a valid representation (error: Can not parse date "2013/03/06 09:58:23 EST": not compatible with any of standard forms ("yyyy-MM-dd'T'HH:mm:ss.SSSZ", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "EEE, dd MMM yyyy HH:mm:ss zzz", "yyyy-MM-dd"))
at [Source: java.io.StringReader@5119c6e4; line: 1, column: 2]
at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
at org.codehaus.jackson.map.deser.StdDeserializationContext.weirdStringException(StdDeserializationContext.java:222)
at org.codehaus.jackson.map.deser.StdDeserializer._parseDate(StdDeserializer.java:510)
at org.codehaus.jackson.map.deser.DateDeserializer.deserialize(DateDeserializer.java:26)
at org.codehaus.jackson.map.deser.DateDeserializer.deserialize(DateDeserializer.java:17)
at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2376)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1087)
at org.codehaus.jackson.JsonParser.readValueAs(JsonParser.java:1227)
at net.greghaines.jesque.json.JobFailureJsonDeserializer.deserialize(JobFailureJsonDeserializer.java:85)
at net.greghaines.jesque.json.JobFailureJsonDeserializer.deserialize(JobFailureJsonDeserializer.java:40)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2395)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1595)
at net.greghaines.jesque.meta.dao.impl.FailureDAORedisImpl$2.doWork(FailureDAORedisImpl.java:82)
at net.greghaines.jesque.meta.dao.impl.FailureDAORedisImpl$2.doWork(FailureDAORedisImpl.java:74)
at net.greghaines.jesque.utils.PoolUtils.doWorkInPool(PoolUtils.java:48)
at net.greghaines.jesque.utils.PoolUtils.doWorkInPoolNicely(PoolUtils.java:62)
at net.greghaines.jesque.meta.dao.impl.FailureDAORedisImpl.getFailures(FailureDAORedisImpl.java:73)
at net.greghaines.jesque.web.controller.JesqueController.failed(JesqueController.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

@gresrun
Copy link
Owner

gresrun commented Mar 6, 2013

Ok, I'll look at this today.

@spatzle
Copy link
Author

spatzle commented Mar 6, 2013

It has to do with the fact that this class isn't very well written (in jackson-databind jar)

https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/util/StdDateFormat.java

@gresrun
Copy link
Owner

gresrun commented Mar 7, 2013

I'm working on fixing this. Basically I have to write a custom CompositeDateFormatter and use that for de-/serializing Dates in Jesque.
It's not that hard, just got to finish writing it and test it. 😐

@spatzle
Copy link
Author

spatzle commented Mar 7, 2013

Actually, I am using resque rather than jesque w/ jruby, and I see that they use another format
https://github.com/defunkt/resque/blob/master/lib/resque/failure/redis.rb

Time.now.rfc2822

item['retried_at'] = Time.now.strftime("%Y/%m/%d %H:%M:%S")

Thanks for this update, I don't think it's really your library causing the issue

@gresrun
Copy link
Owner

gresrun commented Mar 8, 2013

This should now be fixed if you build the latest Jesque snapshot from master and use that in your Jesque-Web POM.
See gresrun/jesque@829ecd3 for the gory details.

Can you test this and see if it fixes the problem for you?

@spatzle
Copy link
Author

spatzle commented Mar 8, 2013

I've put the jesque jar into Jesque-web's pom

net.greghaines jesque 1.3.2 system ${project.basedir}/lib/jesque-1.3.2-SNAPSHOT.jar

but I got this error
[ERROR] \Program Files (x86)\jenkins\jobs\jesque-web\src\main\java\net\greghaine
s\jesque\web\utils\TagHelper.java:[62,32] error: cannot access ObjectMapper

@gresrun
Copy link
Owner

gresrun commented Mar 8, 2013

I'm able to compile and run here without any errors. How did you install the new Jesque snapshot?

Either you can checkout the Jesque project and run mvn clean install on the same machine or create the JAR and POM somewhere else and install it into the machine using the following:

mvn install:install-file -Dfile=/path/to/jesque-1.3.2-SNAPSHOT.jar \
    -DgroupId=net.greghaines -DartifactId=jesque \
    -Dversion=1.3.2-SNAPSHOT -Dpackaging=jar \
    -DpomFile=/path/to/jesque-1.3.2-SNAPSHOT.pom

@gresrun
Copy link
Owner

gresrun commented Mar 11, 2013

Any luck getting this working?

@gresrun
Copy link
Owner

gresrun commented Mar 14, 2013

Poke.

@spatzle
Copy link
Author

spatzle commented Mar 14, 2013

sorry, sorry, I'll be working on that today, thanks :)

On Wednesday, March 13, 2013, Greg Haines wrote:

Poke.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-14883875
.

@gresrun
Copy link
Owner

gresrun commented Mar 20, 2013

Closing this. Feel free to reopen if it is not resolved. Let me know if you need a new release for this and I'll cut one for you.

@gresrun gresrun closed this as completed Mar 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants