Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: dashboard
-
Labels:None
-
Environment:Debian GNU/Linux (unstable), IBM JVM 1.4.2 SR11
-
Complexity:Intermediate
-
Number of attachments :
Description
This may sound rather strange, but I have an issue with the Dashboard plugin on an IBM 1.4.2 JVM on Linux. When I run the goal "dashboard" (after the "persist" goal) I get this error:
[ERROR] The graph Configuration (id = cobertura.currentweek) is wrong. startPeriod (Startof_thisweek = Mon Jul 14 00:00:00 CEST 2008) is not before the endPeriod (Endof_thisweek = Sun Jul 13 23:59:59 CEST 2008).
[ERROR] DashBoardHistoricReportMojo executeReport() failed.
org.apache.maven.reporting.MavenReportException: The maven-dashboard-config.xml is not valid. see error messages above or see the maven-dashboard-config.xsd file.
at org.codehaus.mojo.dashboard.report.plugin.DashBoardReportMojo.executeReport(DashBoardReportMojo.java:334)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
This only seems to happen on Linux with the IBM JVM. The SUN JVM does work, the IBM JVM on Windows also works.
I have been playing around a bit with the PeriodUtils class (which determines the date) and found the following:
1) When I insert this line
"System.out.println("Calendar: " + cal.get(Calendar.YEAR) +", " + cal.get(Calendar.MONTH) + ", " + cal.get(Calendar.DAY_OF_MONTH) + ";" + cal.get(Calendar.DAY_OF_WEEK) +
cal.get(Calendar.HOUR) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));"
before the "cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);" statement in the "ENDOF_THISWEEK" code path, the returned date is correct (how strange is that, it's just a System.out.println() and some 'get' statements on the Calendar object??????).
2) When I switch the statements :
cal.setTime(currentDate);
cal.setFirstDayOfWeek(Calendar.MONDAY);
so the statements are in this order:
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.setTime(currentDate);
the correct date is displayed as well.
I have currently have NO explanation for this issue, or the solutions, but the dashboard plugin in its current state just doesn't work on an IBM JVM 1.4.2 on Linux.
OK, checked it again today. I copied the 'getDateFromPattern' method into my own 'public static void main' class to ease testing. Today, it didn't give the wrong 'endof_thisweek' date. However ....... (imagine scary music here
) it gave the wrong 'startof_thisweek' date.
Start of this week: Mon Jul 21 00:00:00 CEST 2008
End of this week: Sun Jul 20 23:59:59 CEST 2008
I'm going to contact IBM on this. This is insane. The fix I proposed above (switching the 'setTime' and 'setFirstDayOfWeek' calls) also fixes the issue in this case.