Skip navigation
Currently Being Moderated

error cf with deserializeJSON

Apr 30, 2013 9:58 PM

Hi everyone,

I have a problem while using the function deserializeJSON.

I have a request looking like this :

Request: {   'config': {   'bgSubtractor': {   'config': {   'learningRate': 1e-06,

                                                    'mogHistory': 52,

                                                    'mogSigmaSquared': 80.456140350877},

                                      'input': {   'image': 'blur.image'},

                                      'type': 'BGSubtractor'},

                  'blur': {   'config': {   'size': 3.0},

                              'input': {   'image': 'cropArea.image'},

                              'type': 'MedianBlur'},

                  'cropArea': {   'config': {   'rect': '{meta.areaSampleRect}'},

                                  'input': {   'image': 'video.image'},

                                  'type': 'Crop'},

                  'cropMaskBGSub': {   'config': {   'rect': '{meta.motionSampleRect}'},

                                       'input': {   'image': 'bgSubtractor.image'},

                                       'type': 'Crop'},

                  'cropMotion': {   'config': {   'rect': '{meta.motionSampleRect}'},

                                    'input': {   'image': 'cropArea.image'},

                                    'type': 'Crop'},

                  'dataSaver': {   'config': {   'columns': [   'frameCount', ..... etc

 

but when i tried to deserialized it I got the error below. I know it's because I have this float as a scientific notation "1e-06". When I removed it, it's working fine.

Is there anyway to resolve this problem?

Thanks,

 

Kavinsky69

{"ExtendedInfo":"","Message":"Invalid Syntax Closing [}] not found","Detail":"","additional":{},"Extended_Info":"","ErrNumber":0," TagContext":[{"id":"??","template":"\/home\/ubuntu\/lib-src\/railo-4\/ webroot\/optimizer\/index.cfm","codePrintPlain":"130: \t

#qMasterData.request#<\/pre> \n131: \t<\/cfoutput>\t\n132: \t\n133: \t\n134: \t
#qMasterData.request#<\/pre>\n","column":0,"line":132,"raw_trace":"optimizer.index_cfm$cf.call(\/home\/ubuntu\/lib-src\/railo-4\/webroot\/optimizer\/index.cfm:132)","type":"cfml","codePrintHTML":"130: \t<pre style="white-space: normal">#qMasterData.request#<\/pre> 
\n131: \t<\/cfoutput>\t
\n132: \t<cfset json = deserializeJSON(qMasterData.request) ><\/b>
\n133: \t<cfoutput>
\n134: \t<pre style="white-space: normal">#qMasterData.request#<\/pre>
\n"}],"ErrorCode":"0","StackTrace":"Invalid Syntax Closing [}] not found\n\tat

 

 
Replies
  • Currently Being Moderated
    May 1, 2013 1:24 AM   in reply to Kavinsky69

    I'm using Coldfusion 9 and it works fine for me.

     

    isNumeric(1e-06);  // true
    jsn = '{"string":"foo","number":123.456,"scientific":1e-06}';
    struct = deserializeJSON(jsn);
    writedump(struct);
    

    struct.png

     

    You can try to run isNumeric(1e-06) to double check if it's picking it up as a number in scientific notation.

     

    As I said, it works fine for me in Coldfusion, but it might be a bug in Railo: https://groups.google.com/forum/?fromgroups=#!topic/railo/tzwII5e0caQ

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points