You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by doug777 <do...@gmail.com> on 2017/09/20 03:09:08 UTC

FlexJS RemoteObject Error with ColdFusion

Hi All,

Moonshine now working properly. The folks at Moonshine were fantastic,
instant response and quickly solved my problem.

The complete code for the project is at https://justpaste.it/1bgfa

The important bit is here 

<js:RemoteObject id="roSTime" destination="ColdFusion"
source="localhost:8500.booxotel.STime"
result="roCheckTestResultHandler(event)" fault="roFaultHandler(event)"/>

private function init():void{
	this.roSTime.send("getUTCDateTimeNow", []);
}

private function roCheckTestResultHandler(event:ResultEvent):void{
	Alert.show("Date received " + event.data, this);
}
			
private function roFaultHandler(event:FaultEvent):void{
	Alert.show("Fault " + event.message, this);
}

When run, it generates this error in the console window

destination fault handler Object { code: -1004, message: "Invalid response
type.", detail: "Invalid XMLHttpRequest response sta…", data: null } 
Language.js:238:7

Does that mean it's reached CF and got a response it didn't understand?

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
JIRA created.

I am only doing this in spare time for the moment, so time is not an issue.

Thanks for all your help,
Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

Can you zip up the MSTest folder and make it available somehow?  Feel free
to open a JIRA issue and attach the zip.  It looks like the output is
corrupted somehow.  What browser and OS are you using?

I may not have time to look until late Sunday (about 48 hours from now).

Thanks,
-Alex

On 9/22/17, 7:16 PM, "doug777" <do...@gmail.com> wrote:

>Stack trace is at 
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjustpaste
>.it%2F1bksx&data=02%7C01%7C%7C1f98e8a565c94348a12f08d502290ee5%7Cfa7b1b5a7
>b34438794aed2c178decee1%7C0%7C0%7C636417297754361139&sdata=lyRDX1cvQ6F9PdA
>c4gEUAraol3FNMc7WUOs5Qw6RaL8%3D&reserved=0
>
>With the same setup, Hello World without RemoteObject code runs with no
>issues.
>
>Doug
>
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C1f98e8a565c94348a12f08d
>502290ee5%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636417297754361139&
>sdata=zna3Ut4OWmEz%2FeAIZNuLzLLljQhpNLXY93dR1BfOwuE%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Stack trace is at https://justpaste.it/1bksx

With the same setup, Hello World without RemoteObject code runs with no
issues.

Doug




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I'm not sure what browser you are now using, but there should be a way to
start up the debugger, have it stop on unhandled or uncaught exceptions
and reload the page.  Then the debugger should stop on that line and some
other pane should show the stack trace.

Thanks
-Alex

On 9/22/17, 12:51 AM, "doug777" <do...@gmail.com> wrote:

>Unfortunately not. This is all I get in the console
>
>IBeadModel.js:38 Uncaught TypeError: Cannot read property
>'IEventDispatcher'
>of undefined
>    at IBeadModel.js:38
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7Cc72cf3407b374c2e348d08d
>5018ecee9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636416635228464819&
>sdata=mSw4vBHSkWQ%2Fql9YPofEOOk8XXY3kluRff0WRkqbPJM%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Unfortunately not. This is all I get in the console

IBeadModel.js:38 Uncaught TypeError: Cannot read property 'IEventDispatcher'
of undefined
    at IBeadModel.js:38

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I'm pretty sure FlexJS RemoteObject requires an endpoint.  The current
implementation doesn't know about Channels and ChannelSets and
services-config.xml.

Is there more to the stack trace you get when you have an endpoint?

Thanks,
-Alex

On 9/21/17, 11:43 PM, "doug777" <do...@gmail.com> wrote:

>Sorry, what I meant was that I had changed the current code to
>
><js:RemoteObject id="roSTime" destination="ColdFusion"
>source="booxotel.STime" result="roCheckTestResultHandler(event)"
>fault="roFaultHandler(event)"/>
>
>The source is definitely booxotel.STime
>
>But I removed endPoint because that totally stops it working. Hello World
>does not appear and the error is
>
>Uncaught TypeError: Cannot read property 'IEventDispatcher' of undefined
>at
>~core/IBeadModel.js:38:222
>
>I will carry on without endPoint and get the details for when RemoteObject
>is as above.
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7Cadb16ef1e8594f16128508d
>501854945%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636416594358975632&
>sdata=7RhHjo3pPLOJlSTXlb80klrYw61djZlGFv7LBMq0pp0%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Sorry, what I meant was that I had changed the current code to 

<js:RemoteObject id="roSTime" destination="ColdFusion"
source="booxotel.STime" result="roCheckTestResultHandler(event)"
fault="roFaultHandler(event)"/>

The source is definitely booxotel.STime

But I removed endPoint because that totally stops it working. Hello World
does not appear and the error is 

Uncaught TypeError: Cannot read property 'IEventDispatcher' of undefined at
~core/IBeadModel.js:38:222

I will carry on without endPoint and get the details for when RemoteObject
is as above.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

Earlier, you posted that your code looks like:

<js:RemoteObject id="roSTime" destination="ColdFusion"
source="localhost:8500.booxotel.STime"
endPoint="http://localhost:8500/booxotel/STime.cfc"
result="roCheckTestResultHandler(event)" fault="roFaultHandler(event)"/>


Comparing that to your mx:RemoteObject tag below, it might be worth
changing your source property to be:

    source="booxotel.STime"

Then, if you are still getting xhr.status == 200 but Content-Type is html
and the response is still null, it is time to see if the server saw a
request and is reporting any errors and try to diagnose the problem on the
server-side.

Also, by default, FlexJS should be producing a SWF in a bin-debug folder
and that can also be used to see if it behaves differently than the JS
version.  See if the compiler.targets (or just -targets) is set to both
SWF and JSFlex.

HTH,
-Alex



On 9/21/17, 7:56 PM, "doug777" <do...@gmail.com> wrote:

>AbstractMessage.js is in the output.
>
>When run, the debugger shows this at
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjustpaste
>.it%2F1bjah&data=02%7C01%7C%7C021b2e83ad3a4905d60008d501659406%7Cfa7b1b5a7
>b34438794aed2c178decee1%7C0%7C0%7C636416458139873206&sdata=Uy8EbwZjxapiIXJ
>R%2B58sHH2uASCuwbVNlENvHEGDw6Q%3D&reserved=0
>
>No real error but there is no result from CF.
>
>There is no SWF output.
>
><mx:RemoteObject id="roSTime" destination="ColdFusion"
>source="booxotel.STime" result="roCheckTestResultHandler(event)"
>fault="roFaultHandler(event)"/>
>
>Now I have just changed mx to js.
>
>Doug
>
>
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C021b2e83ad3a4905d60008d
>501659406%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636416458139873206&
>sdata=dzX44WSTsdnYZflWS95saekZGFRdC%2BXi8t3sZ0a%2FVQM%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
AbstractMessage.js is in the output.

When run, the debugger shows this at https://justpaste.it/1bjah

No real error but there is no result from CF.

There is no SWF output.

<mx:RemoteObject id="roSTime" destination="ColdFusion"
source="booxotel.STime" result="roCheckTestResultHandler(event)"
fault="roFaultHandler(event)"/>

Now I have just changed mx to js.

Doug





--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

I think it will be more efficient to debug the bin/js-debug version before
trying to debug the js-release version.  First check that
AbstractMessage.js is in the bin/js-debug output from Moonshine, then copy
the entire js-debug folder to the server and try to run it.

If you are also getting SWF output, you can try to run the SWF version as
well.  That might help determine if the problem is in the JS
implementation of NetConnection or not.

We will probably look into refactoring RemoteObject to look a bit more
like the regular Flex version, but for a single method/operation the
available parameters should be the same, but I'm not an expert in
RemoteObject internals.  It is more likely there is a bug somewhere.  This
is pretty new code.  What did your regular mx:RemoteObject look like?

Thanks,
-Alex

On 9/21/17, 6:42 PM, "doug777" <do...@gmail.com> wrote:

>Hi Alex,
>
>Yes you're right of course. In fact I think js:RemoteObject should be
>written exactly as it is in mx:RemoteObject.
>
>What I'm doing wrong I think, is to try to build and run from Moonshine. I
>think I should just build it in the IDE then take the release output
>upload
>it to the server and then run it from the browser.
>
>When I do that I get this error.
>
>[Exception... "Failed to open input source
>'file:///C:/ColdFusion11/cfusion/wwwroot/booxotel/MSTest/C:/My%20Documents
>/Moonshine/Test/bin/js-debug/org/apache/flex/net/remoting/messages/Abstrac
>tMessage.js'"
>etc.
>
>The actual javascript being run contains this
>
>Object.defineProperties(vj.prototype,{roSTime:{get:F('We'),set:function(a)
>{a!=this.We&&(this.We=a,this.dispatchEvent(bj(this,'roSTime',null,a)))}},l
>bl:{get:F('Je'),set:function(a){a!=this.Je&&(this.Je=a,this.dispatchEvent(
>bj(this,'lbl',null,a)))}},MXMLDescriptor:{get:function(){if(void
>0==this.Ab){var
>a=vj.m.X.apply(this),b=[Hi,3,'id',!0,'roSTime','destination',!0,'ColdFusio
>n','source',!0,'booxotel.STime',0,2,'result',this.ge,'fault',this.he,null]
>;this.Ab=a?a.concat(b):b}return
>this.Ab}}});
>
>So looks like the problem is the path setting in Moonshine.
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7Cbd6360651adc463d6f2008d
>5015b3b8b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636416413715660667&
>sdata=5U37oaN8K0L60IWW4yIftPKhb%2F5j%2FWQTfdPbTzt%2BdVM%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Hi Alex,

Yes you're right of course. In fact I think js:RemoteObject should be
written exactly as it is in mx:RemoteObject.

What I'm doing wrong I think, is to try to build and run from Moonshine. I
think I should just build it in the IDE then take the release output upload
it to the server and then run it from the browser.

When I do that I get this error.

[Exception... "Failed to open input source
'file:///C:/ColdFusion11/cfusion/wwwroot/booxotel/MSTest/C:/My%20Documents/Moonshine/Test/bin/js-debug/org/apache/flex/net/remoting/messages/AbstractMessage.js'"
etc.

The actual javascript being run contains this

Object.defineProperties(vj.prototype,{roSTime:{get:F('We'),set:function(a){a!=this.We&&(this.We=a,this.dispatchEvent(bj(this,'roSTime',null,a)))}},lbl:{get:F('Je'),set:function(a){a!=this.Je&&(this.Je=a,this.dispatchEvent(bj(this,'lbl',null,a)))}},MXMLDescriptor:{get:function(){if(void
0==this.Ab){var
a=vj.m.X.apply(this),b=[Hi,3,'id',!0,'roSTime','destination',!0,'ColdFusion','source',!0,'booxotel.STime',0,2,'result',this.ge,'fault',this.he,null];this.Ab=a?a.concat(b):b}return
this.Ab}}});

So looks like the problem is the path setting in Moonshine.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Interesting.  I don't think that is expected in AMF.  And I noticed that
xhr.response is null.  That makes me think that the ColdFusion returned
null instead of an AMF packet.  Can you diagnose things on the server
side?  Maybe the request isn't formed correctly.  Are you sure you have
your "source" property set correctly?  You might also be able to sniff
packets and compare what regular Flex sends vs FlexJS.

HTH,
-Alex

On 9/20/17, 7:12 PM, "doug777" <do...@gmail.com> wrote:

>Hi Alex,
>
>Yes that works. The result is
>
>"text/html;charset=UTF-8"
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C4ddf350b9e5f41185c4308d
>500964881%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636415567823244006&
>sdata=WHTudSnLc43fggGPSO1zNDIyFN6X48MSAl8kBJDfcDA%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Hi Alex,

Yes that works. The result is

"text/html;charset=UTF-8"

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Harbs <ha...@gmail.com>.
No idea. I have not looked into RemoteObject at all.

Someone more familiar with it will have to comment.

Harbs
> On Sep 20, 2017, at 12:11 PM, Piotr Zarzycki <pi...@gmail.com> wrote:
> 
> Harbs, Alex,
> 
> Is it possible that there is some messed up cause of this inject_html in
> RemoteObject ? [1] I remember that Alex said it is no needed anymore.
> 
> [1]
> https://github.com/apache/flex-asjs/blob/develop/frameworks/projects/Network/src/main/flex/org/apache/flex/net/RemoteObject.as
> 
> Thanks,
> Piotr
> 
> 
> 2017-09-20 11:04 GMT+02:00 doug777 <do...@gmail.com>:
> 
>> Still no luck. Now it returns this
>> 
>> this.xhr.getResponseHeader("Content-type”)
>> 
>> VM833:1 Uncaught SyntaxError: Invalid or unexpected token
>>    at org.apache.flex.net.remoting.amf.AMFNetConnection.
>> onReadyStateChange
>> (AMFNetConnection.js:136)
>>    at org.apache.flex.net.remoting.amf.AMFNetConnection.call
>> (AMFNetConnection.js:108)
>>    at org.apache.flex.net.remoting.Operation.send (Operation.js:67)
>>    at org.apache.flex.net.RemoteObject.send (RemoteObject.js:84)
>>    at Test.init (Test.js:182)
>>    at Test.$EH0 (Test.js:210)
>>    at Test.goog.events.EventTarget.fireListeners (eventtarget.js:284)
>>    at Function.goog.events.EventTarget.dispatchEventInternal_
>> (eventtarget.js:381)
>>    at Test.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
>>    at Test.org.apache.flex.events.EventDispatcher.dispatchEvent
>> (EventDispatcher.js:71)
>> org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
>> AMFNetConnection.js:136
>> org.apache.flex.net.remoting.amf.AMFNetConnection.call @
>> AMFNetConnection.js:108
>> org.apache.flex.net.remoting.Operation.send @ Operation.js:67
>> org.apache.flex.net.RemoteObject.send @ RemoteObject.js:84
>> Test.init @ Test.js:182
>> Test.$EH0 @ Test.js:210
>> goog.events.EventTarget.fireListeners @ eventtarget.js:284
>> goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
>> goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
>> org.apache.flex.events.EventDispatcher.dispatchEvent @
>> EventDispatcher.js:71
>> org.apache.flex.core.HTMLElementWrapper.dispatchEvent @
>> HTMLElementWrapper.js:240
>> org.apache.flex.core.Application.initialize @ Application.js:273
>> org.apache.flex.core.Application.start @ Application.js:246
>> (anonymous) @ index.html:241
>> 
>> 
>> 
>> --
>> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>> 
> 
> 
> 
> -- 
> 
> Piotr Zarzycki
> 
> mobile: +48 880 859 557
> skype: zarzycki10
> 
> LinkedIn: http://www.linkedin.com/piotrzarzycki
> <https://pl.linkedin.com/in/piotr-zarzycki-92a53552>


Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
@Doug,

I just saw a StackOverflow topic where someone was getting that error
because they cut and pasted the text instead of typing it and there was a
hidden character in what they cut.  If you haven't, please try typing it
in manually.

If you still can't get it to work, another option is to modify the .JS
file.  I'm assuming you are using the version in bin/js-debug and not the
bin/js-release version.  You can modify AMFNetConnection.js to store
this.xhr.getResponseHeader(...) in a local variable, print the value to
console.log() and so on.

@Piotr,

Yes, it is a possibility, but I doubt it.  The code we are running is
tucked inside org.apache.flex.

HTH,
-Alex

On 9/20/17, 2:11 AM, "Piotr Zarzycki" <pi...@gmail.com> wrote:

>Harbs, Alex,
>
>Is it possible that there is some messed up cause of this inject_html in
>RemoteObject ? [1] I remember that Alex said it is no needed anymore.
>
>[1]
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Fflex-asjs%2Fblob%2Fdevelop%2Fframeworks%2Fprojects%2FNetwork%
>2Fsrc%2Fmain%2Fflex%2Forg%2Fapache%2Fflex%2Fnet%2FRemoteObject.as&data=02%
>7C01%7C%7C1b4e9b240e724783195a08d5000786d2%7Cfa7b1b5a7b34438794aed2c178dec
>ee1%7C0%7C0%7C636414954679192312&sdata=io6qhAtYixBLHuzGueaMtjtI4W0NtHWR9cy
>krGqYf%2Bs%3D&reserved=0
>
>Thanks,
>Piotr
>
>
>2017-09-20 11:04 GMT+02:00 doug777 <do...@gmail.com>:
>
>> Still no luck. Now it returns this
>>
>> this.xhr.getResponseHeader("Content-type”)
>>
>> VM833:1 Uncaught SyntaxError: Invalid or unexpected token
>>     at org.apache.flex.net.remoting.amf.AMFNetConnection.
>> onReadyStateChange
>> (AMFNetConnection.js:136)
>>     at org.apache.flex.net.remoting.amf.AMFNetConnection.call
>> (AMFNetConnection.js:108)
>>     at org.apache.flex.net.remoting.Operation.send (Operation.js:67)
>>     at org.apache.flex.net.RemoteObject.send (RemoteObject.js:84)
>>     at Test.init (Test.js:182)
>>     at Test.$EH0 (Test.js:210)
>>     at Test.goog.events.EventTarget.fireListeners (eventtarget.js:284)
>>     at Function.goog.events.EventTarget.dispatchEventInternal_
>> (eventtarget.js:381)
>>     at Test.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
>>     at Test.org.apache.flex.events.EventDispatcher.dispatchEvent
>> (EventDispatcher.js:71)
>> org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
>> AMFNetConnection.js:136
>> org.apache.flex.net.remoting.amf.AMFNetConnection.call @
>> AMFNetConnection.js:108
>> org.apache.flex.net.remoting.Operation.send @ Operation.js:67
>> org.apache.flex.net.RemoteObject.send @ RemoteObject.js:84
>> Test.init @ Test.js:182
>> Test.$EH0 @ Test.js:210
>> goog.events.EventTarget.fireListeners @ eventtarget.js:284
>> goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
>> goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
>> org.apache.flex.events.EventDispatcher.dispatchEvent @
>> EventDispatcher.js:71
>> org.apache.flex.core.HTMLElementWrapper.dispatchEvent @
>> HTMLElementWrapper.js:240
>> org.apache.flex.core.Application.initialize @ Application.js:273
>> org.apache.flex.core.Application.start @ Application.js:246
>> (anonymous) @ index.html:241
>>
>>
>>
>> --
>> Sent from: 
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>>ex-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C1b4e9b240e724783195a0
>>8d5000786d2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364149546791923
>>12&sdata=4M5wha0rIEQo3ooRce8b4qDhGeCCzNPWH0mDbgr83l0%3D&reserved=0
>>
>
>
>
>-- 
>
>Piotr Zarzycki
>
>mobile: +48 880 859 557
>skype: zarzycki10
>
>LinkedIn: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linked
>in.com%2Fpiotrzarzycki&data=02%7C01%7C%7C1b4e9b240e724783195a08d5000786d2%
>7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414954679192312&sdata=m%2B
>TIQB5d1nM7AOpLaXYPSRNrZTRuJUMaDMdgRmQJnDw%3D&reserved=0
><https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpl.linke
>din.com%2Fin%2Fpiotr-zarzycki-92a53552&data=02%7C01%7C%7C1b4e9b240e7247831
>95a08d5000786d2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6364149546792
>02317&sdata=SMjXEpuqMOZU%2BP38eA%2FNDhimWrnZ055Uxq2%2BDH8wX%2F4%3D&reserve
>d=0>


Re: FlexJS RemoteObject Error with ColdFusion

Posted by Piotr Zarzycki <pi...@gmail.com>.
Harbs, Alex,

Is it possible that there is some messed up cause of this inject_html in
RemoteObject ? [1] I remember that Alex said it is no needed anymore.

[1]
https://github.com/apache/flex-asjs/blob/develop/frameworks/projects/Network/src/main/flex/org/apache/flex/net/RemoteObject.as

Thanks,
Piotr


2017-09-20 11:04 GMT+02:00 doug777 <do...@gmail.com>:

> Still no luck. Now it returns this
>
> this.xhr.getResponseHeader("Content-type”)
>
> VM833:1 Uncaught SyntaxError: Invalid or unexpected token
>     at org.apache.flex.net.remoting.amf.AMFNetConnection.
> onReadyStateChange
> (AMFNetConnection.js:136)
>     at org.apache.flex.net.remoting.amf.AMFNetConnection.call
> (AMFNetConnection.js:108)
>     at org.apache.flex.net.remoting.Operation.send (Operation.js:67)
>     at org.apache.flex.net.RemoteObject.send (RemoteObject.js:84)
>     at Test.init (Test.js:182)
>     at Test.$EH0 (Test.js:210)
>     at Test.goog.events.EventTarget.fireListeners (eventtarget.js:284)
>     at Function.goog.events.EventTarget.dispatchEventInternal_
> (eventtarget.js:381)
>     at Test.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
>     at Test.org.apache.flex.events.EventDispatcher.dispatchEvent
> (EventDispatcher.js:71)
> org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
> AMFNetConnection.js:136
> org.apache.flex.net.remoting.amf.AMFNetConnection.call @
> AMFNetConnection.js:108
> org.apache.flex.net.remoting.Operation.send @ Operation.js:67
> org.apache.flex.net.RemoteObject.send @ RemoteObject.js:84
> Test.init @ Test.js:182
> Test.$EH0 @ Test.js:210
> goog.events.EventTarget.fireListeners @ eventtarget.js:284
> goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
> goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
> org.apache.flex.events.EventDispatcher.dispatchEvent @
> EventDispatcher.js:71
> org.apache.flex.core.HTMLElementWrapper.dispatchEvent @
> HTMLElementWrapper.js:240
> org.apache.flex.core.Application.initialize @ Application.js:273
> org.apache.flex.core.Application.start @ Application.js:246
> (anonymous) @ index.html:241
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>



-- 

Piotr Zarzycki

mobile: +48 880 859 557
skype: zarzycki10

LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>

Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Still no luck. Now it returns this

this.xhr.getResponseHeader("Content-type”)

VM833:1 Uncaught SyntaxError: Invalid or unexpected token
    at org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
(AMFNetConnection.js:136)
    at org.apache.flex.net.remoting.amf.AMFNetConnection.call
(AMFNetConnection.js:108)
    at org.apache.flex.net.remoting.Operation.send (Operation.js:67)
    at org.apache.flex.net.RemoteObject.send (RemoteObject.js:84)
    at Test.init (Test.js:182)
    at Test.$EH0 (Test.js:210)
    at Test.goog.events.EventTarget.fireListeners (eventtarget.js:284)
    at Function.goog.events.EventTarget.dispatchEventInternal_
(eventtarget.js:381)
    at Test.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
    at Test.org.apache.flex.events.EventDispatcher.dispatchEvent
(EventDispatcher.js:71)
org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
AMFNetConnection.js:136
org.apache.flex.net.remoting.amf.AMFNetConnection.call @
AMFNetConnection.js:108
org.apache.flex.net.remoting.Operation.send @ Operation.js:67
org.apache.flex.net.RemoteObject.send @ RemoteObject.js:84
Test.init @ Test.js:182
Test.$EH0 @ Test.js:210
goog.events.EventTarget.fireListeners @ eventtarget.js:284
goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
org.apache.flex.events.EventDispatcher.dispatchEvent @ EventDispatcher.js:71
org.apache.flex.core.HTMLElementWrapper.dispatchEvent @
HTMLElementWrapper.js:240
org.apache.flex.core.Application.initialize @ Application.js:273
org.apache.flex.core.Application.start @ Application.js:246
(anonymous) @ index.html:241



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Harbs <ha...@gmail.com>.
Whoops.

The method is called getResponseHeader()
Try: this.xhr.getResponseHeader("Content-type”)

Harbs

> On Sep 20, 2017, at 11:49 AM, doug777 <do...@gmail.com> wrote:
> 
> Guess I should have typed this but still weird result
> 
> this.xhr.getResponseType("Content-type")
> 
> VM647:1 Uncaught TypeError: this.xhr.getResponseType is not a function
>    at eval (eval at
> org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
> (AMFNetConnection.js:137), <anonymous>:1:10)
>    at org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
> (AMFNetConnection.js:137)
> (anonymous) @ VM647:1
> org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
> AMFNetConnection.js:137
> XMLHttpRequest.send (async)
> org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
> AMFNetConnection.js:136
> org.apache.flex.net.remoting.amf.AMFNetConnection.call @
> AMFNetConnection.js:108
> org.apache.flex.net.remoting.Operation.send @ Operation.js:67
> org.apache.flex.net.RemoteObject.send @ RemoteObject.js:84
> Test.init @ Test.js:182
> Test.$EH0 @ Test.js:210
> goog.events.EventTarget.fireListeners @ eventtarget.js:284
> goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
> goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
> org.apache.flex.events.EventDispatcher.dispatchEvent @ EventDispatcher.js:71
> org.apache.flex.core.HTMLElementWrapper.dispatchEvent @
> HTMLElementWrapper.js:240
> org.apache.flex.core.Application.initialize @ Application.js:273
> org.apache.flex.core.Application.start @ Application.js:246
> (anonymous) @ index.html:241
> 
> 
> 
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Guess I should have typed this but still weird result

this.xhr.getResponseType("Content-type")

VM647:1 Uncaught TypeError: this.xhr.getResponseType is not a function
    at eval (eval at
org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
(AMFNetConnection.js:137), <anonymous>:1:10)
    at org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
(AMFNetConnection.js:137)
(anonymous) @ VM647:1
org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
AMFNetConnection.js:137
XMLHttpRequest.send (async)
org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange @
AMFNetConnection.js:136
org.apache.flex.net.remoting.amf.AMFNetConnection.call @
AMFNetConnection.js:108
org.apache.flex.net.remoting.Operation.send @ Operation.js:67
org.apache.flex.net.RemoteObject.send @ RemoteObject.js:84
Test.init @ Test.js:182
Test.$EH0 @ Test.js:210
goog.events.EventTarget.fireListeners @ eventtarget.js:284
goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
org.apache.flex.events.EventDispatcher.dispatchEvent @ EventDispatcher.js:71
org.apache.flex.core.HTMLElementWrapper.dispatchEvent @
HTMLElementWrapper.js:240
org.apache.flex.core.Application.initialize @ Application.js:273
org.apache.flex.core.Application.start @ Application.js:246
(anonymous) @ index.html:241



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Yes the second option fixed it.

So now with the Chrome browser paused at line 137 "else if (readyState ===
4) {" 

I can type in the console 

xhr.getResponseType("Content-type")

and I get this strange response.

VM624:1 Uncaught ReferenceError: xhr is not defined
    at eval (eval at
org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
(AMFNetConnection.js:136), <anonymous>:1:1)
    at org.apache.flex.net.remoting.amf.AMFNetConnection.onReadyStateChange
(AMFNetConnection.js:136)
    at org.apache.flex.net.remoting.amf.AMFNetConnection.call
(AMFNetConnection.js:108)
    at org.apache.flex.net.remoting.Operation.send (Operation.js:67)
    at org.apache.flex.net.RemoteObject.send (RemoteObject.js:84)
    at Test.init (Test.js:182)
    at Test.$EH0 (Test.js:210)
    at Test.goog.events.EventTarget.fireListeners (eventtarget.js:284)
    at Function.goog.events.EventTarget.dispatchEventInternal_
(eventtarget.js:381)
    at Test.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)

So I guess I've done something wrong.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Harbs <ha...@gmail.com>.
FWIW, Chrome is my default dev browser.

Did you try these?

https://www.thepolyglotdeveloper.com/2014/08/bypass-cors-errors-testing-apis-locally/ <https://www.thepolyglotdeveloper.com/2014/08/bypass-cors-errors-testing-apis-locally/>
https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en <https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en>

Harbs
> On Sep 20, 2017, at 11:10 AM, doug777 <do...@gmail.com> wrote:
> 
> Can't find any way to do this in Firefox, though I did find this in
> StackOverflow
> 
> Currently there is no way to show the values of getters within the Firefox
> DevTools, but it is already filed as bug 820878.
> 
> Tried to use Chrome, but this cannot load from localhost because no
> Access-Control-Allow-Origin same as Firefox had. I never use Chrome so no
> idea how to fix this in Chrome.
> 
> Doug
> 
> 
> 
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Can't find any way to do this in Firefox, though I did find this in
StackOverflow

Currently there is no way to show the values of getters within the Firefox
DevTools, but it is already filed as bug 820878.

Tried to use Chrome, but this cannot load from localhost because no
Access-Control-Allow-Origin same as Firefox had. I never use Chrome so no
idea how to fix this in Chrome.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Harbs <ha...@gmail.com>.
In the console while you are paused where you show, run this:
xhr.getResponseType("Content-type”)

Harbs

> On Sep 20, 2017, at 8:36 AM, doug777 <do...@gmail.com> wrote:
> 
> I can't find xhr.getResponseType - any clue as to where it will be shown?
> 
> 
> 
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/


Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
It is a function, not a property.  I think in the console when you are
stopped in the debugger, you can type:

   xhr.getResponseHeader("Content-type")


And it should spit out what we want to see.

HTH,
-Alex

On 9/19/17, 10:36 PM, "doug777" <do...@gmail.com> wrote:

>I can't find xhr.getResponseType - any clue as to where it will be shown?
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C7dc0527d18554fb3476808d
>4ffe9972b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414826103871989&
>sdata=oCgdSa7K8FFIghHiPXeNnBZtK%2FcWqRRJL2ziRUIOYG8%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
I can't find xhr.getResponseType - any clue as to where it will be shown?



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

So it looks like responseType is correctly "arrayBuffer", but I can't see
how to determine from your link what the result for
xhr.getResponseType("Content-type") was.

It must be something other than "application/x-amf"

-Alex

On 9/19/17, 9:51 PM, "doug777" <do...@gmail.com> wrote:

><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>ex-users.2333346.n4.nabble.com%2Ffile%2Ft784%2FAMFNetConn_error.png&data=0
>2%7C01%7C%7C295ea0a811b844c543f208d4ffe348f8%7Cfa7b1b5a7b34438794aed2c178d
>ecee1%7C0%7C0%7C636414799025954885&sdata=TS7tYsJXZlhufayPVbqQOrOv%2FUSNn%2
>BkpaE%2Fr%2B5wDAE4%3D&reserved=0>
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C295ea0a811b844c543f208d
>4ffe348f8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414799025954885&
>sdata=nH3eRH17PA1fdn%2BvzGq2Tn2aLTQk4JUZLua5HJ%2BbD3w%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
<http://apache-flex-users.2333346.n4.nabble.com/file/t784/AMFNetConn_error.png> 



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
OK, that's good to know.  That code also checks:

   xhr.responseType == "arraybuffer"

and

   xhr.getResponseHeader("Content-type").indexOf("application/x-amf") >
-1) 

What are you getting for those values?


-Alex

On 9/19/17, 9:37 PM, "doug777" <do...@gmail.com> wrote:

>xhr.status is 200.
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C6b048c1bb9af41741b8d08d
>4ffe15f9d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414790815650365&
>sdata=CugPDFWH3P6YmyrRuRFm2huVzbOnw5wgXiFrdW3GpRs%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
xhr.status is 200.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

Looks like we could use better error reporting in that code.  Please try
setting a breakpoint in AMFNetConnection.js where it sees that readyState
=== 4 and see what the xhr.status is.  It appears that you are not getting
a 200 status code.

I don't think this code currently handles redirects.

Thanks,
-Alex

On 9/19/17, 9:08 PM, "doug777" <do...@gmail.com> wrote:

>OK fixed the browser issue.
>
>Now 
>
><js:RemoteObject id="roSTime" destination="ColdFusion"
>source="localhost:8500.booxotel.STime"
>endPoint="http://localhost:8500/booxotel/STime.cfc"
>result="roCheckTestResultHandler(event)" fault="roFaultHandler(event)"/>
>
>result
>
>destination fault handler Object { code: -1005, message: "Invalid
>response.", detail: "", data: null }  Language.js:238:7
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7Cb7fd9c10c848497d460408d
>4ffde3310%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414777182137349&
>sdata=f65FFd0nk9WA0wcsTQane9RqmB7yyN4acrInu7WGvFM%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
OK fixed the browser issue.

Now 

<js:RemoteObject id="roSTime" destination="ColdFusion"
source="localhost:8500.booxotel.STime"
endPoint="http://localhost:8500/booxotel/STime.cfc"
result="roCheckTestResultHandler(event)" fault="roFaultHandler(event)"/>

result

destination fault handler Object { code: -1005, message: "Invalid
response.", detail: "", data: null }  Language.js:238:7

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

What browser are you using?  And what is the URL for the app in the
browser?  Is it file:// or https:// or http://?

IIRC, some browsers may be more picky about file:// accessing
http://localhost.

-Alex

On 9/19/17, 8:41 PM, "doug777" <do...@gmail.com> wrote:

>Hi Alex,
>
>New error
>
>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
>remote resource at http://localhost:8500/booxotel/STime. (Reason: CORS
>header ‘Access-Control-Allow-Origin’ missing).  (unknown)
>destination fault handler Object { code: -1004, message: "Invalid response
>type.", detail: "Invalid XMLHttpRequest response sta…", data: null }
>Language.js:238:7
>
>This is all on my local computer with no network involved, so I'm not
>quite
>sure what Cross-Origin means.
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C41a7a46589534ba6edc508d
>4ffd96f42%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414756727326086&
>sdata=Nlz9mYKmB5TYdNNKTSZBE%2Fg%2FVfXxMeE3U5lzzOxuhoo%3D&reserved=0


Re: FlexJS RemoteObject Error with ColdFusion

Posted by doug777 <do...@gmail.com>.
Hi Alex,

New error

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at http://localhost:8500/booxotel/STime. (Reason: CORS
header ‘Access-Control-Allow-Origin’ missing).  (unknown)
destination fault handler Object { code: -1004, message: "Invalid response
type.", detail: "Invalid XMLHttpRequest response sta…", data: null } 
Language.js:238:7

This is all on my local computer with no network involved, so I'm not quite
sure what Cross-Origin means.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: FlexJS RemoteObject Error with ColdFusion

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Doug,

1004 appears to be when XHR returns something unexpected like status == 0
or responseType == "text".

I think you need to set the RemoteObject endpoint to the be URL to hit.
The RemoteObject source is passed as part of the message packet to the
server and is not parsed to find the URL for the request.

HTH,
-Alex

On 9/19/17, 8:09 PM, "doug777" <do...@gmail.com> wrote:

>Hi All,
>
>Moonshine now working properly. The folks at Moonshine were fantastic,
>instant response and quickly solved my problem.
>
>The complete code for the project is at
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjustpaste
>.it%2F1bgfa&data=02%7C01%7C%7C064b7118afdb499aa75008d4ffd4f820%7Cfa7b1b5a7
>b34438794aed2c178decee1%7C0%7C0%7C636414737542717073&sdata=Ox%2BjR7Ya7DE25
>CZ2qJAMU%2FA6b2BEwGxfVhULSKHsDFM%3D&reserved=0
>
>The important bit is here
>
><js:RemoteObject id="roSTime" destination="ColdFusion"
>source="localhost:8500.booxotel.STime"
>result="roCheckTestResultHandler(event)" fault="roFaultHandler(event)"/>
>
>private function init():void{
>	this.roSTime.send("getUTCDateTimeNow", []);
>}
>
>private function roCheckTestResultHandler(event:ResultEvent):void{
>	Alert.show("Date received " + event.data, this);
>}
>			
>private function roFaultHandler(event:FaultEvent):void{
>	Alert.show("Fault " + event.message, this);
>}
>
>When run, it generates this error in the console window
>
>destination fault handler Object { code: -1004, message: "Invalid response
>type.", detail: "Invalid XMLHttpRequest response sta…", data: null }
>Language.js:238:7
>
>Does that mean it's reached CF and got a response it didn't understand?
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-users.2333346.n4.nabble.com%2F&data=02%7C01%7C%7C064b7118afdb499aa75008d
>4ffd4f820%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636414737542717073&
>sdata=eK0nhnNAujNKvxJbnVARKVZ9SZ5BJcaX7Iiw4boiqws%3D&reserved=0