I am away form my main computerI  and wanted to fool around with some 
WDDX on  CFMX.

So, I just tried one of the snippets examples in the docs and ran it 
against the sample db provided with CFMX.   (I'm on Mac OS X, so I 
installed everything on my laptop, 'cause having local CF capability is 
new to me).

Anyway, the snippet worked as advertised --

        Query a db for a few text and numeric fields
        cfoutput the data
        serialize the query
        cfoutput the WDDX packet
        deserialize
        cfoutput the deserialized data

No problem, right?

Well, I wanted a more robust example, so I changed the query to a 
SELECT *

The serialization failed.

I fiddled with it and found that the culprit was a datetime field in the 
db that cfoutputs as:

        {ts '1996-08-27 00:00:00'}

I am sure that I have serialized datetime fields hundreds of times, but 
I don't have the code handy.

Below is  the modified snippet code, followed by the output.  "posted" 
is the datetime field.

Am I missing something?

TIA

Dick

        <!--- This shows basic use of the cfwddx tag. --->
        <html>
        <body>
        <!--- Create a simple query --->
        <cfquery name = "q" dataSource = "cfsnippets">
          SELECT  Posted, Body, Message_Id, Thread_id, Username from messages
        </cfquery>
        
        The recordset data is:...<p>
        <cfoutput query = q>
        #Body# #Posted# #Message_ID# #Thread_ID# #Username#<br>
        </cfoutput><p>
        
        <!--- Serialize data to WDDX format --->
        Serializing CFML data...<p>
        <cfwddx action = "cfml2wddx" input = #q# output = "wddxText">
        
        <!--- Display WDDX XML packet --->
        Resulting WDDX packet is:
        <xmp><cfoutput>#wddxText#</cfoutput></xmp>
        <!--- Deserialize to a variable named wddxResult --->
        Deserializing WDDX packet...<p>
        <cfwddx action = "wddx2cfml" input = #wddxText# output = "qnew">
        
        The recordset data is:...<p>
        <cfoutput query = qnew>
        #Body# #Posted# #Message_ID# #Thread_ID# #Username#<br>
        </cfoutput><p>
        
        
The recordset data is:...

{ts '1996-08-27 00:00:00'} 346 162 Frank Johnson
{ts '1996-08-27 00:00:00'} 347 162 Linda Jason
{ts '1996-08-27 00:00:00'} 348 162 Frank Johnson
{ts '1996-08-27 00:00:00'} 349 162 Alan Russell
{ts '1996-08-22 00:00:00'} 350 163 Nick Driscoll
{ts '1996-08-24 00:00:00'} 352 163 Peter Lyden
{ts '1996-08-25 00:00:00'} 353 163 Alvin Langston
{ts '1996-08-25 00:00:00'} 354 164 Jack Anderson
{ts '1996-06-26 00:00:00'} 355 164 Patricia Westerman
{ts '1996-08-27 00:00:00'} 356 164 Dana Adams
{ts '1996-08-27 00:00:00'} 357 164 Patricia Westerman
{ts '1996-08-29 00:00:00'} 358 165 Barbara Glass
{ts '1996-08-30 00:00:00'} 359 165 Andrew Harper
{ts '1996-08-01 00:00:00'} 360 166 Jeff Richards
{ts '1996-08-01 00:00:00'} 361 166 Peter Nelson

Serializing CFML data...


Error Occurred While Processing Request
Exception during WDDX operation.

java.lang.IllegalArgumentException.
�
The Error Occurred in /opt/coldfusionmx/wwwroot/mycfmxapps/WDDX1.cfm: 
line 20

18 : <!--- Display WDDX XML packet --->
19 : Resulting WDDX packet is:
20 : <xmp><cfoutput>#wddxText#</cfoutput></xmp>
21 : <!--- Deserialize to a variable named wddxResult --->
22 : Deserializing WDDX packet...<p>


------------------------------------------------------------------------

Please Try The Following:

*       Check the CFML Reference Manual to verify that you are using the 
correct syntax.

*       Search the Knowledge Base to find a solution to your problem.




Browser��       Mozilla/4.0 (compatible; MSIE 5.14; Mac_PowerPC)
Remote Address��        127.0.0.1
Referer��       http://127.0.0.1:8500/mycfmxapps/
Date/Time��     31-Jul-02 03:53 AM
Stack Trace (click to expand)
at 
cfWDDX12ecfm1990934942.runPage(/opt/coldfusionmx/wwwroot/mycfmxapps/WDDX1.
cfm:20) at 
cfWDDX12ecfm1990934942.runPage(/opt/coldfusionmx/wwwroot/mycfmxapps/WDDX1.
cfm:20)


java.lang.IllegalArgumentException
        at java.sql.Date.getHours(Date.java:151)
        at coldfusion.wddx.ISO8601.stringValueOf(Unknown Source)
        at coldfusion.wddx.WddxOutputStream.writeDate(Unknown Source)
        at coldfusion.wddx.DateSerializer.writeObject(Unknown Source)
        at coldfusion.wddx.WddxOutputStream.writeObject(Unknown Source)
        at coldfusion.wddx.WddxOutputStream.writeRecordSet(Unknown Source)
        at coldfusion.wddx.RecordSetSerializer.writeObject(Unknown Source)
        at coldfusion.wddx.WddxOutputStream.writeObject(Unknown Source)
        at coldfusion.wddx.WddxSerializer.serialize(Unknown Source)
        at coldfusion.tagext.lang.WddxTag.serialize(Unknown Source)
        at coldfusion.tagext.lang.WddxTag.doStartTag(Unknown Source)
        at coldfusion.runtime.CfJspPage._emptyTag(Unknown Source)
        at 
cfWDDX12ecfm1990934942.runPage(/opt/coldfusionmx/wwwroot/mycfmxapps/WDDX1.
cfm:20)
        at coldfusion.runtime.CfJspPage.invoke(Unknown Source)
        at coldfusion.tagext.lang.IncludeTag.doStartTag(Unknown Source)
        at coldfusion.filter.CfincludeFilter.invoke(Unknown Source)
        at coldfusion.filter.ApplicationFilter.invoke(Unknown Source)
        at coldfusion.filter.PathFilter.invoke(Unknown Source)
        at coldfusion.filter.ExceptionFilter.invoke(Unknown Source)
        at coldfusion.filter.ClientScopePersistenceFilter.invoke(Unknown 
Source)
        at coldfusion.filter.BrowserFilter.invoke(Unknown Source)
        at coldfusion.filter.GlobalsFilter.invoke(Unknown Source)
        at coldfusion.filter.DatasourceFilter.invoke(Unknown Source)
        at coldfusion.CfmServlet.service(Unknown Source)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at 
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
        at 
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
        at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
        at 
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
348)
        at 
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
        at 
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:
294)
        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to