GRPharoUtf8CodecStream does not understand object:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

GRPharoUtf8CodecStream does not understand object:

Sabine Manaa
Hi,

I think there is a bug in Seaside.
I run into this when using JQGrid.

Code in Pharo3:

Dictionary>>jsonOn: aRenderer
        aRenderer object: [
                self keysAndValuesDo: [ :key :value |
                        aRenderer key: key value: value ] ]
       
aRenderer is iOf GRPharoUtf8CodecStream
GRPharoUtf8CodecStream does not understand object:

You can reproduce it also when running JQGrid example.
Have a look in the Network response in the internet browser where you will see a 500 internal server error with "MessageNotUnderstood: GRPharoUtf8CodecStream>>object:
Your request could not be completed. An exception occurred."

or implement

GRPharoUtf8CodecStream>>object: anObject
self halt.

In Pharo2, it was implemented like this:
Dictionary>>jsonOn: aStream
        JSJsonStream encodeDictionary: self on: aStream



Sabine
Reply | Threaded
Open this post in threaded view
|

Re: GRPharoUtf8CodecStream does not understand object:

Philippe Marschall
On Fri, Jan 24, 2014 at 12:02 PM, Sabine Knöfel
<[hidden email]> wrote:

> Hi,
>
> I think there is a bug in Seaside.
> I run into this when using JQGrid.
>
> Code in Pharo3:
>
> Dictionary>>jsonOn: aRenderer
>         aRenderer object: [
>                 self keysAndValuesDo: [ :key :value |
>                         aRenderer key: key value: value ] ]
>
> aRenderer is iOf GRPharoUtf8CodecStream
> GRPharoUtf8CodecStream does not understand object:

The argument to #jsonOn: should be a WAJsonCanvas and not a
GRPharoUtf8CodecStream in Seaside 3.1. Do you have a stack trace?

> You can reproduce it also when running JQGrid example.
> Have a look in the Network response in the internet browser where you will
> see a 500 internal server error with "MessageNotUnderstood:
> GRPharoUtf8CodecStream>>object:
> Your request could not be completed. An exception occurred."
>
> or implement
>
> GRPharoUtf8CodecStream>>object: anObject
> self halt.
>
> In Pharo2, it was implemented like this:
> Dictionary>>jsonOn: aStream
>         JSJsonStream encodeDictionary: self on: aStream

