Announcement Announcement Module
Collapse
No announcement yet.
IllegalArgumentException: HOUR_OF_DAY exception within Spring-greenhouse-c4a1555 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • IllegalArgumentException: HOUR_OF_DAY exception within Spring-greenhouse-c4a1555

    I get an exception within GregorianCalendar when running a Junit test within Spring-greenhouse-c4a1555 JUnits.

    The exception looks as if its internal to the GregorianCalendar class and not caused by Spring as its within a getTimeInMillis() method. I note web references to a similar problem with JDK 1.5 but I have difficulty in believing the problem would still exist in 1.6. I suspect something in the class path.

    The debugger claims GregorianCalendar derives from jdk1.6.0_25 rt.jar, the maven build path is as provided by greenhouse sources. Any ideas for a remidy?

    ---

    Junit Exception running JdbcEventRepositoryTest.findEventBySlug()

    org.springframework.jdbc.UncategorizedSQLException : PreparedStatementCallback; uncategorized SQLException for SQL [select e.id, e.title, e.timeZone, e.startTime, e.endTime, e.slug, e.description, g.hashtag, g.slug as groupSlug, g.name as groupName, v.id as venueId, v.name as venueName, v.postalAddress as venuePostalAddress, v.latitude as venueLatitude, v.longitude as venueLongitude, v.locationHint as venueLocationHint from Event e inner join MemberGroup g on e.memberGroup = g.id inner join EventVenue ev on e.id = ev.event inner join Venue v on ev.venue = v.id where g.slug = ? and extract(year from e.startTime) = ? and extract(month from e.startTime) = ? and e.slug = ?]; SQL state [HY000]; error code [50000]; General error: "java.lang.IllegalArgumentException: HOUR_OF_DAY"; SQL statement:
    select e.id, e.title, e.timeZone, e.startTime, e.endTime, e.slug, e.description, g.hashtag, g.slug as groupSlug, g.name as groupName, v.id as venueId, v.name as venueName, v.postalAddress as venuePostalAddress, v.latitude as venueLatitude, v.longitude as venueLongitude, v.locationHint as venueLocationHint from Event e inner join MemberGroup g on e.memberGroup = g.id inner join EventVenue ev on e.id = ev.event inner join Venue v on ev.venue = v.id where g.slug = ? and extract(year from e.startTime) = ? and extract(month from e.startTime) = ? and e.slug = ? [50000-160]; nested exception is org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalArgumentException: HOUR_OF_DAY"; SQL statement:
    select e.id, e.title, e.timeZone, e.startTime, e.endTime, e.slug, e.description, g.hashtag, g.slug as groupSlug, g.name as groupName, v.id as venueId, v.name as venueName, v.postalAddress as venuePostalAddress, v.latitude as venueLatitude, v.longitude as venueLongitude, v.locationHint as venueLocationHint from Event e inner join MemberGroup g on e.memberGroup = g.id inner join EventVenue ev on e.id = ev.event inner join Venue v on ev.venue = v.id where g.slug = ? and extract(year from e.startTime) = ? and extract(month from e.startTime) = ? and e.slug = ? [50000-160]
    at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:603)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:637)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:666)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:674)
    at org.springframework.jdbc.core.JdbcTemplate.queryFo rObject(JdbcTemplate.java:734)
    at com.springsource.greenhouse.events.JdbcEventReposi tory.findEventBySlug(JdbcEventRepository.java:57)
    at com.springsource.greenhouse.events.JdbcEventReposi toryTest.findEventBySlug(JdbcEventRepositoryTest.j ava:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.e valuate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.ev aluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunne r.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner. java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.ja va:300)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)
    Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalArgumentException: HOUR_OF_DAY"; SQL statement:
    select e.id, e.title, e.timeZone, e.startTime, e.endTime, e.slug, e.description, g.hashtag, g.slug as groupSlug, g.name as groupName, v.id as venueId, v.name as venueName, v.postalAddress as venuePostalAddress, v.latitude as venueLatitude, v.longitude as venueLongitude, v.locationHint as venueLocationHint from Event e inner join MemberGroup g on e.memberGroup = g.id inner join EventVenue ev on e.id = ev.event inner join Venue v on ev.venue = v.id where g.slug = ? and extract(year from e.startTime) = ? and extract(month from e.startTime) = ? and e.slug = ? [50000-160]
    at org.h2.message.DbException.getJdbcSQLException(DbE xception.java:329)
    at org.h2.message.DbException.get(DbException.java:15 8)
    at org.h2.message.DbException.convert(DbException.jav a:281)
    at org.h2.command.Command.executeQuery(Command.java:1 89)
    at org.h2.jdbc.JdbcPreparedStatement.executeQuery(Jdb cPreparedStatement.java:96)
    at org.springframework.jdbc.core.JdbcTemplate$1.doInP reparedStatement(JdbcTemplate.java:644)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:587)
    ... 31 more
    Caused by: java.lang.IllegalArgumentException: HOUR_OF_DAY
    at java.util.GregorianCalendar.computeTime(GregorianC alendar.java:2316)
    at java.util.Calendar.updateTime(Calendar.java:2468)
    at java.util.Calendar.getTimeInMillis(Calendar.java:1 087)
    at java.util.Calendar.getTime(Calendar.java:1060)
    at org.h2.util.DateTimeUtils.getTimeTry(DateTimeUtils .java:387)
    at org.h2.util.DateTimeUtils.getMillis(DateTimeUtils. java:343)
    at org.h2.util.DateTimeUtils.convertDateValueToTimest amp(DateTimeUtils.java:650)
    at org.h2.value.ValueTimestamp.getTimestamp(ValueTime stamp.java:170)
    at org.h2.expression.Function.getValueWithArgs(Functi on.java:1057)
    at org.h2.expression.Function.getValue(Function.java: 441)
    at org.h2.expression.Comparison.getValue(Comparison.j ava:206)
    at org.h2.expression.ConditionAndOr.getValue(Conditio nAndOr.java:83)
    at org.h2.expression.Expression.getBooleanValue(Expre ssion.java:180)
    at org.h2.table.TableFilter.isOk(TableFilter.java:430 )
    at org.h2.table.TableFilter.next(TableFilter.java:378 )
    at org.h2.table.TableFilter.next(TableFilter.java:391 )
    at org.h2.command.dml.Select.queryFlat(Select.java:51 2)
    at org.h2.command.dml.Select.queryWithoutCache(Select .java:617)
    at org.h2.command.dml.Query.query(Query.java:298)
    at org.h2.command.dml.Query.query(Query.java:268)
    at org.h2.command.dml.Query.query(Query.java:37)
    at org.h2.command.CommandContainer.query(CommandConta iner.java:82)
    at org.h2.command.Command.executeQuery(Command.java:1 85)
    ... 34 more
Working...
X