CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> Java

 Cannot format given Object as a Date

Print topic Send  topic

Author Message

Posts: 2
Posted: 10/18/2006, 3:44 AM


I made a web application with jsp/mysql using CCS

One of the data fiels is a Date. The default db date pattern is yyyy-MM-dd HH:mm:ss
I'm using dd/MM/yyyy in order to present/edit my dates.

At my _maint.jsp page everything works fine.

At my _list.jsp, when I search using the Date, I take this error (see below).

After some debugging I found that the problem occurs at the com.codecharge.db.RawCommand, at line 449

value = format.format( value );

I printed out the "value" before this line and it was correct with the right format.
Moreover, I did many tries with different formats, but I always take the same error.

Any idea?


java.lang.IllegalArgumentException: Cannot format given Object as a Date
java.text.DateFormat.format(Unknown Source)
java.text.Format.format(Unknown Source)
View profile  Send private message

Posts: 30
Posted: 10/18/2006, 5:31 AM


value = format.format( value );

value is an object.
It can heppen if value before formatting is not Date.
This value, primordially, takes from parameter.

1. Perhaps you chage this parameter in one of events... I.E. BeforeBuild<SomeCommand> or BeforeExecute<SomeCommand>. And it become String or somthis other, but not Date.

2. Or may by this parameter takes from DB as string (if you use Varchar or somthig else different from TimeDate) and not parsing....

I advice you determine class of Object value and place of his last modification.
Sorry my english!
View profile  Send private message

Posts: 2
Posted: 10/18/2006, 7:53 AM

Hi LH_13,

I printed out the value before this format() function and it was correct (with the correct format).

I dont have anything on BeforeExecute or BeforeBuild event and the parameter comes from the URL, not the DB because this is the value I want to search, not to edit.

Besides, I can insert/edit the field at tha _maint.jsp page without any problem. I'm using the same format and the Date is stored into the db without any problem. I also can see the stored date values.

The strange is that the format() function expects an Object whereas the value is an param.getObjectValue() ->String

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.