That was Seaside 3.0. JSON support in Seaside 3.1 is "new". It's no
longer based on JavaScript (JSON isn't actually a JavaScript subset).
It now has a canvas much like the HTML and XML support. This allowed
us to fix many corner case bugs.

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: GRPharoUtf8CodecStream does not understand object:

Sabine Manaa
Hi Phillippe,

how do I get a stack trace?
"Fuel out Stack" in the Debugger?

jsonOn: is sent in this context:

JQGrid>>processSearchCallback
|searchRequest searchResponse|
searchRequest := JQGridSearchRequest parseFromWARequest: self requestContext request using: jqGridColumns.
searchResponse := searchCallback value: searchRequest value: jqGridColumns. 
searchResponse jqGridColumns: jqGridColumns.
self requestContext respond: [:response|
response
doNotCache;
contentType: (WAMimeType applicationJson
charset: self requestContext handler charSet).
searchResponse jsonOn: response stream].
regards
Sabine



On Sat, Jan 25, 2014 at 4:34 PM, Philippe Marschall [via Smalltalk] <[hidden email]> wrote:
On Fri, Jan 24, 2014 at 12:02 PM, Sabine Knöfel
<[hidden email]> wrote:

> Hi,
>
> I think there is a bug in Seaside.
> I run into this when using JQGrid.
>
> Code in Pharo3:
>
> Dictionary>>jsonOn: aRenderer
>         aRenderer object: [
>                 self keysAndValuesDo: [ :key :value |
>                         aRenderer key: key value: value ] ]
>
> aRenderer is iOf GRPharoUtf8CodecStream
> GRPharoUtf8CodecStream does not understand object:
The argument to #jsonOn: should be a WAJsonCanvas and not a
GRPharoUtf8CodecStream in Seaside 3.1. Do you have a stack trace?

> You can reproduce it also when running JQGrid example.
> Have a look in the Network response in the internet browser where you will
> see a 500 internal server error with "MessageNotUnderstood:
> GRPharoUtf8CodecStream>>object:
> Your request could not be completed. An exception occurred."
>
> or implement
>
> GRPharoUtf8CodecStream>>object: anObject
> self halt.
>
> In Pharo2, it was implemented like this:
> Dictionary>>jsonOn: aStream
>         JSJsonStream encodeDictionary: self on: aStream
That was Seaside 3.0. JSON support in Seaside 3.1 is "new". It's no
longer based on JavaScript (JSON isn't actually a JavaScript subset).
It now has a canvas much like the HTML and XML support. This allowed
us to fix many corner case bugs.

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev



If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/GRPharoUtf8CodecStream-does-not-understand-object-tp4738990p4739300.html
To start a new topic under Seaside Development, email [hidden email]
To unsubscribe from GRPharoUtf8CodecStream does not understand object:, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: GRPharoUtf8CodecStream does not understand object:

Philippe Marschall
On Sun, Jan 26, 2014 at 7:45 PM, Sabine Knöfel <[hidden email]> wrote:

> Hi Phillippe,
>
> how do I get a stack trace?
> "Fuel out Stack" in the Debugger?
>
> jsonOn: is sent in this context:
>
> JQGrid>>processSearchCallback
> |searchRequest searchResponse|
> searchRequest := JQGridSearchRequest parseFromWARequest: self requestContext
> request using: jqGridColumns.
> searchResponse := searchCallback value: searchRequest value: jqGridColumns.
> searchResponse jqGridColumns: jqGridColumns.
> self requestContext respond: [:response|
> response
> doNotCache;
> contentType: (WAMimeType applicationJson
> charset: self requestContext handler charSet).
> searchResponse jsonOn: response stream].

Can you try this:

JQGrid>>processSearchCallback
    | searchRequest searchResponse |
    searchRequest := JQGridSearchRequest parseFromWARequest: self
requestContext request using: jqGridColumns.
    searchResponse := searchCallback value: searchRequest value: jqGridColumns.
    searchResponse jqGridColumns: jqGridColumns.
    self requestContext respond: [ :response |
        response
            doNotCache;
            contentType: (WAMimeType applicationJson
                charset: self requestContext handler charSet).
        response stream json: searchResponse ]

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: GRPharoUtf8CodecStream does not understand object:

Sabine Manaa
Hi Phillipe,

thank you, this works. 
The JQGrid Example does work also with this.
I fixed it and added it to smalltalkhub. 

Sabine


On Sun, Jan 26, 2014 at 9:10 PM, Philippe Marschall [via Smalltalk] <[hidden email]> wrote:
On Sun, Jan 26, 2014 at 7:45 PM, Sabine Knöfel <[hidden email]> wrote:

> Hi Phillippe,
>
> how do I get a stack trace?
> "Fuel out Stack" in the Debugger?
>
> jsonOn: is sent in this context:
>
> JQGrid>>processSearchCallback
> |searchRequest searchResponse|
> searchRequest := JQGridSearchRequest parseFromWARequest: self requestContext
> request using: jqGridColumns.
> searchResponse := searchCallback value: searchRequest value: jqGridColumns.
> searchResponse jqGridColumns: jqGridColumns.
> self requestContext respond: [:response|
> response
> doNotCache;
> contentType: (WAMimeType applicationJson
> charset: self requestContext handler charSet).
> searchResponse jsonOn: response stream].
Can you try this:

JQGrid>>processSearchCallback
    | searchRequest searchResponse |
    searchRequest := JQGridSearchRequest parseFromWARequest: self
requestContext request using: jqGridColumns.
    searchResponse := searchCallback value: searchRequest value: jqGridColumns.
    searchResponse jqGridColumns: jqGridColumns.
    self requestContext respond: [ :response |
        response
            doNotCache;
            contentType: (WAMimeType applicationJson
                charset: self requestContext handler charSet).
        response stream json: searchResponse ]

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev



If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/GRPharoUtf8CodecStream-does-not-understand-object-tp4738990p4739488.html
To start a new topic under Seaside Development, email [hidden email]
To unsubscribe from GRPharoUtf8CodecStream does not understand object:, click here.
NAML