tomcat5和java7 U21中的新错误

时间:2013-05-07 21:59:08

标签: servlets windows-8 java-7 tomcat5

我在Java + MySql + Tomcat5中开发了一个系统。我曾经使用Java6,但我用java7将我的机器更新为win8,当我运行我的servlet时,我从Tomcat得到了这个错误。有谁知道为什么会发生这种情况或如何解决它。

javax.servlet.ServletException: java.lang.IllegalArgumentException: HOUR_OF_DAY: 0 -> 1
    at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2764)
    at java.util.Calendar.updateTime(Calendar.java:2606)
    at java.util.Calendar.getTimeInMillis(Calendar.java:1118)
    at java.util.Calendar.getTime(Calendar.java:1091)
    at com.genexus.GXutil.resetTime(Unknown Source)
    at com.genexus.db.driver.GXConnection.isNullDate(Unknown Source)
    at com.genexus.db.driver.GXResultSet.getGXDate(Unknown Source)
    at paddmwl__default.getResults(paddmwl.java:911)
    at com.genexus.db.DataStoreProvider.readNext(Unknown Source)
    at com.genexus.db.DataStoreProvider.execute(Unknown Source)
    at paddmwl.execute_int(paddmwl.java:44)
    at paddmwl.execute(paddmwl.java:30)
    at hconsola_impl.e202U2(hconsola_impl.java:3490)
    at hconsola_impl.evt2U2(hconsola_impl.java:478)
    at hconsola_impl.dispatchEvents(hconsola_impl.java:180)
    at hmasterpageww_impl.evtCH2(hmasterpageww_impl.java:215)
    at hmasterpageww_impl.wsCH2(hmasterpageww_impl.java:146)
    at hmasterpageww_impl.webExecute(hmasterpageww_impl.java:53)
    at hconsola_impl.webExecute(hconsola_impl.java:62)
    at com.genexus.webpanels.GXWebObjectBase.doExecute(Unknown Source)
    at hconsola.doExecute(hconsola.java:19)
    at com.genexus.webpanels.GXWebObjectStub.callExecute(Unknown Source)
    at com.genexus.webpanels.GXWebObjectStub.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)
    at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:169)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:722)

    com.genexus.webpanels.GXWebObjectStub.callExecute(Unknown Source)
    com.genexus.webpanels.GXWebObjectStub.doPost(Unknown Source)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)
    org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:169)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

我现在已经知道为什么会这样,而且我没有从谷歌获得任何信息。 谢谢你的帮助。祝你有美好的一天!! :)

1 个答案:

答案 0 :(得分:1)

在解析巴西的日期时,我看到由于DST(夏令时)限制而抛出此异常。

在手头的情况下,由于DST限制,GregorianCalendar会抛出IllegalArgumentException。根据GregorianCalendar,当DB驱动程序尝试读取日期字段时,存储的日期不是有效日期,因为时间部分为零(午夜),并且该特定日期没有午夜。

我知道这听起来很奇怪,但问题在于DST的定义方式(至少在巴西的情况下,我不了解其他国家),我们在午夜到凌晨1点进入夏令时。这导致了没有午夜的现象,因为它被1am代替,这导致了我们在这里看到的问题。在美国,我们没有这个问题,因为DST在凌晨3点发生变化,因此午夜始终存在于应有的位置。我想知道凌晨3点到凌晨4点是如何处理的,以避免这种怪癖。

我知道处理这个问题的唯一方法是永远不要存储零时间部分的日期。