Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
ParameterValidationException when passing date parameter.
Cheveral
We're having an issue with the production of a report and I was wondering if someone could point us in the right direction, please?
We've got BIRT 2.2.1 up and integrated, and in the main we're able to produce reports.
However, we are having an issue when passing a date as a parameter. We are passing it as a String value in the format "MM/dd/yyyy". Here is an extract from the console, showing the debug output and stacktrace. You can see the DateParameter as 12/31/2007.
[21/07/08 15:12:33:636 BST] 74b76ec SystemOut O DEBUG: parameter StringParameter is of type: class java.lang.String value is: test
[21/07/08 15:12:33:636 BST] 74b76ec SystemOut O DEBUG: parameter DateParameter is of type: class java.lang.String value is: 12/31/2007
[21/07/08 15:12:33:636 BST] 74b76ec SystemOut O DEBUG: parameter DatetimeParameter is of type: class java.lang.String value is: 01/01/2008
[21/07/08 15:12:33:636 BST] 74b76ec SystemOut O DEBUG: parameter teamlist is of type: class java.lang.String value is:
[21/07/08 15:12:33:636 BST] 74b76ec SystemErr R 21-Jul-2008 15:12:33 org.eclipse.birt.report.engine.api.impl.EngineTask validateParameters
SEVERE: The type of parameter "DateParameter" is expected as "date", not "java.lang.String".
org.eclipse.birt.report.engine.api.impl.ParameterValidationException: The type of parameter "DateParameter" is expected as "date", not "java.lang.String".
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateParameterValueType(EngineTask.java:665)
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateScalarParameter(EngineTask.java:629)
at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:569)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:513)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:975)
at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:496)
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateParameters(EngineTask.java:475)
at com.pirean.reporting.util.ReportHandler.runAndRender(ReportHandler.java:229)
at com.pirean.reporting.services.ReportViewer.doGet(ReportViewer.java:155)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
Please find below the date parameter definition specified in the rptdesign file for the report in question:
<scalar-parameter name="DateParameter" id="7">
<text-property name="helpText">Date Parameter Help</text-property>
<text-property name="displayName">Date Parameter</text-property>
<property name="valueType">static</property>
<property name="dataType">date</property>
<property name="paramType">simple</property>
<text-property name="promptText">Date Parameter Prompt</text-property>
<property name="controlType">text-box</property>
<property name="defaultValue">31/12/2007</property>
<property name="distinct">true</property>
<structure name="format">
<property name="category">Short Date</property>
<property name="pattern">Short Date</property>
</structure>
</scalar-parameter>
If anyone has any idea, we'd be most grateful for some help!
Thanks.
Find more posts tagged with
Comments
cypherdj
Hi there,
have you tried using the following format for your date "yyyy-MM-dd"?
I believe this is the expected format for a date parameter with Birt.
Hope that helps,
Cedric
Cheveral
Hi Cedric,
Thanks ever so much for your response.
I've tried this but, unfortunately, we get exactly the same result when using the format yyyy-MM-dd.
I don't suppose you've got any other ideas, please?
Thanks!
Hakan
Hi,
I have a similar problem using birt 2.6.1, but only when attempting to run the report in debug mode.
The report has two datetime parameters, start and stop, which gives me no problems when running in deployed mode or in the designer. But when I attempt to run the report in debugging mode I get the exception below.
I have entered the datetime parameter value as "2009-11-15 00:00:00.000" to the debug dialog - which I belived should be correct - obviously it is not, so I have tried other formats as well but found none that works.
Any ideas on how to solve this problem ?
Thanks,
H?kan
The exception:
org.eclipse.birt.report.engine.api.impl.ParameterValidationException: The type of parameter "startDate" is expected as "dateTime", not "java.lang.String".
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateParameterValueType(EngineTask.java:865)
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateAbstractScalarParameter(EngineTask.java:829)
at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:756)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:686)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visitParametersInGroup(EngineTask.java:1330)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitParameterGroup(EngineTask.java:712)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:1392)
at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:670)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:94)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.createReport(ReportLauncher.java:594)
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.renderReport(ReportLauncher.java:541)
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.run(ReportLauncher.java:455)
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.main(ReportLauncher.java:104)
at org.eclipse.birt.report.debug.internal.core.ReportDebugger.start(ReportDebugger.java:39)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Hakan
Hi,<br />
My problem turned out to be a bug fixed in 2.6.2.v20101130-0630.<br />
Thanks,<br />
H?kan<br />
<br />
<blockquote class='ipsBlockquote' data-author="'Hakan'" data-cid="70521" data-time="1290163693" data-date="19 November 2010 - 03:48 AM"><p>
Hi,<br />
<br />
I have a similar problem using birt 2.6.1, but only when attempting to run the report in debug mode.<br />
<br />
The report has two datetime parameters, start and stop, which gives me no problems when running in deployed mode or in the designer. But when I attempt to run the report in debugging mode I get the exception below.<br />
<br />
I have entered the datetime parameter value as "2009-11-15 00:00:00.000" to the debug dialog - which I belived should be correct - obviously it is not, so I have tried other formats as well but found none that works.<br />
<br />
Any ideas on how to solve this problem ?<br />
<br />
Thanks,<br />
H?kan<br />
<br />
The exception: <br />
org.eclipse.birt.report.engine.api.impl.ParameterValidationException: The type of parameter "startDate" is expected as "dateTime", not "java.lang.String".<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateParameterValueType(EngineTask.java:865)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateAbstractScalarParameter(EngineTask.java:829)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:756)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:686)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visitParametersInGroup(EngineTask.java:1330)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitParameterGroup(EngineTask.java:712)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:1392)<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:670)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:94)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)<br />
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.createReport(ReportLauncher.java:594)<br />
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.renderReport(ReportLauncher.java:541)<br />
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.run(ReportLauncher.java:455)<br />
at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.main(ReportLauncher.java:104)<br />
at org.eclipse.birt.report.debug.internal.core.ReportDebugger.start(ReportDebugger.java:39)<br />
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)<br />
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)<br />
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)<br />
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)<br />
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:597)<br />
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)<br />
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)<br />
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)<br />
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)<br /></p></blockquote>