RE: [flexcoders] [ds-console] help / pointers needed...
Hi Fotis, The name value is based on the web app name as defined in your web.xml: web-app display-nameMy App/display-name ... Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Fotis Chatzinikos Sent: Wednesday, February 04, 2009 6:41 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] [ds-console] help / pointers needed... I found out that my custom application appears automatically in the monitoring example - just without a name, I can select it at the top At the Application drop down as : Object object On Wed, Feb 4, 2009 at 4:00 PM, fotis.chatzinikos fotis.chatzini...@gmail.com wrote: Hello, Does any of you use ds-console to monitor your in development RIAs? I tried to use it but it does not seem to pick up my custom/new application. * In server management, all throughput values are 0 * In generic administration view, i can only see 3 root beans :runtime, BlazeDS and samples How do i configure it to monitor my own app? Any ideas, pointers, tutorials, references would be more than welcome... TIA, Fotis
RE: [flexcoders] RemoteObject dynamic destination?
When you run into an issue with MXML bindings your best bet to troubleshoot is to set the keep-generated flag for the compiler to true. When you assign to the 'destination' property using a binding, after compiling we see the following code in the {MainApp}-generated.as for that RemoteObject instance: var temp : mx.rpc.remoting.mxml.RemoteObject = new mx.rpc.remoting.mxml.RemoteObject(); remoteObject = temp; temp.destination = null; ... The generated assignment of null to the 'destination' property is triggering the RTE, and this runs before the binding to your 'servicesDestination' var is evaluated. So, for now you'll need to avoid using a binding to assign this property and just do it in code directly from your app's creationComplete handler or something. I've logged an enhancement request for this: https://bugs.adobe.com/jira/browse/SDK-19102 Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of maunger Sent: Tuesday, February 03, 2009 10:29 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] RemoteObject dynamic destination? I'm trying to save myself a few minutes and my brain... may be a waste of effort but I'm hoping someone can help. My local test environment is not SSL - our dev and production environments are. We have the services-config and remote configs set up properly no problem... everything works. Except, when testing locally, we put mx:RemoteObject id=RemoteUserService destination=ColdFusion showBusyCursor=true source=mbfnetperf.remote.RemoteUserService and when pushing out to dev/production, we have to change to: mx:RemoteObject id=RemoteUserService destination=SecureColdFusion showBusyCursor=true source=mbfnetperf.remote.RemoteUserService so i thought i could simply do: destination={servicesDestination} debug shows a valid value of ColdFusion in the variable servicesDestination but the call fails [MessagingError message=''null' is not a valid destination.'] I don't want to recode all of the MXML calls to AS (it probably wouldn't take forever) but i was just wondering if there's a simple answer instead of rewriting Thanks for any ideas - haven't found a solution in the archives
RE: [flexcoders] filtering blazeds messages
Change you selector value to: consumer.selector = reportID = + reportID; If you run into similar problems with Consumers that define selector expressions in the future, you can add the Message.Selector category to your server-side logging filters. If a client's selector can't be evaluated successfully, a warning is written to the server log containing the selector and the message that was evaluated against it. Selector evaluation is based on a javacc grammar and generated parser which unfortunately doesn't provide great error messaging, but a bit of trial and error should get you rolling. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of netdeep Sent: Wednesday, January 21, 2009 8:01 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] filtering blazeds messages I have blazeds working on a channel I have set up, but how do you filter out the information you broadcast on that channel? If I want to send data to one instance of my application, but no another, how do I determine that. Here is how I set up the message in java and flex. I have tried setting the consumer.selector as it says to in the documentation, but that doesn't seem to do anything, at least not the way I'm doing it. Here is the code: !-- flex code -- mx:Consumer id=consumer destination=factory message=msgHandler(event.message)/ !-- actionscript snippet consumer.selector = reportID = '+reportID+'; consumer.subscribe(); -- // java code message = new AsyncMessage(); message.setDestination(factory); // the channel I've set up message.setClientId(clientID); message.setMessageId(UUIDUtils.createUUID()); message.setTimestamp(System.currentTimeMillis()); message.setHeader(reportID, this.getRepID()); message.setBody(channelDef); // my object service.pushMessageToClients(message, false);
RE: [flexcoders] Server Side Cache and AMF
Flash Player and AIR send AMF requests in the body of HTTP POST requests. The POST method (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - section 9.5) is technically not cacheable by HTTP components (proxies, browsers, etc.) unless the AMF endpoint explicitly enables this by setting necessary HTTP response headers to allow caching. I think in general, AMF endpoints do the opposite and set response headers to explicitly disallow caching to deal with old buggy proxies that cache things they shouldn't. Because your Flex app is running in a stateful client, the need for caching along the network path is reduced. Your app can hang onto data from the server as long as you think is prudent, and it can fetch more or refresh existing data as needed. Traditional web apps on the other hand often end up triggering many duplicate requests as the user navigates forward and back through pages, so caching along the network path is essential to protect your servers from inadvertent DoS attacks :) Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Mike Oliver Sent: Sunday, January 11, 2009 4:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Server Side Cache and AMF What are the pros and cons to using a serverside cache or proxy cache with Flex and AMF? I can see a cache on a web service that is primarily a lookup service, but don't see much if any benefit to a cache related to transactions, and for lookup, except for really large data sets I think a client side actionscript object will be every bit as effective, and for really large data sets you don't want to fetch more than you need anyway so a cache won't do much there either. I think server side cache is best for pages of information like HTML pages, XML documents, JSP pages where the content is keyed in the cache by the URL for the GET, and anything else is a waste of effort or worse due to stale data in the cache. But what do I know? If I knew everything I wouldn't ask.
RE: [flexcoders] Re: BlazeDS - Best practice for determining if server session is invalid.
The creds passed to ChannelSet.login() are cached in client memory in Base64 encoded format and are cleared by a ChannelSet.logout() call. This allows channel hunting/fallback to be seemless at initial connect time as well as during reconnect following a temporary network failure or the remote clustered server that you're currently connected to failing. There are legacy setCredentials() and logout() methods on RemoteObject, etc. but those should be avoided because authentication is actually scoped to your connection to the server (in the case of an HTTP server session, the scope is the entire browser process - including all tabs/windows/etc.), not to a specific RemoteObject instance. Remember to always use a secure channel+endpoint when your client is authenticating to the server, to keep the encoded creds safe over the network. To dodge the timeout entirely, issuing a no-op request from the client to the server on a Timer interval shorter than your server session timeout will keep the server session alive and logged in. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rydellfinn Sent: Tuesday, January 06, 2009 2:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: BlazeDS - Best practice for determining if server session is invalid. Seth - Thanks for the detail - I just noticed your answer on this one over break. Setting login-after-disconnect to true does sound appealing. I'm was curious, where are the credentials stored to allow the reconnection? In the server session or on the client? Also - I did successfully get the Client.Authentication error when I hit a service after the session timed out. That helps. I was interested in catching the timeout before it occurs so I can warn the user before the timeout occurs. To implement this, I was thinking of setting a client-side timer that would pop up a warning message on an interval that is smaller than the server timeout length. Is there a better way? Thanks again for your help!
RE: [flexcoders] Is it possible to have the swf and LCDS app on different servers?
I have a flex client from which I would like to make RemoteObject calls through LCDS to a J2EE server. Not possible. LCDS remoting destinations invoke methods on local Java classes. These Java classes that you've exposed as remoting destinations could always make remote calls to other resources on other servers (i.e. RMI, JINI, etc.). Is it possible for my swf to be on a different server from my LCDS app? If so, how should my client be configured, compiled and deployed? What would be deployed to my LCDS server? Yes. You'd compile your swf against a services-config.xml file containing channel-definitions that use fully qualified URLs that refer to your LCDS server. Then you'd deploy this swf on some other server (maybe an Apache web tier). You'll need a crossdomain.xml file on your LCDS server to allow network access from this remotely hosted swf. How would my client know to call the server? Based on the fully qualified URLs in the services-config.xml file you compile against. Or when your app starts up you could issue a URLRequest for a response containing a list the channels/endpoint URLs/etc. it should use to talk to a given LCDS server. Using this list, your app startup code would create and configure a ChannelSet/Channels and then assign that to your service components (RemoteObject, DataService, etc.). Best, Seth
RE: [flexcoders] Real Time data grid updates/streaming - Oracle - Flex using BlazeDS ???
Take a look at the Data Management Service in LCDS, as well as the server side DataServiceTransaction class. http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=Part_Data_Management_1.html Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of johnpagetbourke Sent: Wednesday, December 17, 2008 10:16 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Real Time data grid updates/streaming - Oracle - Flex using BlazeDS ??? Folks, I have an Oracle application which is updating tables. I want to display these tables in a Flex data grid and update them in real time as the Oracle tables get updated. So the question is, how do I get Oracle to pass real time updates to Java/Tomcat/BlazeDS application to interface to Flex. Here are some thoughts from lots of Google searching. 1. Java SP with JMS interface to Java/Tomcat/BlazeDS 2. Oracle streams to Java/Tomcat/BlazeDS 3. Mining the redo logs for changes (not real time ?) I also have a issue with synchronization. I need to be able to load a table into Flex and then get all subsequent changes. How do I ensure that I do not miss a update between the table load and my update mechanism starting. Are there any other synchronization issues ? Thanks john
RE: [flexcoders] Java enum in Flex3
BlazeDS and LCDS roundtrip Java enums to the client and back as Strings. That's the only good option at present, and here's an in-depth explanation: http://greetingsfromoakland.blogspot.com/2009/02/enums.html Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of sunmoorthy1 Sent: Monday, December 29, 2008 1:18 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Java enum in Flex3 How to convert java enum values into Flex3 object. Any one went thru this problem? Please give your experties? Sundar
RE: [flexcoders] Java enum in Flex3
Hi Maciek, I don't know anything about Granite Data Services but a quick google search returns this: http://www.graniteds.org/jira/browse/GDS-228 The reason why they're getting multiple instances of their enum AS classes during deserialization is layed out in the post I linked to below - without a readResolve() hook in the Player there's no way to support reading singletons out of the AMF stream. This means that you have potentially many duplicate instances of each enum value floating around in the AVM. It looks like they've defined an equals() method as an attempt to work around this, but while that's a standard method defined on Java's base Object class there is no equals() method defined in the core ECMAScript/ActionScript libraries. If I were using client side enums in ActionScript, I'd expect simple equality checks to work correctly and they won't with this approach. Each of these classes will also add a bit to your swf size, but that's a minor concern unless you're using tons of enums :) I don't know what other value these classes may provide, perhaps some help with data validation, but be careful in your code anywhere you're expecting them to actually be singletons because they generally won't be. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Maciek Sakrejda Sent: Wednesday, February 04, 2009 5:38 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Java enum in Flex3 Interesting. Any thoughts on Granite Data Services' approach? There is a custom externalization process for Java Enum objects, and a granite Enum class in ActionScript that all your (generated) Enums extend. The enum class takes care of reading/writing. The writeExternal() method just writes the name of the Enum; readExternal() tries to find the name of the object in the constants defined by the Enum. The RemoteAlias metadata is set up as for a standard Java class. Are we asking for trouble in using this method? Is there something inherently dangerous here? -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: Seth Hodgson shodg...@adobe.com Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: RE: [flexcoders] Java enum in Flex3 Date: Wed, 4 Feb 2009 16:20:33 -0800 BlazeDS and LCDS roundtrip Java enums to the client and back as Strings. That's the only good option at present, and here's an in-depth explanation: http://greetingsfromoakland.blogspot.com/2009/02/enums.html Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of sunmoorthy1 Sent: Monday, December 29, 2008 1:18 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Java enum in Flex3 How to convert java enum values into Flex3 object. Any one went thru this problem? Please give your experties? Sundar
RE: [flexcoders] Re: localconnection data encrypted?
The most vulnerable part of using the ELS is after the data has been decrypted. It is then stored in memory in plain text until it is garbage collected. (Curious question - I wonder if strings are interned in AIR, if so, that could pose another security problem.) Strings are interned by the AVM in both the Player and AIR. So if you have highly sensitive character data and you're worried about memory scanning, you'd want to use an array of characters, and scramble the contents manually after you've used the value in order to render it illegible until the array is GCed. There's no perfect solution here, but this reduces the attack surface. Again, not a concern for most apps. Best, Seth -Original Message- From: Seth Hodgson Sent: Wednesday, January 28, 2009 3:36 PM To: 'flexcoders@yahoogroups.com' Subject: RE: [flexcoders] Re: localconnection data encrypted? Sorry - typo. That should have been: You _don't_ need to worry about encryption in this scenario. If you're worried about encrypting bytes sent over LocalConnections (just a block of shared memory on your local system), I'd assume you'd also need to be worried about those same values in the memory space used by the Player or AIR instances that are communicating via LocalConnections. Given the GC'ed nature of ActionScript, you don't have direct control over how long variables will stick around. So if there's a rogue process running locally that can scan and read anything in system memory, the values in Player/AIR memory space are just as vulnerable as values in the shared memory block used for LocalConnections. If that's the case, then you have bigger issues to worry about than encrypting what you're exchanging via LocalConnection, like getting good anti-virus software installed or something :) Best, Seth -Original Message- From: Seth Hodgson Sent: Wednesday, January 28, 2009 2:50 PM To: 'flexcoders@yahoogroups.com' Subject: RE: [flexcoders] Re: localconnection data encrypted? There's no network involved. More details here: http://greetingsfromoakland.blogspot.com/2008/11/zen-and-art-of-localconnection.html You need to worry about encryption in this scenario unless you're worried about other processes on the local machine trolling randomly through memory... What you likely do need to worry about are the gotchas mentioned in the blog post. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Pete Appleby Sent: Wednesday, January 28, 2009 2:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: localconnection data encrypted? It would seem that there is a network connection being used, but I have not been able to find out for sure. The localconnection allows different versions of the Flash player to communicate via AMF0. This leads me to believe that the network is being used as opposed to a shared memory model. It would be nice to know for sure, but it is now a moot point for my applications. I have taken the time to implement RSA encryption in my communication classes so that the two AIR applications exchange public keys at the time of the first Send command. Once the handshaking of public keys has been completed, the future messages are encrypted and pushed out through the use of the Send method. The receiving app then decrypts the message using its private keys. I am storing the keys in the encrypted local store. That brings up the question of just how secure is the encrypted local store? Pete
RE: [flexcoders] Flex of JavaFX?
Flex Data Services was rebranded as LiveCycle Data Services a while ago, but that was just a name change: http://www.adobe.com/products/livecycle/dataservices/ It's a Flex client library along with a server library that adds advanced functionality on top of and around rpc.swc (shipped with the Flex SDK) on the client and BlazeDS on the server. If your client just needs to display the results of complex computations that will be performed in Java at the server, running BlazeDS on the server and RemoteObject at the client is probably all you need to get started. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Nate Beck Sent: Wednesday, January 28, 2009 11:18 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex of JavaFX? Flex Data Services aren't really around anymore. I would recommend Flex + BlazeDS, it's java based. On Wed, Jan 28, 2009 at 8:45 AM, TCash21 tanya_cashor...@dfci.harvard.edu wrote: Hi all, I'm currently trying to push Adobe Flex at my company for complex network visualizations. The application will also need to run computationally intensive simulations (accessing backend java code) as well as some other distributed tasks. I know Java can store everything in memory and access it but is Flex just as able? Would it require Flex Data Services and what are the advantages? I'm easily sold on the UI-experience and aesthetic appeal of the front-end, I'm just unsure how it would handle massive computational efforts on the backend and display it all to the client quickly. We're trying to figure out the best way to go, will it be JavaFX? Flex Data Services? Flex and Java integrated? Elixir? Thank you all for any input, -Tanya -- Cheers, Nate http://blog.natebeck.net
RE: [flexcoders] Re: localconnection data encrypted?
There's no network involved. More details here: http://greetingsfromoakland.blogspot.com/2008/11/zen-and-art-of-localconnection.html You need to worry about encryption in this scenario unless you're worried about other processes on the local machine trolling randomly through memory... What you likely do need to worry about are the gotchas mentioned in the blog post. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Pete Appleby Sent: Wednesday, January 28, 2009 2:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: localconnection data encrypted? It would seem that there is a network connection being used, but I have not been able to find out for sure. The localconnection allows different versions of the Flash player to communicate via AMF0. This leads me to believe that the network is being used as opposed to a shared memory model. It would be nice to know for sure, but it is now a moot point for my applications. I have taken the time to implement RSA encryption in my communication classes so that the two AIR applications exchange public keys at the time of the first Send command. Once the handshaking of public keys has been completed, the future messages are encrypted and pushed out through the use of the Send method. The receiving app then decrypts the message using its private keys. I am storing the keys in the encrypted local store. That brings up the question of just how secure is the encrypted local store? Pete
RE: [flexcoders] Re: localconnection data encrypted?
Sorry - typo. That should have been: You _don't_ need to worry about encryption in this scenario. If you're worried about encrypting bytes sent over LocalConnections (just a block of shared memory on your local system), I'd assume you'd also need to be worried about those same values in the memory space used by the Player or AIR instances that are communicating via LocalConnections. Given the GC'ed nature of ActionScript, you don't have direct control over how long variables will stick around. So if there's a rogue process running locally that can scan and read anything in system memory, the values in Player/AIR memory space are just as vulnerable as values in the shared memory block used for LocalConnections. If that's the case, then you have bigger issues to worry about than encrypting what you're exchanging via LocalConnection, like getting good anti-virus software installed or something :) Best, Seth -Original Message- From: Seth Hodgson Sent: Wednesday, January 28, 2009 2:50 PM To: 'flexcoders@yahoogroups.com' Subject: RE: [flexcoders] Re: localconnection data encrypted? There's no network involved. More details here: http://greetingsfromoakland.blogspot.com/2008/11/zen-and-art-of-localconnection.html You need to worry about encryption in this scenario unless you're worried about other processes on the local machine trolling randomly through memory... What you likely do need to worry about are the gotchas mentioned in the blog post. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Pete Appleby Sent: Wednesday, January 28, 2009 2:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: localconnection data encrypted? It would seem that there is a network connection being used, but I have not been able to find out for sure. The localconnection allows different versions of the Flash player to communicate via AMF0. This leads me to believe that the network is being used as opposed to a shared memory model. It would be nice to know for sure, but it is now a moot point for my applications. I have taken the time to implement RSA encryption in my communication classes so that the two AIR applications exchange public keys at the time of the first Send command. Once the handshaking of public keys has been completed, the future messages are encrypted and pushed out through the use of the Send method. The receiving app then decrypts the message using its private keys. I am storing the keys in the encrypted local store. That brings up the question of just how secure is the encrypted local store? Pete
RE: [flexcoders] Re: Anything other than a JS alert can delay a window close?
HTTP session timeout at the server is the only sure-fire way to detect a client has left. Catching Javascript events at the client and attempting to notify the server may shortcut this process _when_ it works - but it provides no guarantees that it will. Even if your Javascript is able to put a request onto the network or get Flash to issue a request via ExternalInterface before the browser closes, the notification over the network could be lost, for instance if an intermediate router crashes. Depending on the behavior of your app, you can shorten this time interval by lowering your session timeout in web.xml. If you're trying to detect the client leaving specific pages this is more difficult with HTTP because your connection (i.e. session) spans all the pages of your site that are loaded in the browser process. When the session times out, you could treat this as a leave for all pages the client has viewed during its session. For RTMP (not available in BlazeDS) because we're dealing with a stateful connection (unlike HTTP where connections are stateless) as soon as the RTMP connection closes when the user closes their browser or navigates away from a page containing your Flex app, we detect that and you can respond to this event on the server. In this case, if different pages contain individual swfs that you're tracking, as soon as the client leaves a page and the connection closes you can track that directly. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of valdhor Sent: Wednesday, December 10, 2008 5:58 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Anything other than a JS alert can delay a window close? Another idea... How about setting up a timer in Flex to poll the server. If the server does not receive the poll in a certain amount of time then the client has disconnected and you can write the data to the database. It may work even better with BlazeDS (I don't know this - I'm kinda hoping it works). Hopefully you can tell if a client disconnects from something they have subscribed to via RTMP. Does anyone know?
RE: [flexcoders] Re: BadPaddingException using RTMPS
Hi Taze, Do these errors only occur during the SSL handshake (you can look for SSLHandshakeException in your stack traces)? Are you using a CA certificate or a self-signed cert, and what algorithm, etc.? Also, do you know if this is happening for connections from AIR clients running on Windows, Mac, Linux? Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of taze170171 Sent: Monday, December 15, 2008 12:36 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: BadPaddingException using RTMPS Hello Jeff! Thank you for your answer. We are using LCDS 2.6.1. and Flex SDK 3.2. Best regards, Taze --- In flexcoders@yahoogroups.com, Jeff Vroom jvr...@... wrote: Are you running the released version of 2.6? There was a bug in RTMPS in that version which is fixed in a hotfix or in 2.6.1 that might cause this type of error intermittently. Jeff From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of taze170171 Sent: Friday, December 12, 2008 5:52 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] BadPaddingException using RTMPS Hello! We are using AIR, LCDS (running on a JBoss) and an RTMPS connection. Sometimes we get the following exception, when the AIR client tries to connect to the server: [Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed to read Connection 'xxx' or process the data; Connection is in the 'Handshaking' state and will be forced closed. javax.net.ssl.SSLHandshakeException: Invalid padding at com.sun.net.ssl.internal.ssl.Alerts.getSSLException (Alerts.java:150) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal (SSLEngineImpl.java:1417) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord (SSLEngineImpl.java:874) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord (SSLEngineImpl.java:787) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap (SSLEngineImpl.java:663) at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566) at flex.messaging.socketserver.SSLConnection.handshake (SSLConnection.java:301) at flex.messaging.socketserver.Connection$ConnectionReader.run (Connection.java:761) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work er.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work er.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:595) Caused by: javax.crypto.BadPaddingException: Padding length invalid: 244 at com.sun.net.ssl.internal.ssl.CipherBox.removePadding (CipherBox.java:442) at com.sun.net.ssl.internal.ssl.CipherBox.decrypt (CipherBox.java:290) at com.sun.net.ssl.internal.ssl.InputRecord.decrypt (InputRecord.java:153) at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt (EngineInputRecord.java:238) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord (SSLEngineImpl.java:856) ... 8 more Can anybody help? Thanks in advance, Taze
RE: [flexcoders] Best practice for calling asynchronous functions?
I haven't been following this thread, but the sample code below can actually be shortened to something like this: save(xml).addResponder(new AsyncResponder(handleResult, handleFault)); No AsyncToken in the code and rather than new'ing the responder, if you always want to direct results/faults to a consistent pair of handler functions you could set up the AsyncResponder earlier and just pass in a ref. save(xml).addResponder(saveResponder); The only reason to actually get a ref to the returned AsyncToken is if you want to add some dynamic properties to it that will help drive your handling of the eventual async result/fault (the token - and any custom state you've tagged it with - is accessible within your result/fault callbacks when they execute). But for scenarios like that where I want to hang onto some data from the call site, I often find it simpler to take advantage of the variable/scope capture that a closure provides by defining my result/fault callbacks as inline lambda functions rather than manually capturing state by copying a portion of it into properties of the AsyncToken. So something like: save(xml).addResponder(new AsyncResponder( function(... , // inline result handler function function(... // inline fault handler function )); Rather than new'ing an HTTPService for every call you make and trying to manage adding/removing event listeners (which will prevent instances from being GC'ed) in your wrapper I'd recommend just following the first convention I list above for each call: someMethod(args).addResponder(new AsyncResponder(handleResult, handleFault)); Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark Carter Sent: Wednesday, December 10, 2008 7:23 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Best practice for calling asynchronous functions? Thanks for all the responses. I hadn't really looked into the ASyncToken until now. However, for me it seems that using the ASyncToken would be limited to the implementation of the, for example, save(XML, Function, Function) method. The calling code doesn't need to know about it. In my opinion this is neater than something like: var asyncToken:ASyncToken = save(xml); asyncToken.addResponder(... Also, I don't like adding responders after the call has been made. I know it works, but still... Maybe I should start a new topic for this next question, but... ...in my implementation, I create a new HTTPService for each call. Any ideas how (in)efficient this is? As you can imagine, it keeps the implementation much simpler. No need for the ASyncToken. Just add new listeners each time a call is made. Everything is garbage collected. Oh, hang on, what keeps a reference to the HTTPService? -- View this message in context: http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20948799.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] RE: services-config.xml: compc or just mxmlc?
I think what I'm really asking is when does the services-config.xml metadata get baked into a .swf (or .swc)? When you compile with mxmlc and -services, a subset of your config is baked in the swf. It looks like compc doesn't complain about a -services option, although the 'baked in' aspect of this is code-gen'ed into the generated Flex init code. I don't know whether any of that is generated for a swc, but feel free to give it a try. You could test by compiling a swc with -services, then building a swf (including this swc) without -services and checking for baked in config. The baked in subset of config ends up living here at runtime: mx.messaging.config.ServerConfig#xml If you change services-config.xml, you should recompile the artifact that it's baked into. Avoid compiling it into multiple artifacts. After changes to [RemoteClass]'s you should recompile the respective artifacts they live in. With your componentization all being a compile time concern here, it seems to me like you could get this all to work. Good luck :) Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Maciek Sakrejda Sent: Wednesday, December 10, 2008 9:56 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] RE: services-config.xml: compc or just mxmlc? Seth, Thanks--this is really handy. But I think what I was asking is a little simpler: there are no modules (in the Flex sense of the word) here. I'm essentially just interested in building a main app and being able to extend it after-the-fact with an add-on that gets compiled into a single .swf application. That is: main app: src/index.mxml (the Application, but only a wrapper around Main.mxml) src/Main.mxml (the actual brains of the app) src/util1.as src/util2.as services-config.xml gets compiled into foo.swf (the default app) *and (separately) foo.swc (a library which includes all the classes compiled from the above sources except index.mxml) later on, someone else (with access to index.mxml, services-config.xml, and foo.swc, but not the sources, wants to extend this): extended version: src/index.mxml (same as above, but now modified to reference Extended.mxml) src/Extended.mxml src/util3.as lib/foo.swc (from above) services-config.xml (from above) this gets compiled into super-foo.swf (the extended app) Suppose that the extended version does not even change services-config.xml or add any objects with [RemoteAlias] metadata. Do I need to reference services-config.xml when (1) building the original foo.swc (2) building the super-foo.swf (3) both ? And if I do extend services-config.xml or add new [RemoteAlias] objects to the extended version, does the answer to the above change (obviously, it has to be at least 2 or 3)? I think what I'm really asking is when does the services-config.xml metadata get baked into a .swf (or .swc)? -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: Seth Hodgson shodg...@adobe.com Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: [flexcoders] RE: services-config.xml: compc or just mxmlc? Date: Tue, 9 Dec 2008 09:43:18 -0800 Hi Maciek, I don't have any practical experience with attempting to compile service config and associated classes into modules and I don't know whether compc would support it or not, but based on some informal discussions with Alex and Jeff I wouldn't recommend it. The core issue is that AMF serialization mappings (client to server class aliases) within Flash Player aren't scoped per module or even app domain as loaded classes are - unfortunately they're scoped to a security domain (broader scope). This means that if the root swf loads two or more modules (each will be loaded in its own child ApplicationDomain by default), where these modules bake in overlapping sets of classes that use [RemoteClass] metadata things won't work. The modules will effectively trample each other's registered class aliases to point to their respective local classes. Say you have a class Foo ([RemoteClass(alias=com.Foo)]), that you've compiled into both modules. You now have two separate class defs on the client (one per module/sub app domain), but only one alias registered (scoped to the security domain both of these app domains belong to). When the loosing module receives a Foo off the network it will fail to deserialize correctly because the alias mapping points to the class def in the other module, which this module doesn't have access to. I think the best approach for now is to place your service config and all shared classes with [RemoteClass] metadata into your root swf, and then expose this to your modules through a controlled API - say a registry of network services or operations the modules can use. You may be able to get away with keeping non-shared classes with [RemoteClass] metadata in specific modules, but I haven't tried that. Best, Seth From: flexcoders
RE: [flexcoders] Best practice for calling asynchronous functions?
Hi Josh, This sounds like a bug in SOAP serialization in the Flex SDK that's generating a Fault locally on the client (no networking involved) but apparently has a bug and does so incorrectly. Would you mind logging a bug with test case if you haven't already? Thanks, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Josh McDonald Sent: Thursday, December 11, 2008 3:05 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Best practice for calling asynchronous functions? Some quick pointers (I do the framework stuff where I work): All (afaik) network requests are queued up until the end of frame, so you can nearly always add responders to a token... ...Except request errors, such as an invalid SOAP request. These can in some circumstances generate Fault exceptions that never make it to the token :( Here's some example code: // ... //This code is to catch invocation problems, since Flash has decided to interrupt the flow of the VM for //FaultEvent rather than dispatch it on next frame from the token operation.addEventListener(FaultEvent.FAULT, invocationFaultHandler); //Send the request log.debug(Sending request...); token = operation.send(); log.debug(...Send attempt completed); //Remove our invocation fault listener operation.removeEventListener(FaultEvent.FAULT, invocationFaultHandler); //Do we need to send this info on to the token's listeners in a frame or two? if (invocationFaultEvent) //Instance-level global { log.debug(There was an invoke error, which means the token listeners aren't notified. Will redispatch to them in 250ms); //When we create the timer, we're using a hard listener reference because this helper instance may otherwise be collected before we're done! //So make sure to remove the handler (and kill the timer) on firing! timer = new Timer(250, 1); timer.addEventListener(TimerEvent.TIMER, reDispatchInvocationFault); timer.start(); } return token; } private function invocationFaultHandler(event : FaultEvent) : void { log.error(A fault occured during invocation); this.invocationFaultEvent = event; } private function reDispatchInvocationFault(event : TimerEvent) : void { //Important! timer.removeEventListener(TimerEvent.TIMER, reDispatchInvocationFault); timer.stop(); timer = null; token.mx_internal::applyFault(invocationFaultEvent); } On Fri, Dec 12, 2008 at 4:08 AM, Seth Hodgson shodg...@adobe.com wrote: I haven't been following this thread, but the sample code below can actually be shortened to something like this: save(xml).addResponder(new AsyncResponder(handleResult, handleFault)); No AsyncToken in the code and rather than new'ing the responder, if you always want to direct results/faults to a consistent pair of handler functions you could set up the AsyncResponder earlier and just pass in a ref. save(xml).addResponder(saveResponder); The only reason to actually get a ref to the returned AsyncToken is if you want to add some dynamic properties to it that will help drive your handling of the eventual async result/fault (the token - and any custom state you've tagged it with - is accessible within your result/fault callbacks when they execute). But for scenarios like that where I want to hang onto some data from the call site, I often find it simpler to take advantage of the variable/scope capture that a closure provides by defining my result/fault callbacks as inline lambda functions rather than manually capturing state by copying a portion of it into properties of the AsyncToken. So something like: save(xml).addResponder(new AsyncResponder( function(... , // inline result handler function function(... // inline fault handler function )); Rather than new'ing an HTTPService for every call you make and trying to manage adding/removing event listeners (which will prevent instances from being GC'ed) in your wrapper I'd recommend just following the first convention I list above for each call: someMethod(args).addResponder(new AsyncResponder(handleResult, handleFault)); Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Mark Carter Sent: Wednesday, December 10, 2008 7:23 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Best practice for calling asynchronous functions? Thanks for all the responses. I hadn't really looked into the ASyncToken until now. However, for me it seems
RE: [flexcoders] Best practice for calling asynchronous functions?
Right, definitely a bug in mx.rpc.soap.Operation#invokePendingCall where it invokes a helper method to dispatch fault events directly if it hits encoding errors, etc. An example of what it should be doing can be seen in mx.rpc.soap.mxml.Operation#send: new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 1); mx.rpc.AsyncDispatcher is a (currently @private) helper class that helps avoids Timer leaks due to overlooking cleaning up event listeners when using the old Timer(1, 1) idiom. Best, Seth From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Josh McDonald Sent: Thursday, December 11, 2008 9:20 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Best practice for calling asynchronous functions? SOAPEncoder throws an exception, which is caught by Operation, swallowed, and then a fault event is dispatched from the Operation instance. If you do all your async stuff using responders because you need to know *which* action has just finished or faulted (among other things), you never get to hear about it. -Josh On Fri, Dec 12, 2008 at 2:20 PM, Mark Carter c...@mark.carter.name wrote: Josh McDonald-4 wrote: The problem is that from the SDK's point of view, there is no request. There's no IMessage, there's nothing to wait on. However from the application's point of view, there is. I don't quite understand... Wouldn't any problems before the async token is returned, be thrown as an exception from the method returning the async token? Therefore the calling code just needs to catch that exception and handle it. The only problem with this would be if an event is generated after the async token is returned and before the responder is added. This would only be an issue in a multi-threaded environment.
RE: [flexcoders] Error while accessing LCDS fill method
If this hasn't been resolved, a snippet of your server log file with Message.* and Debug.* debug logging enabled, leading up to and through this error would be useful to see, as well as knowing what version of the LCDS you're running. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of shruti.sheety Sent: Tuesday, December 02, 2008 10:22 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Error while accessing LCDS fill method Hi, I have recently upgraded from Flex2 (FDS) to Flex3(LCDS and have my application which runs on Flex sdk3.2 -LCDS with carringom MVC. The problem i am having is when i refresh the page it is saying AbstractAssembler.fill: Cannot find service class... DataService.onFault: event=[FaultEvent fault=[RPC Fault faultString=The fill method with parameters '[a,b,c]] (class: java.util.Arrays$ArrayList)' and destination 'cp_ds' returned null. faultCode=Server.Processing faultDetail=null] messageId=32B99043-830F-956D-4897-38293069CDA1 type=fault bubbles=false cancelable=true eventPhase=2] It is only when i refresh the page i have this error. When i access the page the first time its fine.Also i have made sure that the service class is in place. Please suggest. Thanks, Shruti
[flexcoders] RE: services-config.xml: compc or just mxmlc?
Hi Maciek, I don't have any practical experience with attempting to compile service config and associated classes into modules and I don't know whether compc would support it or not, but based on some informal discussions with Alex and Jeff I wouldn't recommend it. The core issue is that AMF serialization mappings (client to server class aliases) within Flash Player aren't scoped per module or even app domain as loaded classes are - unfortunately they're scoped to a security domain (broader scope). This means that if the root swf loads two or more modules (each will be loaded in its own child ApplicationDomain by default), where these modules bake in overlapping sets of classes that use [RemoteClass] metadata things won't work. The modules will effectively trample each other's registered class aliases to point to their respective local classes. Say you have a class Foo ([RemoteClass(alias=com.Foo)]), that you've compiled into both modules. You now have two separate class defs on the client (one per module/sub app domain), but only one alias registered (scoped to the security domain both of these app domains belong to). When the loosing module receives a Foo off the network it will fail to deserialize correctly because the alias mapping points to the class def in the other module, which this module doesn't have access to. I think the best approach for now is to place your service config and all shared classes with [RemoteClass] metadata into your root swf, and then expose this to your modules through a controlled API - say a registry of network services or operations the modules can use. You may be able to get away with keeping non-shared classes with [RemoteClass] metadata in specific modules, but I haven't tried that. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Maciek Sakrejda Sent: Sunday, December 07, 2008 9:42 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] services-config.xml: compc or just mxmlc? Does compc care about the contents of the services-config.xml file? If I compile a .swc component with compc with one set of services defined, but then change the services-config.xml file and build a .swf with mxmlc, are the mxmlc service definitions used for everything? Is it some weird combination? I know I can probably poke at this through experimentation, but the docs explicitly *don't* list service-config as an option that does not apply to compc, so I was curious. -Maciek
RE: [flexcoders] Call Flex from JavaScript
This page in the LCDS docset describes this specifically: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309 The scenario in the docs is dealing with notifying the server that the client is going away, in order to short-circuit the slower normal notification based on server session timeout. But you could use the same technique to achieve other things as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Monday, December 08, 2008 6:28 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Call Flex from JavaScript Using a set up in my ActionScript of: ExternalInterface.addCallback(tagWithClosed,windowClosed); How can I write a JavaScript function that calls 'tagWithClosed' to Flex when the user closes the window (window.close() ) or when they leave for another page?
RE: [flexcoders] Call Flex from JavaScript
You need to pop a Javascript alert in your trackClosing() method to keep the browser from closing until the user clicks the OK button. This technique is a hack, but an alert generally leads to a long enough delay in user interaction (say a second or two) to finish making your call into the Player before the browser process exits. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Tuesday, December 09, 2008 10:26 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Call Flex from JavaScript Based on that and other examples, I tried this: script language=JavaScript type=text/javascript window.onunload = trackClosing; function trackClosing(){ document.getElementById(FXVideo).tagWithClosed(); } /script In my constructor I have: if (ExternalInterface.available){ ExternalInterface.addCallback(tagWithClosed,windowClosed); } It doesn't seem to work. Any ideas on what I am doing wrong? From: Seth Hodgson [EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 9:50 AM To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: RE: [flexcoders] Call Flex from JavaScript This page in the LCDS docset describes this specifically: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309 The scenario in the docs is dealing with notifying the server that the client is going away, in order to short-circuit the slower normal notification based on server session timeout. But you could use the same technique to achieve other things as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Monday, December 08, 2008 6:28 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Call Flex from JavaScript Using a set up in my ActionScript of: ExternalInterface.addCallback(tagWithClosed,windowClosed); How can I write a JavaScript function that calls 'tagWithClosed' to Flex when the user closes the window (window.close() ) or when they leave for another page?
RE: [flexcoders] Call Flex from JavaScript
Not that I'm aware of. Javascript alert is the only way to block a page close, and even then only until the user clicks OK. The various close-related events in Javascript exhibit subtle differences across browsers/versions and allowing a script to force a page to remain open (for any length of time programmatically including potentially indefinitely) would be a serious security and usability issue. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Tuesday, December 09, 2008 10:40 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Call Flex from JavaScript Unfortunately that is not an option. This is a video player tracking system on a very public landing page. Would onbeforeunload work better? Is there a way to just delay the closing of a page before it happens (behind the scenes)? Any other javascript events that would work better? From: Seth Hodgson [EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 10:32 AM To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: RE: [flexcoders] Call Flex from JavaScript You need to pop a Javascript alert in your trackClosing() method to keep the browser from closing until the user clicks the OK button. This technique is a hack, but an alert generally leads to a long enough delay in user interaction (say a second or two) to finish making your call into the Player before the browser process exits. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Tuesday, December 09, 2008 10:26 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Call Flex from JavaScript Based on that and other examples, I tried this: script language=JavaScript type=text/javascript window.onunload = trackClosing; function trackClosing(){ document.getElementById(FXVideo).tagWithClosed(); } /script In my constructor I have: if (ExternalInterface.available){ ExternalInterface.addCallback(tagWithClosed,windowClosed); } It doesn't seem to work. Any ideas on what I am doing wrong? From: Seth Hodgson [EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 9:50 AM To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: RE: [flexcoders] Call Flex from JavaScript This page in the LCDS docset describes this specifically: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconnections_4.html#1074309 The scenario in the docs is dealing with notifying the server that the client is going away, in order to short-circuit the slower normal notification based on server session timeout. But you could use the same technique to achieve other things as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of wkolcz Sent: Monday, December 08, 2008 6:28 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Call Flex from JavaScript Using a set up in my ActionScript of: ExternalInterface.addCallback(tagWithClosed,windowClosed); How can I write a JavaScript function that calls 'tagWithClosed' to Flex when the user closes the window (window.close() ) or when they leave for another page?
RE: [flexcoders] WebDAV and Flex - Any sample code or opensource widgets available . . ?
Unfortunately, the Player currently limits the set of allowed HTTP methods to just GET and POST. This means that PUT, DELETE, HEAD, etc. as well as all the WebDAV extension methods are not allowed. Anyone who cares about this area should vote for this bug: https://bugs.adobe.com/jira/browse/SDK-12200 And perhaps add a new bug specifically regarding WebDAV, although support for that would definitely be lower priority. As a workaround for core HTTP methods, you could use the proxy service in BlazeDS or LCDS which does supports all the core methods (mod PUT apparently - not sure why that one's not included, possibly a doc error). We use HTTPClient internally in the proxy service, and this library doesn't support WebDAV extension methods so you'd still be out of luck with WebDAV integration there as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of marty_martian Sent: Tuesday, December 09, 2008 7:35 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] WebDAV and Flex - Any sample code or opensource widgets available . . ? I have searched through the archives for this user group but see very little discussion on WebDAV with Flex. It looks like some folks have been trying to do it as far back as 2006 but no samples or pointers to samples or open source widgets have been posted. Related to this, can anyone share: - samples - pointers to samples - open source widgets Most Grateful, Christopher
RE: [flexcoders] JSP taglib FLEX 3
You need to merge the entire web tier compiler WAR with your existing WAR. If you just move random jars over chances are good you'll miss some dependencies. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of virchete Sent: Tuesday, December 02, 2008 6:21 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] JSP taglib FLEX 3 I am trying to use the jsp tag library into a very simple jsp: %@ taglib uri=FlexTagLib prefix=mm % htmlbody h3Introduction/h3 pThis is an example of writing MXML in a JSP./p h3My App/h3 mm:mxml mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Accordion width=500 height=300 mx:VBox label=panel1 width=500 height=200 / /mx:Accordion /mx:Application /mm:mxml /body/html I have a Java project that uses STRUTS to redirect. Well the problem is that, although I have included the flex-bootstrap.jar, flex-bootstrap-jsp.jar, flex-webtier.jar and flex-webtier-jsp.jar I always receive the same exception in the explorer or mozilla navigator: java.lang.NullPointerException flex.bootstrap.BootstrapTag.init(BootstrapTag.java:24) flex.bootstrap.BootstrapBodyTag.init(BootstrapBodyTag.java:14) flex.webtier.server.j2ee.jsp.MxmlTagImpl.init(MxmlTagImpl.java:2) I am using Tomcat 6 server and I receive always the following trace: EVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to read TLD META-INF/taglib.tld from JAR file file:/C:/google2/MapasOpodo/build/web/WEB-INF/lib/flex-bootstrap.jar: java.lang.NullPointerException at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:181) at org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java:182) at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420) ... ... ... SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at flex.bootstrap.BootstrapTag.init(BootstrapTag.java:24) at flex.bootstrap.BootstrapBodyTag.init(BootstrapBodyTag.java:14) Well If you need something more (the source code) don't doubt to ask me. I am so sorry for having to find help, but I have lost all the day of work today, and if you could help me... Many Thanks David Virgil.
RE: [flexcoders] huge AMF messages
If you sent these in a RemoteObject call, that 10MB worth of data would go to the server in the body of a single HTTP POST. No progress events, and depending on the receiving server it may enforce size limits on body content of HTTP requests but they'd likely be higher than 10MB. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robin Burrer Sent: Tuesday, December 09, 2008 4:22 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] huge AMF messages Hi all, I planning to build an AIR application. In this application the user can create libraries that consist of multiple value Entry objects. Each EntryVO should look like this (there will be more properties of course) : package vo { [RemoteClass(alias=vo.EntryVO)] import flash.net.registerClassAlias; import flash.utils.ByteArray; public class EntryVO { [Bindable] public var image_data:ByteArray; [Bindable] public var image_name:String; public static function register():void { registerClassAlias(vo.EntryVO, EntryVO); } } } To simplify the uploading and downloading process I want to transfer images as ByteArrays to a .NetBackend. My question: What are my limitations here file size wise? Let's say I have 10 EntryVO. An each of these has an 1 MB byte array embedded. That means that my libraryVO (10 x 1 MB EntryVO) would have a file size of 10 MB. Will this work at all? Is there a progress event for remote operations? I guess it will take a while to transfer a 10 MB AMF message. Thanks for any input! Cheers Robin
RE: [flexcoders] WebDAV and Flex - Any sample code or opensource widgets available . . ?
Agreed, but one caution: Implementing things from scratch on top of flash.net.Socket may be an option for some limited use cases, but without the direct browser integration it doesn't make for a great general solution (in the case of WebDAV, or for general HTTP) You lose integrated auth (NTLM for instance), security (SSL/certificate truststore and UI to manage it), state (cookies - whether you love them or hate them), etc. that the Player gets for free when it uses the browser's HTTP stack. This stuff turns out to be pretty valuable in practice. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Stephen More Sent: Tuesday, December 09, 2008 11:15 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] WebDAV and Flex - Any sample code or opensource widgets available . . ? How exactly do you envision WebDAV being used with flash ? Couldn't one use flash.net.Socket to connect to port 80 and communicate using the WebDAV protocol ? On Tue, Dec 9, 2008 at 2:10 PM, Seth Hodgson shodg. wrote: Unfortunately, the Player currently limits the set of allowed HTTP methods to just GET and POST. This means that PUT, DELETE, HEAD, etc. as well as all the WebDAV extension methods are not allowed. Anyone who cares about this area should vote for this bug: https://bugs.adobe.com/jira/browse/SDK-12200 And perhaps add a new bug specifically regarding WebDAV, although support for that would definitely be lower priority. As a workaround for core HTTP methods, you could use the proxy service in BlazeDS or LCDS which does supports all the core methods (mod PUT apparently - not sure why that one's not included, possibly a doc error). We use HTTPClient internally in the proxy service, and this library doesn't support WebDAV extension methods so you'd still be out of luck with WebDAV integration there as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of marty_martian Sent: Tuesday, December 09, 2008 7:35 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] WebDAV and Flex - Any sample code or opensource widgets available . . ? I have searched through the archives for this user group but see very little discussion on WebDAV with Flex. It looks like some folks have been trying to do it as far back as 2006 but no samples or pointers to samples or open source widgets have been posted. Related to this, can anyone share: - samples - pointers to samples - open source widgets Most Grateful, Christopher
RE: [flexcoders] Flex Messaging - Typing Objects.
Yes, you can build and push AsyncMessages that contain typed objects as the message bodies. If you're just pushing messages from client to client through the server (i.e. no JMS or some other custom adapter into a backend messaging system), you can just tag your ActionScript class with [RemoteClass] (no alias=... attribute), and it'll show up at the receiving client as an instance of the desired type. In this case you don't even need a corresponding server-side Java class. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rodrigo Pereira Fraga Sent: Monday, December 08, 2008 5:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex Messaging - Typing Objects. Hi! I'm using the messaging services of BlazeDS. So, anybody here knows if I can type an object using [RemoteClass]? My messages are sent from java to flex. Thanks.
RE: [flexcoders] Re: AMF3 ping???
The messaging/transport layer in Flex 2 and 3 is based on channels. A channel always handshakes with a server endpoint before passing application-generated messages/requests over its connection. So you'll see a ping command issued each time a channel initially connects. If a request fails due to a network problem such that the channel moves to a disconnected state, the next message/request the app sends will trigger it to reconnect, and it'll do so by sending another ping command. But this only happens when a channel is attempting to move from a disconnected state to a connected state. The one exception to this rule is when you're using an HTTPService or WebService component that's hitting a remote endpoint directly rather than going through the proxy service in BlazeDS or LCDS. This scenario uses a direct channel that always considers itself connected. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of valdhor Sent: Friday, December 05, 2008 6:31 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AMF3 ping??? I don't know about BlazeDS but with WebORB you get a ping (It's actually called a Command Message) just before the first server access. Any server requests after that are only sent once (ie. no Command Message). Now, it seems to me that this will work this way for a while and the this Command Message is sent again. I don't know if this happens automatically after a certain amount of idle time or whatever. Has anyone else seen this? Has anyone read the AMF3 spec to see if this is standard behaviour? --- In flexcoders@yahoogroups.com, andrea bianchi [EMAIL PROTECTED] wrote: Hi, debugging my application I discovered that every request produces two POSTs. I'm connecting a RemoteObject to an AMFEndpoint of BlazeDS. Reading the content of the POST data (using HTTPFox) I guessed one is a sort of ping, the other is the real request. The application works fine but I actually don't understand the need of this ping (and the documentation doesn't speak about it). Actually this behaviour is confirmed from the Flashlog.txt: 08:25:44.692 [INFO] mx.messaging.Producer '5DE3A67A-5244-ACD0-5814-0640997D7449' producer sending message '6EADA155-B3EE-4DC4-6AB5-06409DF3CAEE' 08:25:44.718 [DEBUG] mx.messaging.Channel 'amf' pinging endpoint. 08:25:44.750 [INFO] mx.messaging.Channel 'amf' channel is connected. 08:25:44.755 [DEBUG] mx.messaging.Channel 'amf' channel sending message: (mx.messaging.messages::RemotingMessage)#0 ... Can someone please clarify this? I tried playing with BlazeDS configuration files but I didn't find anything. Is there any way to disable the ping? Thank you, Andrea
RE: [flexcoders] Method variable scoping problem with Flex compiler
Fact of life with ECMAScript (hence, with ActionScript as well). Take a look at the language specification itself for details, but locals in your example are scoped to the function, not to code blocks within the function delimited by braces. Yes, this differs from C-based languages, and as someone who regularly works in both I've been bitten by this more than once as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of toofah_gm Sent: Thursday, December 04, 2008 2:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Method variable scoping problem with Flex compiler I came across another scoping issue today that scared me. I sure wish that the scoping in the ActionScript language worked the same way C++, C#, Java, and others work! Here's the code: for each (var o:Object in myArray) { var myProblemObject:ProblemObject; if (some condition) { myProblemObject = new ProblemObject(); ... more code here ... } ... still more code here... if (myProblemObject) { ... do some stuff ... } } In this code myProblemObject is NULL when things start out...great! The problem comes after an instance of myProblemObject gets created. Every time through the loop after this myProblemObject is no longer NULL. This is not consistent with any other language that I have worked with and is therefore not obvious to the developer working with the code. Why is myProblemObject not reset each time through the loop? It is a variable declaration. Gary --- In flexcoders@yahoogroups.com, toofah_gm [EMAIL PROTECTED] wrote: It seems to me and my co-workers that the Flex compiler is broken when it comes to local variable scoping within methods. For example: for (var i:int=0; icount; i++) { // do something } for (var i:int=0; icount; i++) { // do something else } This gives a compiler warning stating that 'i' is already defined. But in every other language that I have used, this is completely valid. Yes 'i' was defined above, but 'i' should only be scoped within the 'for' loop and should be invalid outside of it. Another example: if (x) { var myArray:Array = new Array(); // do more stuff } myArray.push(some data); This one compiles, when I believe that it shouldn't. myArray should only be defined within the 'if' statement. If you don't go into the 'if' statement you have a problem here. Does anyone understand why the Flex compiler allows this? Is this just a BUG with the compiler? Anyway, this is just driving me a little crazy. ;) Gary
RE: [flexcoders] Re: Using RMTPS channel
The NetConnection.Connect.SSLHandshakeFailed status indicates that the platform SSL library for the machine you're running the player on decided not to complete the handshake for some reason. Unfortunately, the platform library doesn't give the player much in the way of useful detail... I think the most probable reason for the failure in your case is the use of an IP in the CN field of your cert. You should use an actual domain name instead. DynDNS can be a great way of creating a test domain name to use for this sort of testing. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi Sent: Thursday, December 04, 2008 2:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using RMTPS channel Hi again Seth, I follow your solution, I imported the certificate to my FireFox browser to the section Your certificates. I also import my cacert.cert into FireFox in the Authorities section and in this path/System/Library/Frameworks/JavaVM.framework/Home/lib/security, in the cacerts file i have the next entry: Alias name: myprivateca Creation date: Dec 4, 2008 Entry type: trustedCertEntry Owner: [EMAIL PROTECTED], CN=10.100.72.165, OU=asigna, O=asigna, L=mexico, ST=mexico, C=MX Issuer: [EMAIL PROTECTED], CN=10.100.72.165, OU=asigna, O=asigna, L=mexico, ST=mexico, C=MX Serial number: 875fed8624c6414d Valid from: Thu Dec 04 12:31:19 CST 2008 until: Fri Dec 04 12:31:19 CST 2009 Certificate fingerprints: MD5: 3D:AB:30:93:34:56:E7:DA:E6:41:D0:52:F9:38:54:E0 SHA1: E1:83:9E:4C:8C:A2:BB:EA:D0:EE:E8:14:EE:C1:6F:C9:F5:4C:91:7E *** *** After i tried again in debug mode and the Flex Builder console show me the next one: 'my-rtmps' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.Failed level = error 'my-rtmps' channel polling stopped. 'my-rtmps' channel connect failed. '7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038' '7540C905-0C6E-84BE-E092-040409E73F95' consumer starting resubscribe timer. '7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe. 'my-rtmps' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.SSLHandshakeFailed level = status '7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe. '7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe. '7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe. 'my-rtmps' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.Failed level = error 'my-rtmps' channel polling stopped. 'my-rtmps' channel connect failed. '7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038' '7540C905-0C6E-84BE-E092-040409E73F95' consumer trying to resubscribe. 'my-rtmps' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.SSLHandshakeFailed level = status '7540C905-0C6E-84BE-E092-040409E73F95' consumer stopping resubscribe timer. '7540C905-0C6E-84BE-E092-040409E73F95' consumer fault for '7570FE6F-FBAC-B48A-F254-0404457B1783'. 'my-rtmps' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.Failed level = error 'my-rtmps' channel polling stopped. 'my-rtmps' channel connect failed. '7540C905-0C6E-84BE-E092-040409E73F95' consumer channel faulted with Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038' '7540C905-0C6E-84BE-E092-040409E73F95' consumer fault for '7570FE6F-FBAC-B48A-F254-0404457B1783'. What im doing wrong or what could be the problem?? Thank so much for your help Seth --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: The NetStatusEvent underlying the connect error you're seeing has the code: NetConnection.Connect.CertificateUntrustedSigner This indicates that the connection is being closed because the server certificate (self-signed in your case) that you're using for your SecureRTMPEndpoint is not in your browser's trust store. This wouldn't be an issue if you were using a cert signed by a CA, but can be more trouble when dealing with self-signed certs. You need to import the server certificate into your browser's trust store - Googling around should get you the info you need. Also, the name in your server cert should match the domain name the client is hitting, in this case, 10.100.72.165, so that might be something else to double check. Other than that, your configuration looks fine based on a quick skim. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi Sent: Wednesday, December 03, 2008 2:48 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using RMTPS channel Thanks for your quickly response Seth Well this is the top of the iceberg =P the problem began when i switch to use the SecureRTMP channel
RE: [flexcoders] Re: Using RMTPS channel
The NetStatusEvent underlying the connect error you're seeing has the code: NetConnection.Connect.CertificateUntrustedSigner This indicates that the connection is being closed because the server certificate (self-signed in your case) that you're using for your SecureRTMPEndpoint is not in your browser's trust store. This wouldn't be an issue if you were using a cert signed by a CA, but can be more trouble when dealing with self-signed certs. You need to import the server certificate into your browser's trust store - Googling around should get you the info you need. Also, the name in your server cert should match the domain name the client is hitting, in this case, 10.100.72.165, so that might be something else to double check. Other than that, your configuration looks fine based on a quick skim. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi Sent: Wednesday, December 03, 2008 2:48 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using RMTPS channel Thanks for your quickly response Seth Well this is the top of the iceberg =P the problem began when i switch to use the SecureRTMP channel, my scenario is: FireFox 3 Weblogic 9.2 LiveCycle Data Services 2.5.1 I have follow the instructions of this link http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=583threadid=1242192 in order to create the keystore needed. Im using also the mx:TraceTarget/ in order to see, why the flex client is not connecting to the jms topic. My services-config.xml is the next one: channel-definition id=my-rtmps class=mx.messaging.channels.SecureRTMPChannel endpoint url=rtmps://10.100.72.165:2038 class=flex.messaging.endpoints.SecureRTMPEndpoint/ properties idle-timeout-minutes60/idle-timeout-minutes keystore-file/Users/ivanalvarez/.keystore/keystore-file keystore-passwordmysecret/keystore-password /properties /channel-definition With this configuration im getting from the flex builder console something like this: '50AAE63C-2313-1A9C-3F32-FF00D0C1EBEF' producer acknowledge of '608F502B-1676-3E78-5E1C-FF014898CB30'. 'my-rtmp' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.CertificateUntrustedSigner level = status 'B96CEE26-A82C-4240-93C1-FF014871F02A' producer acknowledge of 'F1BE9D60-E49D-C5CB-F54D-FF014A1433C2'. 'my-rtmp' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.Failed level = error 'my-rtmp' channel polling stopped. 'my-rtmp' channel connect failed. 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer channel faulted with Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038' 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer starting resubscribe timer. 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer trying to resubscribe. 'my-rtmp' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.CertificateUntrustedSigner level = status 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer trying to resubscribe. 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer trying to resubscribe. 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer trying to resubscribe. 'my-rtmp' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.Failed level = error 'my-rtmp' channel polling stopped. 'my-rtmp' channel connect failed. 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer channel faulted with Channel.Connect.Failed undefined url:'rtmps://10.100.72.165:2038' 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer trying to resubscribe. 'my-rtmp' channel got connect attempt status. (Object)#0 code = NetConnection.Connect.CertificateUntrustedSigner level = status 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer stopping resubscribe timer. 'EBCA076E-686F-8A0F-D36E-FF0148778098' consumer fault for '4843355D-D7FE-9CC7-28C8-FF0184426C29'. Does any of you have had this kind of problem, which would be the best way to solve this problem? Thank very much in advanced --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: Hi Ivan, No, SecureRTMPChannel has no dependency on SecureAMFChannel. More info here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconfig_1.html Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi Sent: Tuesday, December 02, 2008 1:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Using RMTPS channel Hi group, i have a simple question, If i want to use the SecureRTMPChannel its a must the SecureAMFChannel be enabled? Thanks in advanced. Ivan.
RE: [flexcoders] BlazeDS - Best practice for determining if server session is invalid.
Hi Fotis, The AMFChannel (and its Secure variant) define a 'hidden' method that you could override to get access to the jsessionid value that is returned to the client at connect time for your current server session. Here's the method signature: override public function AppendToGatewayUrl(value:String):void You'd want to override in your own custom subclass of AMFChannel, invoke super, and then parse and store that value somewhere for use in your file upload handler. The method name dates back to Flex 1, and will likely remain undocumented, but go ahead and log an ECR to have the value exposed as a bindable public property on the channel: https://bugs.adobe.com/blazeds/ Thanks, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fotis Chatzinikos Sent: Thursday, November 27, 2008 5:11 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] BlazeDS - Best practice for determining if server session is invalid. Seth, any ideas if there is a way to get the session id of the new session when the automatic re-login happens? Is there an event that is dispatched when this happens? At the moment i get the jsession id via an rpc call in order to use it in various places where it is needed, for example when images are uploaded to the server... On Wed, Nov 26, 2008 at 3:34 AM, Fotis Chatzinikos [EMAIL PROTECTED] wrote: Hello Seth, I had not bumped across any of this so thanks! I will have a look and hopefully -NOT- let you know (ie it will work :-) Thanks again, Fotis On Wed, Nov 26, 2008 at 2:26 AM, Seth Hodgson [EMAIL PROTECTED] wrote: Hi Fotis, The client library caches credentials in order to support seamless fallback through channels in your ChannelSet that preserves your desired authenticated identity both at connect time, as well as for automatic failover across peer servers in a cluster at any point after you've initially connected. However, when you use a simple AMF channel, where we don't know your session (connection) has timed out until a remoting call is made but fails due to an auth constraint check, we didn't originally handle that scenario seamlessly. Now we do, when you turn on the config flag I mentioned below, and it applies to remoting calls, producer messages sends, DMS operations, etc. (basically, any outbound message that fails in processing due to an auth fault when you were previously successfully authenticated). In order for this to work though, you'd need to be logging in from within the Flex app so that it has access to your creds. We provide server-side LoginCommand impls for supported app servers that plug into their various custom authentication layers and that's what Flex login requests are processed by, but we don't ship an official AcegiLoginCommand currently. I think folks in the community have implemented that though, so try Googling for it, or perhaps someone else who's written one will post a link? There's more detail here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_security_2.html And here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_security_5.html#348164 Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fotis Chatzinikos Sent: Tuesday, November 25, 2008 3:46 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] BlazeDS - Best practice for determining if server session is invalid. Hi Seth, the following line looks quite promising: It should handle this case seamlessly, removing the need to re-prompt the user with a login dialog. Can you elaborate a bit? How is that possible? In my case I use spring-acegi to login, prior to the flash component, but if there is another way - ie via a flash login box and automatic re-authentication i would love a pointer on how to do it... Thanks, Fotis On Tue, Nov 25, 2008 at 11:15 PM, Seth Hodgson [EMAIL PROTECTED] wrote: Hi, In your services-config.xml file, within the properties for the channel/endpoint you app is using to issue remoting calls to the server, try turning on the following config option: !-- Optional. Default is false. Setting this flag to true will cause clients to automatically attempt to re-authenticate themselves with the server when they send a message that fails because credentials have been reset due to server session timeout. The failed message will be resent after re-authentication making the session timeout transparent to the client with respect to authentication. -- login-after-disconnecttrue/login-after-disconnect This is also exposed as the 'loginAfterDisconnect' property on Channel, if you're building your channels and ChannelSet directly in ActionScript. It should handle this case seamlessly, removing the need to re-prompt the user with a login dialog. If you really want to reprompt the user, in your fault handler for your RemoteObject calls, you could watch for faults
RE: [flexcoders] Using RMTPS channel
Hi Ivan, No, SecureRTMPChannel has no dependency on SecureAMFChannel. More info here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconfig_1.html Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi Sent: Tuesday, December 02, 2008 1:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Using RMTPS channel Hi group, i have a simple question, If i want to use the SecureRTMPChannel its a must the SecureAMFChannel be enabled? Thanks in advanced. Ivan.
RE: [flexcoders] Param to a channel endpoint
The context root is not something that the swf can automatically substitute into the URI value at runtime on the client based on where it was served from, so you need to provide it at compile. If you're using the JEE webtier compiler that happens automatically. If you're using MXMLC at the command line, or FlexBuilder, add a the -context-root={value} compiler argument, where {value} is the actual context root for your JEE webapp. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jlopes151 Sent: Sunday, November 30, 2008 3:09 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Param to a channel endpoint Were the channel-definition is channel-definition endpoint uri=http://{server.name}/{server.port}/ {context.root}/messagebroker/fastamfpolling what happens is the {context.root} get filled with the wrapped in single quotes. I then get a Send Failed error. Were is the context.root passed? I have gotten around this by putting the channel on my mx:RemoteObject
RE: [flexcoders] BlazeDS - Best practice for determining if server session is invalid.
Hi, In your services-config.xml file, within the properties for the channel/endpoint you app is using to issue remoting calls to the server, try turning on the following config option: !-- Optional. Default is false. Setting this flag to true will cause clients to automatically attempt to re-authenticate themselves with the server when they send a message that fails because credentials have been reset due to server session timeout. The failed message will be resent after re-authentication making the session timeout transparent to the client with respect to authentication. -- login-after-disconnecttrue/login-after-disconnect This is also exposed as the 'loginAfterDisconnect' property on Channel, if you're building your channels and ChannelSet directly in ActionScript. It should handle this case seamlessly, removing the need to re-prompt the user with a login dialog. If you really want to reprompt the user, in your fault handler for your RemoteObject calls, you could watch for faults with an underlying ErrorMessage with a faultCode of Client.Authentication and use that to trigger transition back to your login view. The reason that the authenticated property doesn't change on the client is that there's no way guaranteed way for the server to notify the client when the session times out. So, it's not until you send your next request to the server that we discover that. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of rydellfinn Sent: Wednesday, November 05, 2008 6:15 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] BlazeDS - Best practice for determining if server session is invalid. Currently I am running BlazeDS on Tomcat, and I have a flex client that is authenticating against a set of Remote Objects using channelset.login(). As expected, if I walk away from the client for 30 minutes, the Tomcat server invalidates the session, which of course effectively logs out the client. What I would like to happen is when the server invalidates the session, the client is returned to the login page. I can think of different ways to accomplish this, but I was wondering if there is an established pattern for this? I tried creating a timer on the client to check if the authenticated property on the channelset was false. But I noticed that the authenticated property never changed, even after the session invalidated. I'm tempted to do the same thing on the server, but instead check to see if the session is valid, and throw an error if not. But I thought I'd check here first! Thanks in advance!
RE: [flexcoders] [CUSTOM COLLECTION SERIALIZATION - BLAZEDS]
Hi João, You can download the BlazeDS 3.2 release (milestone build) here: http://opensource.adobe.com/wiki/display/blazeds/download+blazeds+3 That should contain the fix you mention. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joao Kreuzberg Sent: Tuesday, November 25, 2008 12:16 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] [CUSTOM COLLECTION SERIALIZATION - BLAZEDS] Hi Seth, Thanks for the quick reply Seems like the problem was a bug with BlazeDS. Like I mentioned, the custom objects inside of the collection (Country for example) are working fine just the custom collection type I created that was not. The did some digging in BlazeDS code and I verified that during serialization they were checking if the given instance was a Collection before Checking if it was Externalizable. On the trunk version of BlazeDS (3.0.1) this is already fixed and Externalizable is the first type checked during serialization. I hope they get 3.0.1 out soon. Thanks João From: Seth Hodgson [EMAIL PROTECTED] To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Tuesday, November 25, 2008 4:13:43 AM Subject: RE: [flexcoders] [CUSTOM COLLECTION SERIALIZATION - BLAZEDS] Hi João, Does your custom ActionScript collection class use [RemoteClass( alias=.. .)] metadata to map to your corresponding custom Java collection class on the server? Using [RemoteClass] requires that you have a hard dependency on this custom AS collection class in your app in order for mxmlc to generate the necessary registerClassAlias call during Flex app init; if you don't have an explicit variable of this type in your app, just create a dummy variable during startup that is thrown away and gc'ed and it should do the trick. Best, Seth From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of Joao Kreuzberg Sent: Monday, November 24, 2008 12:37 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] [CUSTOM COLLECTION SERIALIZATION - BLAZEDS] Hello guys, I have a custom collection in Java and I'd like to bind it to my custom collection in Flex using AMF. I'm using BlazeDS. I implemented IExternalizable and Externalizable both ends but I still always get back a ArrayList instead of my custom implementation. The objects inside of the collection are bound correctly, only the collection that remains. Any hints about this? Regards, João
RE: [flexcoders] BlazeDS - Best practice for determining if server session is invalid.
Hi Fotis, The client library caches credentials in order to support seamless fallback through channels in your ChannelSet that preserves your desired authenticated identity both at connect time, as well as for automatic failover across peer servers in a cluster at any point after you've initially connected. However, when you use a simple AMF channel, where we don't know your session (connection) has timed out until a remoting call is made but fails due to an auth constraint check, we didn't originally handle that scenario seamlessly. Now we do, when you turn on the config flag I mentioned below, and it applies to remoting calls, producer messages sends, DMS operations, etc. (basically, any outbound message that fails in processing due to an auth fault when you were previously successfully authenticated). In order for this to work though, you'd need to be logging in from within the Flex app so that it has access to your creds. We provide server-side LoginCommand impls for supported app servers that plug into their various custom authentication layers and that's what Flex login requests are processed by, but we don't ship an official AcegiLoginCommand currently. I think folks in the community have implemented that though, so try Googling for it, or perhaps someone else who's written one will post a link? There's more detail here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_security_2.html And here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_security_5.html#348164 Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fotis Chatzinikos Sent: Tuesday, November 25, 2008 3:46 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] BlazeDS - Best practice for determining if server session is invalid. Hi Seth, the following line looks quite promising: It should handle this case seamlessly, removing the need to re-prompt the user with a login dialog. Can you elaborate a bit? How is that possible? In my case I use spring-acegi to login, prior to the flash component, but if there is another way - ie via a flash login box and automatic re-authentication i would love a pointer on how to do it... Thanks, Fotis On Tue, Nov 25, 2008 at 11:15 PM, Seth Hodgson [EMAIL PROTECTED] wrote: Hi, In your services-config.xml file, within the properties for the channel/endpoint you app is using to issue remoting calls to the server, try turning on the following config option: !-- Optional. Default is false. Setting this flag to true will cause clients to automatically attempt to re-authenticate themselves with the server when they send a message that fails because credentials have been reset due to server session timeout. The failed message will be resent after re-authentication making the session timeout transparent to the client with respect to authentication. -- login-after-disconnecttrue/login-after-disconnect This is also exposed as the 'loginAfterDisconnect' property on Channel, if you're building your channels and ChannelSet directly in ActionScript. It should handle this case seamlessly, removing the need to re-prompt the user with a login dialog. If you really want to reprompt the user, in your fault handler for your RemoteObject calls, you could watch for faults with an underlying ErrorMessage with a faultCode of Client.Authentication and use that to trigger transition back to your login view. The reason that the authenticated property doesn't change on the client is that there's no way guaranteed way for the server to notify the client when the session times out. So, it's not until you send your next request to the server that we discover that. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of rydellfinn Sent: Wednesday, November 05, 2008 6:15 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] BlazeDS - Best practice for determining if server session is invalid. Currently I am running BlazeDS on Tomcat, and I have a flex client that is authenticating against a set of Remote Objects using channelset.login(). As expected, if I walk away from the client for 30 minutes, the Tomcat server invalidates the session, which of course effectively logs out the client. What I would like to happen is when the server invalidates the session, the client is returned to the login page. I can think of different ways to accomplish this, but I was wondering if there is an established pattern for this? I tried creating a timer on the client to check if the authenticated property on the channelset was false. But I noticed that the authenticated property never changed, even after the session invalidated. I'm tempted to do the same thing on the server, but instead check to see if the session is valid, and throw an error if not. But I thought I'd check here first! Thanks in advance! -- Fotis Chatzinikos, Ph.D
RE: [flexcoders] [CUSTOM COLLECTION SERIALIZATION - BLAZEDS]
Hi João, Does your custom ActionScript collection class use [RemoteClass(alias=...)] metadata to map to your corresponding custom Java collection class on the server? Using [RemoteClass] requires that you have a hard dependency on this custom AS collection class in your app in order for mxmlc to generate the necessary registerClassAlias call during Flex app init; if you don't have an explicit variable of this type in your app, just create a dummy variable during startup that is thrown away and gc'ed and it should do the trick. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joao Kreuzberg Sent: Monday, November 24, 2008 12:37 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] [CUSTOM COLLECTION SERIALIZATION - BLAZEDS] Hello guys, I have a custom collection in Java and I'd like to bind it to my custom collection in Flex using AMF. I'm using BlazeDS. I implemented IExternalizable and Externalizable both ends but I still always get back a ArrayList instead of my custom implementation. The objects inside of the collection are bound correctly, only the collection that remains. Any hints about this? Regards, João
RE: [flexcoders] mx:consumer bandwidth questions
Hi Jitendra, Selector expressions defined by a Consumer that subscribes to a JMS messaging destination are passed through to the JMS server and evaluated there. Only messages that arrive at your JMS server that satisfy the selector expression will be forwarded to the JMS Consumer proxy running within BlazeDS or LCDS, and from there on out to the Consumer in your Flex. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jitendra jain Sent: Friday, November 21, 2008 11:04 PM To: flex group flex Subject: [flexcoders] mx:consumer bandwidth questions Hi coders, I have a consumer that gets the messages from ACTIVEMQ. I am using a selector property for filtering of message. Does it uses the bandwidth ? I want to know the bandwidth usage with and without selector property. Thanks for your valuable advices in advance. Thanks, with Regards, Jitendra Jain Be the first one to try the new Messenger 9 Beta! Click here.
RE: [flexcoders] [Servlet Error]-[MessageBrokerServlet]: Secure must be contacted via secure prot
I'd suggest checking the console for startup errors (you could alternately use the ServletLogTarget to route log output to your servlet container's log files). The client is receiving a 404 attempting to interact with your BlazeDS endpoint, that should be available at: https://www.myserver.com/costmodel/costmodel/ messagebroker/amfsecure Once your server is starting up correctly, assuming the URL above is correct, the client-side channel shouldn't have any trouble accessing the corresponding endpoint on the server. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sachin_52263 Sent: Tuesday, October 14, 2008 1:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] [Servlet Error]-[MessageBrokerServlet]: Secure must be contacted via secure prot We are using flex 3, blazeDS and Java Application (spring, hibernate, DB2). We are using WebSphere server. We tested our project on local and dev and its worked fine (on http channel). Now we are moving to QA where the development environment is slightly changed. We have 2 servers on QA. We are using IBM-TAM for security and clustering we are using WebSphere server. I am new to blazeDS and do not know how it works on cluster environment. I am getting the following error when I try to navigate to flex screen. Please help me to solve this issue. Error: Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'https://www.myserver.com/costmodel/costmodel/ messagebroker/amfsecure' [ChannelFaultEvent faultCode=Channel.Connect.Failed faultString=error faultDetail=NetConnection.Call.Failed: HTTP: Status 404: url: 'https://www.myserver.com/costmodel/costmodel/ messagebroker/amfsecure' channelId=my-secure-amf type=channelFault bubbles=false cancelable=false eventPhase=2] -- the service-config.xml file is: -- ?xml version=1.0 encoding=UTF-8? services-config services service-include file-path=remoting-config.xml / service-include file-path=proxy-config.xml / service-include file-path=messaging-config.xml / /services security login-command class=flex.messaging.security.WebSphereLoginCommand server=WebSphere/ /security channels channel-definition id=my-amf class=mx.messaging.channels.AMFChannel endpoint url=http://{server.name}:{server.port}/ costmodel /messagebroker/amf class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition channel-definition id=my-secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint url=https://{server.name}:{server.port}/ costmodel/messagebroker/amfsecure class=flex.messaging.endpoints.SecureAMFEndpoint/ properties add-no-cache-headersfalse/add-no-cache-headers /properties /channel-definition channel-definition id=my-polling-amf class=mx.messaging.channels.AMFChannel endpoint url=http://{server.name}:{server.port}/ costmodel/messagebroker/amfpolling class=flex.messaging.endpoints.AMFEndpoint/ properties polling-enabledtrue/polling-enabled polling-interval-seconds4/polling-interval- seconds /properties /channel-definition /channels logging target class=flex.messaging.log.ConsoleTarget level=Error properties prefix[BlazeDS] /prefix includeDatefalse/includeDate includeTimefalse/includeTime includeLevelfalse/includeLevel includeCategoryfalse/includeCategory /properties filters patternEndpoint.*/pattern patternService.*/pattern patternConfiguration/pattern /filters /target /logging system redeploy enabledfalse/enabled /redeploy /system /services-config -- The remoting-config.xml file: -- ?xml version=1.0 encoding=UTF-8? service id=remoting-service class=flex.messaging.services.RemotingService adapters adapter-definition id=java-object class=flex.messaging.services.remoting.adapters.JavaAdapter default=true/ /adapters default-channels channel ref=my-secure-amf/ /default-channels destination id=destination1 properties sourcecom.searshc.Reporting/source /properties /destination /service
RE: [flexcoders] Remote calls are not happening using blazeDS in secured environment
You need to use a SecureAMFChannel to interact with a SecureAMFEndpoint. It’s not clear from your emails why the server is receiving HTTP requests rather than HTTPS requests. If you’re using a SecureAMFChannel on the client, its requests will be sent via HTTPS. If you have something in front of your server that’s handling HTTPS (say a hardware SSL accelerator) that passes insecure HTTP requests back to the server, you need to mix and match a secure channel class for the hop from the client to the SSL appliance, with an insecure endpoint for the hop from the SSL appliance to the app server. The config for this would be something like: channel-definition id=secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint url=https://{server.name}:{server.port}/secureamf; class=flex.messaging.endpoints.AMFEndpoint/ … Note the secure channel class, secure endpoint URL and insecure endpoint class. But again, you only need to configure things this way when you have a component between the client and server handling SSL. Hope that helps, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of venkateswarlu naidu Sent: Thursday, October 09, 2008 8:23 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Remote calls are not happening using blazeDS in secured environment Here is the exact error message that i am seeing in the server console secure endpoint /messageborker/secureamf must be contacted via secure protocol Please help me on this. Thanks Regards, Venkat. - Original Message From: venkateswarlu naidu [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Thursday, 9 October, 2008 9:33:56 PM Subject: [flexcoders] Remote calls are not happening using blazeDS in secured environment Hi All, Even after adding my-secure-amf channel to remote-config. xml, our flex application coludn,t make remote calls. I am seeing a failover to HTTP from a HTTPS request in the http url log, dont know why it is failing over to HTTP://context/messagebroker/ amf from HTTPS://context/messagebroker/ secureamf in a secured environment. Actually this failover is not happening in DEV (in which we have both HTTP and HTTPS enabled). The problem is specific to QA env (weblogic+clustered +secured) , i dont have any clues. Can any body help me on this? Thanks Regards, Venkat. - Original Message From: venkateswarlu naidu contactvenku@ yahoo.co. in To: [EMAIL PROTECTED] ups.com Sent: Wednesday, 8 October, 2008 10:41:13 PM Subject: [flexcoders] could not establish connection to java data service from flex client using blazeDS Hi All, We have a flex+blazeDS+ Java based application, after deploying the application in QA env, java data service calls are not happening. When i see the URL log in HTTP sniffer tool, the request is getting stopped at URL context-root /messagebroker/ amf and finally seeing 502 (CANNOT_CONNECT) status. The same application is working fine in DEV environment. Our QA environment: secured, HTTPS, running behind firewalls and clustered. Why the flex client can not connect to the java data services? Any help is greatly appreciated. Thanks Regards, Venkat.
RE: [flexcoders] Check for open data service transactions before calling logout
Hi Taze, When the client disconnects, either of its own initiative in this case or due to a network problem out of its control, any outstanding calls are faulted and we let you know that their delivery to the server is in doubt. They may have reached the server, they may not have, we don't know. If the user really is logging out, they're in effect discarding any pending work so you could probably just ignore these faults in this case. There aren't versions of these methods that wait for all outstanding calls to complete. If that's a policy you'd like to follow your app, you can track the AsycnTokens for all your outstanding calls (for DataService you'd probably want to issue explicit commits()) and if the user attempts to logout or disconnect while calls are still outstanding, you could just take note of that and issue a delayed logout/disconnect call once all pending calls return. But that could take awhile, so if you do something like that, put a notice up in the UI letting the user know what you're doing and possibly give them an escape hatch that just goes ahead and logouts/disconnects while pending calls are still outstanding if they really want to just shutdown immediately. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of taze170171 Sent: Thursday, September 18, 2008 8:09 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Check for open data service transactions before calling logout Hi! If the user presses the logout button and ds.disconnectAll() is called before every dataservice call has been finished the following error occurs: doFault:[RPC Fault faultString=Channel disconnected faultCode=Client.Error.DeliveryInDoubt faultDetail=Channel disconnected before an acknowledgement was received] Is there a possibility to check for open transactions or messages which have not been sent yet to the dataservice before calling channelSet.disconnectAll() or channelSet.logout()? Or is there a disconnect or logout method which waits until all data service calls have been finished? Thnx, Taze
RE: [flexcoders] BlazeDS clustering
Hi Fabien, The subscribeFromPeer() method is invoked when a subscription is added or removed on a peer server in the cluster that this server may need to know about. The NPE is happening because the destination that the subscription was added to or removed from doesn't exist on the current server. Verify that your servers are both starting up correctly and that your destinations are fully symmetric. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of fabien.deshayes Sent: Thursday, September 18, 2008 5:30 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] BlazeDS clustering Hello, I'm trying to install a cluster with BlazeDS. After some difficulties, I've reached a point where my 2 servers A and B know each other, and that when a client subscribe on a destination on server A, this server send a message to the server B. Unfortunately, this does not work and I've got this error: [BlazeDS]09/18/2008 [ERROR] [Service.Cluster] Error handling message pushed from cluster: java.lang.NullPointerException [BlazeDS]09/18/2008 [ERROR] [Service.Cluster] Exception=java.lang.NullPointerException at flex.messaging.services.MessageService.subscribeFromPeer(MessageService.java:747) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at flex.messaging.cluster.JGroupsCluster$ServiceOperationHandler.handleBroadcast(JGroupsCluster.java:538) at flex.messaging.cluster.JGroupsCluster.handle(JGroupsCluster.java:417) at org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:577) at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:624) at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:533) at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:365) at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:736) at org.jgroups.JChannel.up(JChannel.java:1063) at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:325) at org.jgroups.protocols.pbcast.GMS.up(GMS.java:722) at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234) at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:720) at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:546) at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167) at org.jgroups.protocols.FD.up(FD.java:322) at org.jgroups.protocols.MERGE2.up(MERGE2.java:145) at org.jgroups.protocols.Discovery.up(Discovery.java:220) at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1486) at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1440) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) [Incoming Thread,default-cluster,10.193.137.195:7800] ERROR org.jgroups.blocks.RequestCorrelator - error invoking method flex.messaging.cluster.ClusterException: Unable to replicate a service operation received from a broadcast on cluster id 'default-cluster'. at flex.messaging.cluster.JGroupsCluster$ServiceOperationHandler.handleBroadcast(JGroupsCluster.java:552) at flex.messaging.cluster.JGroupsCluster.handle(JGroupsCluster.java:417) at org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:577) at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:624) at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:533) at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:365) at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:736) at org.jgroups.JChannel.up(JChannel.java:1063) at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:325) at org.jgroups.protocols.pbcast.GMS.up(GMS.java:722) at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234) at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:720) at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:546) at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167) at org.jgroups.protocols.FD.up(FD.java:322) at org.jgroups.protocols.MERGE2.up(MERGE2.java:145) at org.jgroups.protocols.Discovery.up(Discovery.java:220) at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1486) at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1440) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) The destination is dynamically created, with these lines: MessageService service = getService(); MessageDestination destination = (MessageDestination) service.getDestination(destinationId); // set the cluster
RE: [flexcoders] IOException on DataService closing
Cedric, Our NIO subsystem in LCDS was refactored for the 2.6 release to allow us to support multiple higher level protocols in addition to RTMP so some things, including some logging output have changed from 2.5.x to 2.6. When a client shuts down, or manually disconnects an RTMPChannel, the server TCP stack may receive an abort for the socket rather than a TCP close handshake – that’s fine, I’m just pointing out that there are different ways that the server is notified of a socket closing. In the case of an abort, we receive an IOException for the socket, but we handle it – you don’t need to. Our handler code simply logs out at the debug level when this happens, because as I said before, when you’re debugging low level connectivity it’s useful to see as much of exactly what is going on as possible. So, we have: try { // Read from the Connection – in most cases we read some data sent by the client. // If the client closed its end of the socket with a TCP FIN handshake we read an EOF and close down our end. // We may get an IOException from our read call for a variety of reasons; one of which is the client aborting // the socket. … code … } catch (IOException e) { if (Log.isDebug()) Log.getLogger(logCategory).debug(Thread.currentThread() + failed to read Connection ' + id + '; connection will close., e); } As you can see here, the IOException is fully handled. In the case of a client simply aborting its TCP socket it isn't really an error condition even though Java throws us an IOException, so there's nothing else you need to do. If something in your app is breaking, let us know. Otherwise, just ignore this debug level log statement, or raise your server log level above DEBUG or don't include SocketServer.* in your server log filters in which case this won’t be output to your log file. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of kcCedrics Sent: Wednesday, September 17, 2008 12:17 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] IOException on DataService closing Hi Seth, thanks for your answer. The thing I don't understand is that error doesn't appear when I used LCDS 2.5!! it appears just since I use the 2.6 version. So, is there any way to catch this exception?? or maybe there's another way to disconnect a channel from DataService? Cédric
RE: [flexcoders] Re: LCDS and real-time performance
Glad to hear it and thanks for the update Rogier. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rogier Oorburg Sent: Tuesday, September 16, 2008 7:43 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: LCDS and real-time performance Thank you very much for your reply, it helped us a lot. We were able to process all of the required updates within one second, by changing the framerate-property of the client-application to a value beyond the 60 fps. By using a browser where the flashplayer is not locked at max 60 frames, like firefox 3, we were able to process a lot more messages per second. This way we could even achieve our goal of displaying 1000 updated objects per second. Thank you all for your help. Maybe it could be of some help to others to switch browsers to be able gain a performance boost like described above. Rogier --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: Hi Rogier, The core RTMP code in the player throttles the processing of inbound RTMP data, so there's an upper bound on the number of received messages that will be dispatched per frame on the client. This is done to prevent wedging playback in the player. If I generate a burst of 100 messages that are pushed to a subscribed Flex client over an RTMP connection, the duration on the client between processing the first and last message in my ActionScript handler is ~190ms. Scale that to 400 messages and I'm up closer to 800ms. This has nothing to do with the underlying network IO or AMF serialization/deserialization - and it's a feature, not a defect. If you ramp the server generated burst size up to a large value (say 1000 or 10K) and monitor low level network traffic, you can see that writing the data to the player is quick, but dispatch of all those messages into ActionScript is slower because of this core throttling in the player. The player generally is rendering at around 24 frames/sec. If you're sending 400+ updates per second that's way beyond the player's UI refresh rate, and way past a monitor's refresh rate, so there's no way to even render updates at that rate. What you want to do in this scenario is throttle the number of updates/messages you're pushing per second. Perhaps the simplest way to do this would be to lower the sampling rate at your update source. If this is a Flex client using DataService, try turning off auto-commit, and only committing changes on a wider interval - like 10 or 25 times per second rather than 400+ times. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rogier Oorburg Sent: Monday, August 25, 2008 11:31 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: LCDS and real-time performance Thanks for the reply... I'm sure the server-side logging is not the problem, the same effects are seen without the server writing all this information. Even if we only do client-side logging we still get the same results. I think we ruled out the database being a bottleneck by using the Actionscript-adapter on the server, which again gets us the same results. That is why I still think our bottleneck is in the RTMP/AMF communication and this is backed-up by the server-side logging. Does anybody have experience with performance issues using RTMP/AMF? Greetings, Rogier --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, seth_hodgson shodgson@ wrote: Hi Rogier, You shouldn't place any weight on timing metrics captured while the server has debug level logging enabled. The IO overhead to output all the debug level logging to a console or log file will drastically skew your numbers. I'd recommend running your test wihtout debug level logging and capturing timing data at the client; say by keeping track of deltas between each message/update received. Be careful that your own logging at the server isn't acting as a bottleneck, and the database could definitely become a bottleneck at high rates of updates. Seth --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Rogier Oorburg rogier_oorburg@ wrote: Hi Jeff, Thank you for your reply. I have gathered some more logging information in this mail. To maybe make clearer where all the time is spent. Is there a way to set the packet-size (or 'chunk' size?) to be able to send rather large messages (or a lot of small ones) more efficiently? Or could there be some other cause for this slow communication between client and server? Thanks, hope these loggings shed some light on the situation... [LCDS] 08:06:40.406 [DEBUG] [SocketServer.General] Thread[my-nio- server-WorkerThread-2,5,main] Connection '9194103' starting a read. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 1 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio
RE: [flexcoders] IOException on DataService closing
Hi Cedric, That log message is just informational – it’s not an error. When a client goes away or closes its socket, often times the server TCP stack and JVM will get an IOException rather than reading a clean EOF for the socket. These messages can be useful when you’re troubleshooting networking issues, but in general you should run with the server log level at WARN or ERROR, not INFO or DEBUG. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of kcCedrics Sent: Tuesday, September 16, 2008 2:05 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] IOException on DataService closing Hi, thanks for your answer. I added the includeCategory=true option to the logging and now I'm getting this exception: 2008-09-16 10:58:51,150 INFO [STDOUT] [LCDS] [SocketServer.General] Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] Connection '9510837' starting a read. 2008-09-16 10:58:51,165 INFO [STDOUT] [LCDS] [SocketServer.General] Thread[my-rtmp-SocketServer-WorkerThread-1,5,jboss] failed to read Connection '9510837'; connection will close. java.io.IOException: Une connexion existante a dû être fermée par l'hôte distant at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(Unknown Source) at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) at sun.nio.ch.IOUtil.read(Unknown Source) at sun.nio.ch.SocketChannelImpl.read(Unknown Source) at flex.messaging.socketserver.Connection.doRead(Connection.java:508) at flex.messaging.socketserver.Connection$ConnectionReader.run(Connection.java:761) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Unknown Source) So I guess the pattern is [SocketServer.General] but I don't know what to do with that :) I'm running on LCDS 2.6, and like you I didn't see this message in 2.5!! Cédric -- View this message in context: http://www.nabble.com/IOException-on-DataService-closing-tp19488626p19508051.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] BlazeDS FlexSessionListener
http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=lcconnections_4.html#1076159 A browser closing has no immediate correlation to a server-side Http session being destroyed. Session destruction is generally based on a configurable timeout interval defined for the server (often in the range of 15 to 30 minutes). You can follow the advice in the docs above for notifying the server that the client has gone away and triggering session destruction in a near-real-time fashion. Also, registering for session creation notification is static, but registering for session destruction notification is per session instance. You can add your session destroy listener (generally the same impl class) from within your sessionCreated handler method. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of j301c Sent: Wednesday, September 10, 2008 4:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] BlazeDS FlexSessionListener Has anyone had any success with using the FlexSessionListener with BlazeDS. My listener calls the sessionCreated method when the session starts, but the sessionDestroyed method is never called when the user closes the browser. Is this something only supported in Flex Data Services? Any tips appreciated, thanks.
RE: [flexcoders] Execute webservice on browser close
You need to keep the browser alive long enough for the request to be written to the network. There's no hook available in the Player for running code on shutdown/exit, which is good because if there was malicious swfs could prevent a browser from closing. I'd recommend catching the onunload event in Javascript, popping an alert (i.e. Shutting down...), and then triggering your web service call in the Player using ExternalInterface. The Javascript alert improves your chances of the call making it onto the network because the user has to manually click to close the alert box, and users are generally slower than the machines they're using. The browser process won't exit until the user has responded to the alert. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jfournet Sent: Wednesday, September 03, 2008 6:55 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Execute webservice on browser close I am trying to execute a webservice using fds on browser close. It seems like all of the flex as code gets executed, but flex fails to send the xml to the server on which the webservice resides. I have tries putting delays on the flex and javascript side, but the webservice only executes intermittently.
RE: [flexcoders] Re: Where is URLRequest data on server side
From the livedocs for URLRequest: If the object is a URLVariables object and the method is POST, the variables are encoded using x-www-form-urlencoded format and the resulting string is used as POST data. So do that rather than sending them in the query string. There's no general size limit on the body of a POST, and the HttpServletRequest parameter map gives you access to parameters sent either in the query string or in a POST body when they're encoded this way. You don't need to deal with the request object's input stream directly. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of schneiderjim Sent: Friday, August 29, 2008 12:00 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Where is URLRequest data on server side Thanks Seth. The problem is that I have a large (and growing) number of parameters (or rather, a large number of characters in the parameters) and I think I'm exceeding the limits of the HTTP query string/parameter map (I was thinking the limit was 256 or 1024 depending on get vs post). More specifically, I have a grid that I want to throw into a PDF. I use JasperReports on the backend. So, my first solution was to send the object IDs from the grid to the server, have the server do a bulk query, and then have JasperReports return the PDF. The problem now is that the list of IDs is growing and the actual number of characters is increasing. For example, the IDs used to be 1,2,3,..., now the are 10,11,12, . In the URL to my servlet, I do the following: myurl?ids=1,2,3 now myurl?ids=11,12,13 And so on. When I experience the issue, it's as if the request never even gets out the client, although I have yet to track that down (doing that now). I could change the parameters list to just send the search criteria (which generates the list/grid in the first place), but there is also some filtering involved, and I had hoped to not need to recreate the search/filter logic again on the server side. Thanks --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: Hi Jim, Be sure to set your request.method = URLRequestMethod.POST and assign your URLVariables to the data property of your URLRequest and then pass that to navigateToURL(...). On the server, you can access these name/value pairs as request parameters (HttpServletRequest#getParameterMap()). Using navigateToURL() is the right way to do this. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of schneiderjim Sent: Thursday, August 28, 2008 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Where is URLRequest data on server side Bump. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, schneiderjim jschneider@ wrote: I'm using URLRequest and navigateToUrl to invoke a server side (java servlet) reporting function (returns PDF in new browser window). To get it to work quickly, i just attached HTTP parameters to the URL and grabbed them from the HTTPServletRequest on the server. However, I believe we are now hitting the limit on the query string, and I'd rather not do this anyway. I've looked at the URLVariables and the data property and that seemed like what I should do, but on the server, I'm not sure where I would grab that data in my servlet. Does that come through the InputStream somehow? Would HTTPService be better (noting that I need to pop the resulting PDF into a new window)? Any pointers to docs or samples would be appreciated. Thx, Jim
RE: [flexcoders] Flex RemoteObject and Browser cookies
The Player uses the browser's HTTP stack, so outbound remoting requests will automatically carry any cookies that were previously set by the target domain (mod constraints like cookie paths, etc. that may limit the scope of the cookie). Double check that the cookies you're wanting to see actually apply to the domain/path/etc. that the remoting request is sent to. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vijay Ganesan Sent: Friday, August 29, 2008 1:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex RemoteObject and Browser cookies I have Flex-based Flash content running within a DHTML page. The swf contained in the page makes RemoteObject (mx.rpc.remoting.mxml.RemoteObject) calls to the backend servlet. In these calls, I need to be able to send the Browser cookies set by the containing DHTML app. Currently the only cookie that seems to come through is the JSESSION cookie. I realize I can read the Browser cookies using ExternalInterface to invoke JavaScript, but once the cookies are read, how does one pass these cookies along when making a RemoteObject call in my Flex code? Thanks Vijay
RE: [flexcoders] Re: Where is URLRequest data on server side
Hi Jim, Be sure to set your request.method = URLRequestMethod.POST and assign your URLVariables to the data property of your URLRequest and then pass that to navigateToURL(...). On the server, you can access these name/value pairs as request parameters (HttpServletRequest#getParameterMap()). Using navigateToURL() is the right way to do this. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of schneiderjim Sent: Thursday, August 28, 2008 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Where is URLRequest data on server side Bump. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, schneiderjim [EMAIL PROTECTED] wrote: I'm using URLRequest and navigateToUrl to invoke a server side (java servlet) reporting function (returns PDF in new browser window). To get it to work quickly, i just attached HTTP parameters to the URL and grabbed them from the HTTPServletRequest on the server. However, I believe we are now hitting the limit on the query string, and I'd rather not do this anyway. I've looked at the URLVariables and the data property and that seemed like what I should do, but on the server, I'm not sure where I would grab that data in my servlet. Does that come through the InputStream somehow? Would HTTPService be better (noting that I need to pop the resulting PDF into a new window)? Any pointers to docs or samples would be appreciated. Thx, Jim
RE: [flexcoders] Which ports to open with BlazeDS / LCDS?
Hi Simon, The ports used by BlazeDS/LCDS depend on the channel(s)/endpoint(s) the app is using and how they're configured in services-config.xml. BlazeDS only supports Servlet-based endpoints, so the port for those must be whatever your Servlet container is configured to use. If you're running in something other than the Tomcat turnkey you should edit the services-config.xml file for your app and specify the proper port in your endpoint urls. The NIO endpoints in LCDS (RTMP and NIO AMF/HTTP) can be configured to use any port that's available on your server. If you want to change the ports they use, it's the same process, edit the port value in the services-config.xml file for the app. It's probably worth skimming the corresponding docs for this area if you haven't: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/lcconfig_1.html Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of simonwidjaja Sent: Thursday, August 28, 2008 3:59 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Which ports to open with BlazeDS / LCDS? Hey guys! I want to run the collaboration dashboard example of the turnkey version of BlazeDS/LCDS. Locally everything works fine. But when I deploy it to my webserver the connection fails. Turning off the server's firewall makes the example work. I've tried to open several ports but it does not work. Can somebody tell me all the specific ports that are used by BlazeDS by default? (The remoting stuff already works fine...) Thanx! Simon
RE: [flexcoders] Re: LCDS and real-time performance
Hi Rogier, The core RTMP code in the player throttles the processing of inbound RTMP data, so there's an upper bound on the number of received messages that will be dispatched per frame on the client. This is done to prevent wedging playback in the player. If I generate a burst of 100 messages that are pushed to a subscribed Flex client over an RTMP connection, the duration on the client between processing the first and last message in my ActionScript handler is ~190ms. Scale that to 400 messages and I'm up closer to 800ms. This has nothing to do with the underlying network IO or AMF serialization/deserialization - and it's a feature, not a defect. If you ramp the server generated burst size up to a large value (say 1000 or 10K) and monitor low level network traffic, you can see that writing the data to the player is quick, but dispatch of all those messages into ActionScript is slower because of this core throttling in the player. The player generally is rendering at around 24 frames/sec. If you're sending 400+ updates per second that's way beyond the player's UI refresh rate, and way past a monitor's refresh rate, so there's no way to even render updates at that rate. What you want to do in this scenario is throttle the number of updates/messages you're pushing per second. Perhaps the simplest way to do this would be to lower the sampling rate at your update source. If this is a Flex client using DataService, try turning off auto-commit, and only committing changes on a wider interval - like 10 or 25 times per second rather than 400+ times. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rogier Oorburg Sent: Monday, August 25, 2008 11:31 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: LCDS and real-time performance Thanks for the reply... I'm sure the server-side logging is not the problem, the same effects are seen without the server writing all this information. Even if we only do client-side logging we still get the same results. I think we ruled out the database being a bottleneck by using the Actionscript-adapter on the server, which again gets us the same results. That is why I still think our bottleneck is in the RTMP/AMF communication and this is backed-up by the server-side logging. Does anybody have experience with performance issues using RTMP/AMF? Greetings, Rogier --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, seth_hodgson [EMAIL PROTECTED] wrote: Hi Rogier, You shouldn't place any weight on timing metrics captured while the server has debug level logging enabled. The IO overhead to output all the debug level logging to a console or log file will drastically skew your numbers. I'd recommend running your test wihtout debug level logging and capturing timing data at the client; say by keeping track of deltas between each message/update received. Be careful that your own logging at the server isn't acting as a bottleneck, and the database could definitely become a bottleneck at high rates of updates. Seth --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Rogier Oorburg rogier_oorburg@ wrote: Hi Jeff, Thank you for your reply. I have gathered some more logging information in this mail. To maybe make clearer where all the time is spent. Is there a way to set the packet-size (or 'chunk' size?) to be able to send rather large messages (or a lot of small ones) more efficiently? Or could there be some other cause for this slow communication between client and server? Thanks, hope these loggings shed some light on the situation... [LCDS] 08:06:40.406 [DEBUG] [SocketServer.General] Thread[my-nio- server-WorkerThread-2,5,main] Connection '9194103' starting a read. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 1 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 7 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 128 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 1 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 128 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 1 bytes. [LCDS] 08:06:40.406 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 128 bytes. ... [LCDS] 08:06:40.421 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing 1 bytes. [LCDS] 08:06:40.421 [DEBUG] [Protocol.RTMP] Thread[my-nio-server- WorkerThread-2,5,main] chunk input stream processing
RE: [flexcoders] Re: RTMP and Spring Security(Acegi) Issues - SOLVED
In the case of RTMP, the doAuthentication() hook of your LoginCommand runs when the client invokes ChannelSet.login(...) or as a result of invoking the legacy setCredentials() method on service components. The advantage of using ChannelSet.login() is that it gives you back a token for the call that you can register a responder with. setCredentials() may or may not even make a login call, depending on whether the client is connected, and when the login happens there's no good way to handle faults. If doAuthentication() is successful the returned Principal is cached in the FlexSession. Because RTMP connections are long-lived and stateful, this will only happen once. After that, any client interaction with a destination secured with a security constraint will trigger a call to doAuthentication() - you get the cached Principal and the list of roles to test for membership in. So this hook will likely be called many times. If you security system depends on any extra context, say in thread locals, your login command would need to manage that properly. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Sent: Monday, August 25, 2008 4:00 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: RTMP and Spring Security(Acegi) Issues - SOLVED I was wondering if anyone knows exactly when the AcegiLoginCommand class gets processes. Does it get processed once when you create a DataService object, or does it get processed every time an RTMP request is made? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Geoffrey [EMAIL PROTECTED] wrote: One last thing I had to do to get it to work. I added -Dacegi.security.strategy=MODE_INHERITABLETHREADLOCAL to my Tomcat JVM arguments. Otherwise, setting and getting the Authentication object was accessing different instances of some security object. ~Geoff --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Geoffrey gtb104@ wrote: I seem to have got it working. Thanks for your help jahhaj12345! What I ended up doing was to create a custom LoginCommand class. I used the one from here: http://blog.f4k3.net/fake/entry/acegi_logincommand_for_fds. I made two changes shown below: //The name of our Acegi configuration file. private static String[] CONFIG_LOCATIONS = {classpath:security-context.xml}; //ldapAuthenticationProvider is from our Acegi config file, and it the name of the bean that is used for authentication via LDAP. authenticationProvider = (AuthenticationProvider)applicationContext.getBean(ldapAuthenticationProvider); I then updated services-config.xml and added: security login-command class=com.gdais.security.AcegiLoginCommand server=Tomcat/ security-constraint id=basic-read-access auth-methodBasic/auth-method roles roleROLE_MANAGERS/role roleROLE_USERS/role /roles /security-constraint /security //The roles came from the Acegi config file. After that, I had to add the [managed] metadata tag to one of my ValueObjects and it all seemed to work. I'll be honest, I don't really understand why this works, it just does. What I mean by 'works' is that the managed collection on the client gets filled with data successfully. I haven't yet tested pushing new entries to that managed collection after the initial fill. I hope this post helps someone else. ~Geoff --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, jahhaj12345 halvorsonj@ wrote: I don't know of a way to just authenticate the client. From everything I've read, you have to authenticate the HTTP and RTMP sessions individually. For my application, I had to create my own LoginCommand to handle the flex RTMP authentication. Here's my understanding of how it's working for me: 1. On my client, I get the channelset to use and then call channelSet.login(username, password). You could also call the setCredentials on the actual DataService the same way, but my services are all created at runtime on the server instead of being statically defined in services-config.xml. 2. That channelSet (or dataservice) from above authenticates through the login-command configured in services-config.xml. This is where the custom LoginCommand I created is configured. The doAuthentication function of LoginCommand is as follows: public Principal doAuthentication(String username, Object credentials) { Authentication auth = authenticationProvider.authenticate(new UsernamePasswordAuthenticationToken(username, credentials)); // authenticationProvider is a spring security DaoAuthenticationProvider SecurityContextHolder.getContext().setAuthentication(auth); return auth; } This should authenticate the RTMP session. I don't know if this is the best way, but it seems to work. --- In
RE: [flexcoders] Re: RTMP and Spring Security(Acegi) Issues - SOLVED
Make that: After that, any client interaction with a destination secured with a security constraint will trigger a call to doAuthorization() Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Seth Hodgson Sent: Tuesday, August 26, 2008 10:18 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: RTMP and Spring Security(Acegi) Issues - SOLVED In the case of RTMP, the doAuthentication() hook of your LoginCommand runs when the client invokes ChannelSet.login(...) or as a result of invoking the legacy setCredentials() method on service components. The advantage of using ChannelSet.login() is that it gives you back a token for the call that you can register a responder with. setCredentials() may or may not even make a login call, depending on whether the client is connected, and when the login happens there's no good way to handle faults. If doAuthentication() is successful the returned Principal is cached in the FlexSession. Because RTMP connections are long-lived and stateful, this will only happen once. After that, any client interaction with a destination secured with a security constraint will trigger a call to doAuthentication() - you get the cached Principal and the list of roles to test for membership in. So this hook will likely be called many times. If you security system depends on any extra context, say in thread locals, your login command would need to manage that properly. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Sent: Monday, August 25, 2008 4:00 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: RTMP and Spring Security(Acegi) Issues - SOLVED I was wondering if anyone knows exactly when the AcegiLoginCommand class gets processes. Does it get processed once when you create a DataService object, or does it get processed every time an RTMP request is made? --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Geoffrey [EMAIL PROTECTED] wrote: One last thing I had to do to get it to work. I added -Dacegi.security.strategy=MODE_INHERITABLETHREADLOCAL to my Tomcat JVM arguments. Otherwise, setting and getting the Authentication object was accessing different instances of some security object. ~Geoff --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Geoffrey gtb104@ wrote: I seem to have got it working. Thanks for your help jahhaj12345! What I ended up doing was to create a custom LoginCommand class. I used the one from here: http://blog.f4k3.net/fake/entry/acegi_logincommand_for_fds. I made two changes shown below: //The name of our Acegi configuration file. private static String[] CONFIG_LOCATIONS = {classpath:security-context.xml}; //ldapAuthenticationProvider is from our Acegi config file, and it the name of the bean that is used for authentication via LDAP. authenticationProvider = (AuthenticationProvider)applicationContext.getBean(ldapAuthenticationProvider); I then updated services-config.xml and added: security login-command class=com.gdais.security.AcegiLoginCommand server=Tomcat/ security-constraint id=basic-read-access auth-methodBasic/auth-method roles roleROLE_MANAGERS/role roleROLE_USERS/role /roles /security-constraint /security //The roles came from the Acegi config file. After that, I had to add the [managed] metadata tag to one of my ValueObjects and it all seemed to work. I'll be honest, I don't really understand why this works, it just does. What I mean by 'works' is that the managed collection on the client gets filled with data successfully. I haven't yet tested pushing new entries to that managed collection after the initial fill. I hope this post helps someone else. ~Geoff --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, jahhaj12345 halvorsonj@ wrote: I don't know of a way to just authenticate the client. From everything I've read, you have to authenticate the HTTP and RTMP sessions individually. For my application, I had to create my own LoginCommand to handle the flex RTMP authentication. Here's my understanding of how it's working for me: 1. On my client, I get the channelset to use and then call channelSet.login(username, password). You could also call the setCredentials on the actual DataService the same way, but my services are all created at runtime on the server instead of being statically defined in services-config.xml. 2. That channelSet (or dataservice) from above authenticates through the login-command configured in services-config.xml. This is where the custom LoginCommand I created is configured. The doAuthentication function of LoginCommand is as follows: public Principal doAuthentication(String username, Object credentials) { Authentication auth = authenticationProvider.authenticate(new
RE: [flexcoders] How can we use message event of mx.data.DataService?
This event is dispatched when a DataMessage has been pushed to the client by the server, after it has gone through internal processing by the DataService. Unlike a ResultEvent or FaultEvent that you'll always want to handle because they correlate to a fill() or some other operation you've invoked, the MessageEvent isn't something you need to handle unless you want to put something up in your UI indicating that a pushed data change was received by the client. You can't send/receive custom messages using DataService; for that, use Producer/Consumer or MultiTopicProducer/MultiTopicConsumer directly. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Shigeru Nakagaki Sent: Tuesday, August 26, 2008 10:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] How can we use message event of mx.data.DataService? DataService has message event. But I've never received this event. Can we send/receive custom messages by mx.data.DataService?
RE: [flexcoders] blazeds spring security let assembler fetch data based on current user
You can store user-specific data in the server-side FlexSession or FlexClient instances that you can access via the FlexContext class. A FlexSession represents the connection between a client and server, and in the case of servlet-based HTTP, wraps the app server's HttpSession. One thing that can trip people up is that a cookie-based browser session is scoped to the browser process, meaning all tabs/frames/etc. share the same session. The FlexClient instance on the server represents a specific Flex application (a swf). Both provide APIs for storing and getting attributes and you can access them from within your assembler. Login commands return a Principal as a result of successful authentication, and this is stored in either the FlexSession or FlexClient depending on how you want to scope your authentication. The default is to store it with the FlexSession, but this can be controlled using the per-client-authentication/ config setting for your login command in services-config.xml. Seth From: flexcoders@yahoogroups.com on behalf of cartewn Sent: Tue 7/1/2008 4:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] blazeds spring security let assembler fetch data based on current user Hi, I'm currently learning flex by trying to build an application with flex, blazeds and Spring. My application lets users log on using spring security (which I will probably combine with AcegiLogonCommand). I would like my assemblers to return different data based on which user is currently logged on (for instance to show that specific user's to-do list). To do this, I added a userId property to my spring security principals (by subclassing org.springframework.security.userdetails.User) and added user_id columns to user-specific data in the database. Now I would like to know how I can get the currently logged on user in my assembler so I can use its userId to fetch the user's data. Is the assembler the right place to decide which data to send to my flex application? If so, can anyone tell me how to determine which user is currently logged on in my assembler? If not, what would be the recommended way of dealing with user-specific data in my database in combination with blazeds? The only examples I have been able to find on the Internet so far only use different roles to determine what a user is or is not allowed to do, I have yet to find any examples where users store and retrieve user-specific data. Kind regards, Jeroen winmail.dat
RE: [flexcoders] Server to client calls
Hi Luciano, You have two options for controlling/filtering which messages are pushed to subscribed Consumers. 1. Assign a selector expression to your Consumer before subscribing; this acts as a server-side filter that is evaluated against headers of messages sent to the destination. It's evaluated at the server, not at the client, and only messages that satisfy the expression are pushed to the Consumer. 2. Enabled subtopics for the destination and have each Consumer subscribe to a subtopic. You could have each Consumer subscribe to its own unique subtopic, or you can use subtopics to group sets of Consumers. When you generate messages on the server directly, you can target them to a specific destination's subtopic by adding a DSSubtopic header to the message you're sending. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Luciano Manerich Junior Sent: Thursday, June 26, 2008 9:56 AM To: flexcoders@yahoogroups.com Subject: RES: [flexcoders] Server to client calls Hi Seth, thank you, and all those answers that i've received. In that sample app, every client receive an event, there is an way that i may filter some clients in server code, instead of ignoring it on the cliente side? Ive seen that there is a property on consumer class that i'ld put an expression for a validation, that kind of filter its done on client side? Thank in advance, Luciano. De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de Seth Hodgson Enviada em: quinta-feira, 26 de junho de 2008 13:46 Para: flexcoders@yahoogroups.com Assunto: RE: [flexcoders] Server to client calls Hi Luciano, Take a look through the sample apps. One of them is a stock ticker sample, and tick updates (messages) that are pushed/dispatched to subscribed Consumers are generated directly by Java code on the server. You could follow the same approach, and generate messages on the server that your clients handle by invoking local methods. But there's nothing like client.call(...) on the server in BlazeDS and LCDS at this point. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Luciano Manerich Junior Sent: Monday, June 23, 2008 12:16 PM To: flexcoders@yahoogroups.com Subject: RES: [flexcoders] Server to client calls Hi, i've just seen the way with Producer/Consumer, but, its just too much automated. Is there an way that i may dispatch a consumer event to flex within Java? I need to dispatch an event, to some clients, without any user interaction. In FMS, there is a collection of the current clients, and i may interact with that to call some methods. De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de Luciano Manerich Junior Enviada em: segunda-feira, 23 de junho de 2008 15:32 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] Server to client calls Hi there, It is possible with LCDS, BlazeDS or some similar DS to call flex client methods from the server? If not, this is only possible with FMS? Thanks in advance.
RE: [flexcoders] #2031: Socket Error
When you hit a 2031 error, to troubleshoot further I'd recommend running Wireshark (formerly, Ethereal) to capture the TCP packets sent/received when you run your test. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of edward.syrett Sent: Friday, June 27, 2008 1:47 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] #2031: Socket Error I'm trying to send a simple string to a Printer Server on our network. The text is a language called ZPL which is going to our little print server box that has a Zebra Label printer on its parallel port. Here's my test app: ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Alert; private function onPrintZpl():void { nbs! p; var sData:String = ^XA^FWR^CI13 + ^LHLabelTop,LabelLeft + ^FWB^FO512,899^XGPPI_LAN,1,1^FS^FWR + ^FO708,045^A0,40,40^FDUnit 7^FS + ^FO659,042^A0,40,40^FDKuehne + Nagel Logistics^FS + ^FO611,042^A0,40,40^FDAppletree Road^FS + ^FO562,042^A0,40,40^F! DChipping Warden^FS + ! nbsp; n bsp; ^FO522,042^A0,40,40^FDBanbury^FS + ^FO476,042^A0,40,40^FDOxfordshire^FS + ^FO430,043^A0,40,40^FDOX17 1LL^FS + ^FO381,042^A0,40,40^FDUnited Kingdom^FS + ^BY3,3,10 + ^FO141,043^B3R,N,100,Y,N^FD9^FS + ^XZ ! nbsp; try { var socket:Socket = new Socket(); //socket.addEventListener(IOErrorEvent.IO_ERROR, onIOError); socket.connect(10.44.180.120, 9100); socket.writeUTF(sData); n! bsp;nbs p; socket.flush(); socket.close(); } catch(error:Error) { Alert.show(error.message); } } private function onIOError(event:IOErrorEvent):void { } ]] /mx:Script mx:VBox width=100% label=Printing mx:Button label=ZPL Print click=onPrintZpl()/ /mx:VBox /mx:WindowedApplication With the app as it stands, I can hit the ZPL Print button, the label is printed, but then the app throws this error: [SWF] SocketTest.swf - 902,761 bytes after decompression Error #2044: Unhandled IOErrorEvent:. text=Error #2031: Socket Error. at SocketTest/onPrintZpl()[C:\Development\Monarch\Test\SocketT! est\src\SocketTest.mxml:28] at! SocketT est/___SocketTest_Button1_click()[C:\Development\Monarch\Test\SocketTest\src\SocketTest.mxml:58] If I uncomment the call to addEventListener() for IOErrorEvent.IO_ERROR, the app runs without any errors, but the label isn't printed. Any comments/help gratefully received. Thanks, Ed.
RE: [flexcoders] flex and automation
If you're rendering the charts in the browser player and then pushing a bitmap back to the server, that needs to run in a browser (or in AIR, also not headless). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of netdeep Sent: Friday, June 27, 2008 7:44 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] flex and automation There are no flex user groups in my area and I've been trying for a long time to find a solution to this problem with no success. I need to generate a series of charts every few minutes/hours/days on an automated basis. I pull the data for the charts from the database and draw the chart, then save it as an image and potentially notify someone where they can find the image as a png or a pdf. I am using java on the backend to communicate with the database and flex to draw the charts. The same app which draws the chart can also be called by a user to get a live snapshot. But the automation just isn't working. It works fine on my local development machine, but this application is deployed on a headless server and the flex process never gets to launch since it needs to run on a browser. I've looked at solutions for getting it to run headless but so far I can't get it to work. Does anyone know how to automate flex in this way? I know flex is meant to be interactive, but is there anyway I can still use the flex charting for automated output?
RE: [flexcoders] Re: Managed Collections with null objects
This sounds like an issue that's been fixed in the 2.5.1 hotfixes and in 2.6. If either of you have support contracts, please request the latest 2.5.1 hotfix. You may also want to give 2.6 Beta a try. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of richcianci Sent: Tuesday, June 24, 2008 1:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Managed Collections with null objects LCDS 2.51. Collection managed by an application scoped custom assembler with auto-sync-enabled and cache-items both set to true. Paging enabled with a page size of 500. --- In flexcoders@yahoogroups.com, richcianci [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, Seth Hodgson shodgson@ wrote: Hi guys, What version of things are you running, and would you mind sharing your destination configuration? Thanks, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of richcianci Sent: Tuesday, June 17, 2008 3:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Managed Collections with null objects --- In flexcoders@yahoogroups.com, João Fernandes joaopedromartinsfernandes@ wrote: I'm having this weird issue that never happened before. Sometimes, totally randomly, after deleting a managed item in a arraycollection, instead of getting the arrayCollection resized by - 1, my arraycollection keeps the same size and I get a null object where the managed item was previously. This happens using ds.deleteItem() or using arrayCollection.removeItemAt( itemIndex ) -- João Fernandes http://www.onflexwithcf.org http://www.riapt.org I am having the same issue. Did you ever figure it out?
RE: [flexcoders] AIR/LCDS/EJB Authentication lost when a different RTMP worker thread is used
For NIO-based connections to the server, authentication is handled in a container specific fashion (in your case using the TomcatLoginCommand) and the resulting Principal returned by the container is stored in either the FlexSession or FlexClient instance on the server corresponding to the remote Flex client. This stored Principal is used for all authorization constraint checks applied to LCDS destinations/etc., but because NIO endpoints don't use container threads I suspect that JBoss' EJB container doesn't see this Principal and can't use it for its own checks. I'll log an enhancement request/bug for this issue. As a workaround, you'd need to apply your security constraints at the LCDS destination level rather than on the EJB methods directly. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of taze170171 Sent: Monday, June 23, 2008 3:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] AIR/LCDS/EJB Authentication lost when a different RTMP worker thread is used Hi! I am setting up the security for Flex to work together with the EJB 3 Container security. The user should login within the AIR application via a custom login screen and the authentication should be verified against the configured JBoss login module. For all further ds requests the authorization check should be done for every EJB method by the EJB container. All EJB methods have a @javax.annotation.security.RolesAllowed(...) anotation. The EJBs are called within an assembler. In principle the process works until the EJB is called by a new RTMP worker thread. Within the new RTMP thread the principal is null and the authorization fails. I have setup the security as follows: * The custom security and tomcat valve have been setup as described in the lcds docu (copy jars, copy context.xml) * The services-config.xml contains the following part: ... security login-command class=flex.messaging.security.TomcatLoginCommand server=all / security-constraint id=basic-read-access auth-methodCustom/auth-method roles roleFLEX/role /roles /security-constraint /security ... * The data-management-config.xml contains the following part: destination id=id security security-constraint ref=basic-read-access/ /security adapter ref=java-dao / ... * The login is performed within the mxml as follows: var token:AsyncToken = ds.connect(); token.addResponder( new AsyncResponder( function():void { if (ds.connected) { var channelSet : ChannelSet = ds.channelSet; var token : AsyncToken = channelSet.login(user, pwd); token.addResponder(new AsyncResponder ( function(event:ResultEvent, token:Object=null):void { switch(event.result) { case success: Alert.show(Login success); ... I get the success result and when the first ejb calls are performed from the data service assembler the prinicipal is set and the authorization works. But if the EJB is called within another RTMP worker thread no principal is set and the authorization fails. How can I share the security login context over more than one worker thread? Thanks in advance, taze
RE: [flexcoders] Re: ANYONE? LCDS Bug? Return from overriden ServiceAdapter manage() disregarded
Hi Steven, Definitely let me know if you run into trouble with this on LCDS 2.6 beta. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steven Toth Sent: Monday, June 23, 2008 10:20 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: ANYONE? LCDS Bug? Return from overriden ServiceAdapter manage() disregarded Thanks, but the manage() method only gets called if you override the handlesSubscriptions() method to return true, and in LCDS if you call the super.manage(command) for a subscribe operation when you indicated you will be handling subscriptions it throws an exception. BlazeDS will allow you to call the super.manage(command) even with handlesSubscriptions() overriden to return true, but it works even if you don't call the super.manage(command). For some reason LCDS 2.51 ignores the value I return from the manage () method. Seems like a bug. I'm trying to recreate it on LCDS 2.6 Beta. If anyone has any suggestions or feedback I'd appreciate it. I tried to file a bug report from the link on the LCDS Beta Download page bug it told me I didn't have the correct permissions. Regards. -Steven --- In flexcoders@yahoogroups.com, shaun [EMAIL PROTECTED] wrote: Hi, A pure 100% guess... Perhaps you need to call super.manage (command). Steven Toth wrote: --- In flexcoders@yahoogroups.com, Steven Toth toth82@ wrote: I have a custom adapter I'm using for messaging. This code works in BlazeDS, but when I try it in LiveCycle DS it does not work. The return value (a new AckknowledgeMessage I created) from my overriden manage() method never makes it to the client. I see the message from the sysout at the end of the method populated correctly, but whatever is happening after this method is called and before the message is returned to the client overwrites what I returned. Any thoughts? public class MyMessagingAdapter extends ServiceAdapter { public boolean handlesSubscriptions() { return true; } public Object manage(CommandMessage command) { Object ret = null; try { if (command.getOperation() == CommandMessage.SUBSCRIBE_OPERATION) { // Do something custom here... AcknowledgeMessage msg = new AcknowledgeMessage(); ASObject body = (ASObject)msg.getBody (); if (body == null) { body = new ASObject(); msg.setBody(body); } body.put(someValue,abc); body.put(spmeOtherValue, def); ret = msg; } } catch (Throwable t) { System.out.println(manage(), exception caught:\n + t.getMessage()); t.printStackTrace(); } System.out.println(manage(), returning msg:\n + ret); return ret; }
RE: [flexcoders] Server to client calls
Hi Luciano, Take a look through the sample apps. One of them is a stock ticker sample, and tick updates (messages) that are pushed/dispatched to subscribed Consumers are generated directly by Java code on the server. You could follow the same approach, and generate messages on the server that your clients handle by invoking local methods. But there's nothing like client.call(...) on the server in BlazeDS and LCDS at this point. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Luciano Manerich Junior Sent: Monday, June 23, 2008 12:16 PM To: flexcoders@yahoogroups.com Subject: RES: [flexcoders] Server to client calls Hi, i've just seen the way with Producer/Consumer, but, its just too much automated. Is there an way that i may dispatch a consumer event to flex within Java? I need to dispatch an event, to some clients, without any user interaction. In FMS, there is a collection of the current clients, and i may interact with that to call some methods. De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de Luciano Manerich Junior Enviada em: segunda-feira, 23 de junho de 2008 15:32 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] Server to client calls Hi there, It is possible with LCDS, BlazeDS or some similar DS to call flex client methods from the server? If not, this is only possible with FMS? Thanks in advance.
RE: [flexcoders] RemoteObject: Automatically Handling Session Timeout
Hi David, One option would be to turn on the following config property in your 'channel-definition'(s) in services-config.xml: !-- Optional. Default is false. Setting this flag to true will cause clients to automatically attempt to re-authenticate themselves with the server when they send a message that fails because credentials have been reset due to server session timeout. The failed message will be resent after re-authentication making the session timeout transparent to the client with respect to authentication. -- login-after-disconnectfalse/login-after-disconnect This property name doesn't contain the word 'retry' in it, but that's what it does with the call that fails due to a session timeout that triggers an auth issue. If you want to prevent the server session from timing out while the client is running, you could ping the server on a wide interval just to keep the session alive. For instance, if your server session timeout is configured to be 15 minutes, a very simple solution is to have your client send a no-op request to the server once every 10 minutes. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dev_dave_72 Sent: Friday, June 20, 2008 11:14 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] RemoteObject: Automatically Handling Session Timeout I am developing a flex application using BlazeDS on Tomcat. I am trying to make the application automatically handle server session timeouts. That is, if the server session times-out, the next communication from the client to the server will create a new session. I am using RemoteObject and can easily capture the Client.Authentication fault that is thrown as a result of a call if the server has already timed-out. I can easily log back in following this fault. However, I don't know how to resend the failed call. Does anyone have any suggestions on how to resend the failed call or how to detect the timeout before I actually make the call? I have considered doing a simple no-op call to verify the connection before each RemoteObject call, but that seems very inefficient to me. I know I can turn off the server-site timeouts as well, but I don't really want to have a lot of unused sessions hanging around. Thanks for any help. - David.
RE: [flexcoders] BlazeDS broadcast updates to others?
Actually, BlazeDS does support push via AMF/HTTP streaming. RTMP supports duplex client-server interactions over a single socket. HTTP is a request/response-based protocol so is not duplex by its nature and in order to simulate a duplex connection the client most open one HTTP connection to the server to receive pushed (or polled) data over, alongside a separate HTTP connection to send data to the server. The client-to-server connection is transient, opened only when the player has something to send to the server. For streaming AMF/HTTP, the server writes data down to the client directly over the open connection, with no polling involved. Things like Apache connectors or old proxies that buffer HTTP response streams interfere with this, in which case we recommend configuring your ChannelSet to fallback to long polling or simple polling. Long polling provides a better client experience than simple polling on a set interval, because poll requests will be parked on the server to wait for something to return (using a timeout to avoid excessively long waits). For lightly loaded apps, this can significantly reduce the polling load on the server, and it means clients receive 'pushed' messages more immediately then they do with simple polling. Because each poll response is complete (as opposed to streamed/chunked) they are never buffered by connectors/proxies/etc.. BlazeDS doesn't include our NIO-based endpoints (RTMP and NIO-based AMF/HTTP streaming and long polling), so its streaming and long-polling support is implemented on top of the current Servlet API which only supports blocking IO. This means that you must limit the number of streaming or long-polling connections that the server accepts in order to avoid the possibility of putting all the container's request handler threads into a wait state, and we expose config settings for that. The next rev of the Servlet spec is adding limited support for async IO, and at that point BlazeDS will be updated to take advantage of it to scale to higher numbers of streaming and long polling client connections. There's some more info on the channel options/behaviors here: http://www.dcooper.org/Blog/client/index.cfm?mode=entryentry=8E1439AD-4E22-1671-58710DD528E9C2E7 And the docset for LCDS 2.6 also contains much more information in this area. In answer to the original question, the samples that are included with the BlazeDS turnkey contain some messaging examples. At a high level, you use Producer to send messages to the server and Consumer to subscribe for pushed messages from the server. Take a look at these client-side classes, the server-side Message Service, and the samples that use these. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cutter (Flex Related) Sent: Thursday, June 19, 2008 10:24 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] BlazeDS broadcast updates to others? BlazeDS does not have true push (RTMP), it emulates push through polling. Basically your update would push a message to a gateway, that then broadcasts that message to a specific channel for BlazeDS, and the client's polling would pick up that message from BlazeDS in it's next polling cycle (think the default is 8 seconds, but that can be adjusted in the xml config). I don't have a demo, but Andy Matthews is doing a presentation to the Nashville ColdFusion User Group next Thursday night (which will be simulcast over Adobe Connect) that will show an application that does this, and goes into some detail on the hows and whys. (www.ncfug.com should post the Connect URL once it's closer to the preso) Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com markflex2007 wrote: Hi, I am not sure if BlazeDS have broadcast feature or not that means it broadcase to other clients when one person update something in the same Flex application. Please give me a demo if you have the url or samples Thanks a lot Mark
RE: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node
Hi Clem, Use the SecureAMFChannel on the client and the SecureAMFEndpoint at the server. Make sure your endpoint URL is correct (starts with https://...). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gnu wolf Sent: Wednesday, June 18, 2008 5:14 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node Hey Seth, I'm not getting anything from the response, no headers and no status code. Pretty weird. I had this request headers tho: POST /samples/messagebroker/http HTTP/1.1 Host: localhost:9400 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Content-type: application/xml Content-length: 653 It seems like it's still talking to the HTTP channel and not the AMF channel. If i'm using HTTPS, I should be talking to SecureAMFChannel, right? I already enable SSL in my blazeDS tomcat and use a self-signed keystore file. On Thu, Jun 19, 2008 at 7:50 AM, Seth Hodgson [EMAIL PROTECTED] wrote: Hey Clem, That raw request you're seeing is the client-side channel handshake with the server endpoint. This happens before any general messages/requests/data are shipped over the channel/endpoint connection. For some reason the response to this initial request isn't returning the server half of the handshake as valid AMFX. Do you see any other raw response info (say response headers and response status code) in addition to that odd body? Once this initial connect-time handshake is working, the SOAP request will be sent to the server where it'll be proxied through to the actual target SOAP endpoint. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gnuwolf Sent: Wednesday, June 18, 2008 10:45 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node Hi Seth, Thanks for replying. I'm creating a webservices client for Netsuite. The usual SOAP request for login operation would look something like this: soapenv:Body platformMsgs:login xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:platformCore=urn:core_2008_1.platform.webservices.netsuite.com xmlns:platformMsgs=urn:messages_2008_1.platform.webservices.netsuite.com platformMsgs:passport platformCore:email[EMAIL PROTECTED]/platformCore:email platformCore:passwordmypassword/platformCore:password platformCore:account724168/platformCore:account /platformMsgs:passport /platformMsgs:login /soapenv:Body Raw request from charles is this: amfx ver=3 xmlns=http://www.macromedia.com/2005/amfx; body object type=flex.messaging.messages.CommandMessage traits stringbody/string stringclientId/string stringcorrelationId/string stringdestination/string stringheaders/string stringmessageId/string stringoperation/string stringtimestamp/string stringtimeToLive/string /traits object traits/ /object null/ string/ string/ object traits stringDSId/string stringDSMessagingVersion/string /traits stringnil/string int1/int /object string473AC219-432D-44B1-76AC-9CA3030ED6BA/string int5/int int0/int int0/int /object /body /amfx Raw response
RE: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node
I think a bit more background on your app would be helpful. It sounds like you're receiving a response from the server that isn't correctly encoded AMFX, meaning that you're using an HTTPChannel to connect the client to the server. What is being invoked on the server specifically? If you monitor your HTTP traffic using something like Charles, what does the raw response being returned to the player look like? Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gnu wolf Sent: Tuesday, June 17, 2008 8:39 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node Hello Guys, I have a different error now. Invalid AMFX packet. Content must start with an amfx node How do I fix this thing? I know it has something to do with my connection settings or proxy settings but which specifically should I check. Thanks in advance.
RE: [flexcoders] Re: Managed Collections with null objects
Hi guys, What version of things are you running, and would you mind sharing your destination configuration? Thanks, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of richcianci Sent: Tuesday, June 17, 2008 3:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Managed Collections with null objects --- In flexcoders@yahoogroups.com, João Fernandes [EMAIL PROTECTED] wrote: I'm having this weird issue that never happened before. Sometimes, totally randomly, after deleting a managed item in a arraycollection, instead of getting the arrayCollection resized by - 1, my arraycollection keeps the same size and I get a null object where the managed item was previously. This happens using ds.deleteItem() or using arrayCollection.removeItemAt( itemIndex ) -- João Fernandes http://www.onflexwithcf.org http://www.riapt.org I am having the same issue. Did you ever figure it out?
RE: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node
Hey Clem, That raw request you're seeing is the client-side channel handshake with the server endpoint. This happens before any general messages/requests/data are shipped over the channel/endpoint connection. For some reason the response to this initial request isn't returning the server half of the handshake as valid AMFX. Do you see any other raw response info (say response headers and response status code) in addition to that odd body? Once this initial connect-time handshake is working, the SOAP request will be sent to the server where it'll be proxied through to the actual target SOAP endpoint. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gnuwolf Sent: Wednesday, June 18, 2008 10:45 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Help on error: Invalid AMFX packet. Content must start with an amfx node Hi Seth, Thanks for replying. I'm creating a webservices client for Netsuite. The usual SOAP request for login operation would look something like this: soapenv:Body platformMsgs:login xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:platformCore=urn:core_2008_1.platform.webservices.netsuite.com xmlns:platformMsgs=urn:messages_2008_1.platform.webservices.netsuite.com platformMsgs:passport platformCore:email[EMAIL PROTECTED]/platformCore:email platformCore:passwordmypassword/platformCore:password platformCore:account724168/platformCore:account /platformMsgs:passport /platformMsgs:login /soapenv:Body Raw request from charles is this: amfx ver=3 xmlns=http://www.macromedia.com/2005/amfx; body object type=flex.messaging.messages.CommandMessage traits stringbody/string stringclientId/string stringcorrelationId/string stringdestination/string stringheaders/string stringmessageId/string stringoperation/string stringtimestamp/string stringtimeToLive/string /traits object traits/ /object null/ string/ string/ object traits stringDSId/string stringDSMessagingVersion/string /traits stringnil/string int1/int /object string473AC219-432D-44B1-76AC-9CA3030ED6BA/string int5/int int0/int int0/int /object /body /amfx Raw response was blank or some character like this: Error from the flash debugger is this: [MessagingError message='Invalid AMFX packet. Content must start with an amfx node'] at mx.messaging.channels.amfx::AMFXDecoder$/decodePacket()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\amfx\AMFXDecoder.as:149] at mx.messaging.channels.amfx::AMFXDecoder/decode()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\amfx\AMFXDecoder.as:91] at mx.messaging.channels::HTTPChannel/decodePacket()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\HTTPChannel.as:539] at mx.messaging.channels::HTTPChannel/pingCompleteHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\HTTPChannel.as:551] at ChannelRequestLoader/callEventCallback()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\HTTPChannel.as:1158] at ChannelRequestLoader/completeHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\HTTPChannel.as:1194] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() I didn't touch
RE: [flexcoders]
Hi Clemen, That error message pretty well sums it up. The proxy service does not allow an insecure swf that is interacting with the server over HTTP to request a proxied HTTPS call. If it did, sensitive data returned via HTTPS would be passed back to your client over an unencrypted HTTP hop. Load your swf using HTTPS and make your proxy request using HTTPS; then the proxied HTTPS call will be permitted. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gnuwolf Sent: Tuesday, June 17, 2008 3:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Hi Guys, I'm getting this error message whenever I invoke a WS operation: A fault occured contacting the server. Fault message is: Invalid URL - can't access HTTPS URLs when accessing proxy via HTTP. Here's a code snippet: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=initApp() mx:Script ![CDATA[ import com.netsuite.*; import mx.rpc.events.FaultEvent; import mx.rpc.soap.SOAPHeader; import mx.controls.Alert; private var header1:SOAPHeader; public var _service:NetSuiteService; public function initApp():void { _service = new NetSuiteService(ws-netsuite); _service.addNetSuiteServiceFaultEventListener(handleFaults); this.setHeaders(); } Now, how can I saw this from the help guide: Calling web services in ActionScript The following example shows a web service call in an ActionScript script block. Calling the useWebService() method declares the service, sets the destination, fetches the WSDL document, and calls the echoArgs() method of the service. Note: When you declare a WebService component in ActionScript, you must call the WebService.loadWSDL() method. -- How can I call loadWSDL() in my code? Here's a code snippet from my proxy-config.xml: destination id=ws-netsuite properties wsdlhttps://webservices.netsuite.com/wsdl/v2008_1_0/netsuite.wsdl/wsdl soap*/soap /properties adapter ref=soap-proxy/ /destination I already put in the destination in the service constructor but still I'm getting a https error. Badly need help. TIA. -- Clemen Canaria
RE: [flexcoders] Connection problem in Flex messaging
Hi, RTMP is run on a non-standard (meaning, non-HTTP) port so client-side firewalls/proxies/etc. may block traffic out on that port. Accessing your server over VPN versus over the public internet must be using different port-specific rules. You'll generally want to define your ChannelSet (or the list of channels in your server config), to start with RTMP as the preferred option but then fallback to one of the AMF HTTP options (streaming, long-polling, simple polling). These fallback channels/endpoints should be configured to use port 80 if insecure or 443 is secure to guarantee that their traffic makes it through the network without being blocked due to port number. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of paromitadey Sent: Monday, June 16, 2008 1:13 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Connection problem in Flex messaging Hi, We have used Flex messaging in an Flex/Java based application. The messaging works fine in our production/QA server. But when we deployed the application to the production server, which can be accessed by a public IP, the messaging feature failed. Nevertheless, if we connect the production server using a VPN connection and use an internal IP to run the application, the messaging is working but does not work when the same application is accessed using the public IP. We have used rtmp channel for messaging and we have opened the port used in both the public IP as well as the internal IP. channel-definition id=my-rtmp class=mx.messaging.channels.RTMPChannel endpoint uri=rtmp://{server.name}:2037 class=flex.messaging.endpoints.RTMPEndpoint/ properties idle-timeout-minutes20/idle-timeout-minutes /properties /channel-definition Still we have the same problem. We are unable to find the reason for the dubious behavior. Could anyone please help us to resolve this problem. What possibly could be going wrong? Thanks and Regards, Paromita
RE: [flexcoders] [BlazdeDS] setting concurrency property through actionAcript
Hi Levancho, This option is very old, dating back to the earliest versions of RemoteObject client code and it may not do what you're expecting it to do. The documentation here isn't very clear (although it's not a simple topic so maybe that's why). When you set this to last, you're telling your RemoteObject instance to ignore results/faults that return to the player for any earlier calls you've issued before the currently final call, but this doesn't have any effect at the network level. What this means is that if you make multiple calls quickly like so: ro.foo(); ro.bar(); Both calls will be sent to the server but the result/fault for foo() will return to the player and the RemoteObject will just discard it rather than dispatching a result or fault event to your handler code. The result/fault for the second call to bar() (the last call you've made) will be dispatched. So this option doesn't cancel out the call at the network level. That's not even possible. Once a request is put on the network, there's no way to cancel it apart from waiting for its result/fault to dispatch in the player, and if the call succeeded, meaning you get a result rather than a fault, you'll need to make an explicit compensating/rollback call to undo or cancel what you've just done. So you'd have: ... fooToken = ro.foo(); ... oh no, I want to cancel or undo foo.. set a custom flag on my token to control how I handle the eventual result/fault ... fooToken[undo] = true; ... within my result handler, check for this custom flag I added to the AsyncToken for my call... if (token[undo]) ro.undoFoo(); // Make a call to rollback whatever foo() did, and don't bother processing the result. else processResult(result); ... otherwise, in my fault handler... if (!token[undo]) processFault(fault); * Just to be clear, that's psuedocode to just illustrate the idea. If you're happy with the player just not dispatching the results/faults it's receiving for earlier calls to your handler code (they're still all being processed at the server), feel free to log an enhancement to get the 'concurrency' property supported on non-MXML RemoteObject. I'm not sure why it was only implemented for the MXML version. Hope that helps, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of levani dvalishvili Sent: Sunday, June 15, 2008 4:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] [BlazdeDS] setting concurrency property through actionAcript Hi all, in this document : http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=rpc_07.html it says you can You can set the concurrency property on a RemoteObject component's mx:method tag but I don't use method tag, does that mean I cant set concurrency to be last ? how can I tell my remoteCall to use concurrency =last? I use following code to invoke remote Object : var token:AsyncToken = roService.getQuickPickList(12345); token.addResponder(new AsyncResponder( function(data:Object, token:Object):void { // lalala }, function(info:Object, token:Object):void { }, token )); basicaly I want to make sure every subsequent request cancel out any existing request currently running .looks like that concurrency property will do just that, but I cant seem to find where I can set that all suggestions are appreciated Kind Regards levancho
RE: [flexcoders] Connection problem in Flex messaging
Right, Anatole makes a good point. Using this technique you can expose your RTMP endpoint on port 80 alongside your HTTP endpoint also on port 80, on the same server: www.mycompany.com:80 - for HTTP traffic rtmp.mycompany.com:80 - for RTMP traffic You can achieve this by using the bind-address and bind-port config settings for your RTMP endpoint. You could either use two NICs (hence two IPs) on the same physical machine, and use one for your RTMP endpoint and the other for your HTTP endpoint. Or, if you have a load balancer that supports virtual IPs, you could define these client-facing IPs there, and then route the RTMP and HTTP traffic for them back to the proper endpoints on your LCDS server. Running RTMP over the standard HTTP port 80 is an end-run around the port being blocked by something along the network path between the client and server, but stateful HTTP proxies that do packet inspection will still drop RTMP packets (because they don't look like HTTP). So with this in place, a higher percentage of blocked clients will be able to successfully connect via RTMP, but you'll still want an AMF channel as a fallback for any that are still blocked. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Anatole Tartakovsky Sent: Monday, June 16, 2008 12:38 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Connection problem in Flex messaging Paromita, Seth, Just to deal with dumb firewalls and proxy you can configure your server with multiple IP addresses/names in the same domain, and split HTTP / RTMP traffic between 2 different IP addresses - make sure you bind HTTP server to one of them and RTMP to the other. Hope this helps Anatole Tartakovsky Farata Systems On Mon, Jun 16, 2008 at 1:40 PM, Seth Hodgson [EMAIL PROTECTED] wrote: Hi, RTMP is run on a non-standard (meaning, non-HTTP) port so client-side firewalls/proxies/etc. may block traffic out on that port. Accessing your server over VPN versus over the public internet must be using different port-specific rules. You'll generally want to define your ChannelSet (or the list of channels in your server config), to start with RTMP as the preferred option but then fallback to one of the AMF HTTP options (streaming, long-polling, simple polling). These fallback channels/endpoints should be configured to use port 80 if insecure or 443 is secure to guarantee that their traffic makes it through the network without being blocked due to port number. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of paromitadey Sent: Monday, June 16, 2008 1:13 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Connection problem in Flex messaging Hi, We have used Flex messaging in an Flex/Java based application. The messaging works fine in our production/QA server. But when we deployed the application to the production server, which can be accessed by a public IP, the messaging feature failed. Nevertheless, if we connect the production server using a VPN connection and use an internal IP to run the application, the messaging is working but does not work when the same application is accessed using the public IP. We have used rtmp channel for messaging and we have opened the port used in both the public IP as well as the internal IP. channel-definition id=my-rtmp class=mx.messaging.channels.RTMPChannel endpoint uri=rtmp://{server.name}:2037 class=flex.messaging.endpoints.RTMPEndpoint/ properties idle-timeout-minutes20/idle-timeout-minutes /properties /channel-definition Still we have the same problem. We are unable to find the reason for the dubious behavior. Could anyone please help us to resolve this problem. What possibly could be going wrong? Thanks and Regards, Paromita
RE: [flexcoders] Non-Blocking IO and BlazeDS Streaming
Hi Adam, Adobe is not working on this, although I'd encourage the community to. Here's why we're not. 1. We're participating in the Servlet 3 JSR which will add async IO support to the Servlet API (in the form of suspendable/resumable requests). Once that API is finalized you can expect official support for it in BlazeDS. 2. The CometProcessor API in Tomcat and the pre-final version of suspendable requests in Jetty are not standard APIs - they'll be superceeded by what makes it into the official Servlet 3 spec, making official Adobe support for these non-standard APIs a dead end. 3. We provide NIO-based HTTP endpoints that support both streaming and long polling in LCDS 2.6 and scale into the 10s of thousands of concurrent connections. These endpoints share their underlying plumbing with our existing RTMP endpoint. This works in any servlet container, not just Jetty or Tomcat, making it consistently useful to all our customers and affording us the ability to tune it directly. That said, I'll reiterate that the community is encouraged to build custom long-polling or streaming endpoints on top of the non-standard Tomcat and Jetty APIs. Someone should take the lead on organizing the community effort, and coordinating it. There's no sense in having ten of you out there working on ten versions of the same thing J One thing you'll need to be aware of is that for threadless long-polling support you can't rely on the JVM saving the current Thread's execution stack for you on a wait() and resuming later via a notify(); you actually need to save off the request processing state yourself in order to resume it later. To help out with this, I moved our suspendable AMF filter classes into the BlazeDS codebase so you guys should use that rather than the existing AMF filter classes that cannot be suspended/resumed; they're in the same package: flex.messaging.endpoints.amf. Good luck and keep me posted, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aduston1976 Sent: Friday, June 13, 2008 9:21 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Non-Blocking IO and BlazeDS Streaming I need to push data to Flex clients, and I need more than 400 clients to connect to each host. Even though I'm using BlazeDS for RPC, I was thinking of using the XIFF XMPP library with a jabber server for pushing data to clients, since streaming in BlazeDS uses blocking IO. But, looking at the relevant classes in flex.messaging, flex.messaging.endpoints, and flex.messaging.client in BlazeDS, I see that it might not be too difficult to create a new servlet that implements org.apache.catalina.CometProcessor and a new BaseHTTPEndpoint subclass that can support multiple connections for each thread. Such an implementation would be able to support over 10K simultaneous streaming connections per host. Is there anyone else who's working on this, or interested in working on it? Is Adobe already on the case, making this a waste of time? Any thoughts or suggestions are appreciated. Adam ~WRD000.jpgimage001.jpgimage002.jpg
RE: [flexcoders] LCDS gets Killed !!!
This has nothing to do with LCDS. Perhaps your app server defines a security restriction on the Runtime class or exec() method. I've never tried making a Runtime.exe() call from a Servlet. I'd suggest debugging this by dropping your call into a simple Servlet or JSP, and be sure to make your call within a try/catch and dump out any Exception info. Once that's working (assuming it can), it'll work fine from within a remote object hosted by LCDS. In terms of the general approach, you're doing the right thing. There's no way to kick off an executable from within the browser player directly. Good luck, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chitra S.Pai Sent: Thursday, June 12, 2008 8:16 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] LCDS gets Killed !!! Hi Seth, Actually the server get destroyed when I call the Java function which contain a new process. I don't know why? Is this because LCDS doesn't allow child process in it ? I am really confused what is actually happening. As the server command prompt get closed also I cannot trace what is going on.. Actually I am trying to run an external exe through Java code using LCDS and Flex. Flex cannot directly instantiate the exe so I am going through Java and all.. And to run Java code with Flex I am using LCDS as interface. Do I have some other option to run Java code with Flex and without LCDS Hope there is a solution for this... Chitra On Fri, Jun 13, 2008 at 12:12 AM, Seth Hodgson [EMAIL PROTECTED] wrote: What do you mean by killed? Is your call to exec() throwing an Exception, and if so is it showing up in your server logs? Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chitra S.Pai Sent: Thursday, June 12, 2008 6:36 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] LCDS gets Killed !!! Hi, I am trying to run a Java code from LCDS and I am facing the following problem.. LCDS process gets killed... In the Java function I am trying to invoke an exe using runtime.exec(); The Java code is working fine when tested separately. Please... Help me.. Chitra
RE: [flexcoders] Re: Non-Blocking IO and BlazeDS Streaming
One minor follow on comment. If you implement streaming, you should implement long-polling as well because there are broken HTTP proxies in the wild that will buffer responses rather than streaming them through directly. You want a non-blocking alternative for clients behind them to fallback to. Also, with streaming you do not want to deploy with Apache in front of your app server. Their connector incorrectly buffers streamed responses. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aduston1976 Sent: Friday, June 13, 2008 11:41 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Non-Blocking IO and BlazeDS Streaming Seth, Thank you very much for your thoughtful and very complete message. Is anyone else out there working on a Tomcat CometProcessor-based streaming implementation? I foresee about 2k LOC standing between the current code and one that includes an endpoint that can be used with a CometProcessor implementor. If you're already working on such an implementation or if you would like to, then let's please talk over Google Talk or whatever. I am [EMAIL PROTECTED] on Google Talk. Since BlazeDS already includes functionality to route messages across clusters, this would turn it into the server I've been looking for. Adam --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: Hi Adam, Adobe is not working on this, although I'd encourage the community to. Here's why we're not. 1. We're participating in the Servlet 3 JSR which will add async IO support to the Servlet API (in the form of suspendable/resumable requests). Once that API is finalized you can expect official support for it in BlazeDS. 2. The CometProcessor API in Tomcat and the pre-final version of suspendable requests in Jetty are not standard APIs - they'll be superceeded by what makes it into the official Servlet 3 spec, making official Adobe support for these non-standard APIs a dead end. 3. We provide NIO-based HTTP endpoints that support both streaming and long polling in LCDS 2.6 and scale into the 10s of thousands of concurrent connections. These endpoints share their underlying plumbing with our existing RTMP endpoint. This works in any servlet container, not just Jetty or Tomcat, making it consistently useful to all our customers and affording us the ability to tune it directly. That said, I'll reiterate that the community is encouraged to build custom long-polling or streaming endpoints on top of the non-standard Tomcat and Jetty APIs. Someone should take the lead on organizing the community effort, and coordinating it. There's no sense in having ten of you out there working on ten versions of the same thing J One thing you'll need to be aware of is that for threadless long-polling support you can't rely on the JVM saving the current Thread's execution stack for you on a wait() and resuming later via a notify(); you actually need to save off the request processing state yourself in order to resume it later. To help out with this, I moved our suspendable AMF filter classes into the BlazeDS codebase so you guys should use that rather than the existing AMF filter classes that cannot be suspended/resumed; they're in the same package: flex.messaging.endpoints.amf. Good luck and keep me posted, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aduston1976 Sent: Friday, June 13, 2008 9:21 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Non-Blocking IO and BlazeDS Streaming I need to push data to Flex clients, and I need more than 400 clients to connect to each host. Even though I'm using BlazeDS for RPC, I was thinking of using the XIFF XMPP library with a jabber server for pushing data to clients, since streaming in BlazeDS uses blocking IO. But, looking at the relevant classes in flex.messaging, flex.messaging.endpoints, and flex.messaging.client in BlazeDS, I see that it might not be too difficult to create a new servlet that implements org.apache.catalina.CometProcessor and a new BaseHTTPEndpoint subclass that can support multiple connections for each thread. Such an implementation would be able to support over 10K simultaneous streaming connections per host. Is there anyone else who's working on this, or interested in working on it? Is Adobe already on the case, making this a waste of time? Any thoughts or suggestions are appreciated. Adam
RE: [flexcoders] LCDS gets Killed !!!
What do you mean by killed? Is your call to exec() throwing an Exception, and if so is it showing up in your server logs? Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chitra S.Pai Sent: Thursday, June 12, 2008 6:36 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] LCDS gets Killed !!! Hi, I am trying to run a Java code from LCDS and I am facing the following problem.. LCDS process gets killed... In the Java function I am trying to invoke an exe using runtime.exec(); The Java code is working fine when tested separately. Please... Help me.. Chitra
RE: [flexcoders] How to set up a LCDS Development enviroment?
This port depends on the way your servlet container is configured. Configuring this depends on the server you're using (Tomcat, WebSphere, etc.). Once you reconfigure your app server to bind to a different port for HTTP (and for HTTPS as well?), you'd need to update any hardcoded port values in your config files (although if you're using {server.port} in your URLs you'll be fine with no changes). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: Thursday, June 12, 2008 6:53 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to set up a LCDS Development enviroment? Hi, I just install LCDS 2.6 and I can see the test sample here. http://localhost:8400/lcds-samples/ I have question here: 1. How to change port 8400 to port 80. 2. How to set a development environment for LCDS applications. Thanks a lot Mark
RE: [flexcoders] lcds references to same item
If I'm understanding your email correctly, you're actually looking at a feature of Data Management. When you fill multiple client side collections and there's an overlap in the items each collection contains, Data Management ensures that only a single instance of any specific item exists on the client. This guarantees that your client side-data remains in a consistent state. Say you had two copies of 'media1' on the client, and then you change one and then the other. Which copy is the true copy? Which should be committed back to the server? There's no way to know, and this is a problem folks hit when using simple remoting to manage data. By maintaining a single instance on the client, your client-side data stays in a consistent, well-understood state. If your media instances really shouldn't be shared by your model instances, then you'll need to adjust your domain model (always create unique media instances for each model?). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thierry V. Sent: Wednesday, June 11, 2008 2:39 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] lcds references to same item Hello all ! I use LCDS to retrieve data from my database and display it on a tree. I have the following tables : model, model_media and media. I have made an hibernate model mapping with a Set from model to model_media, to get for each model their medias, like this : set name=children table=model_media lazy=false key column=modelid / many-to-many column=mediaid class=MediaVO / /set I could retrieve data correctly, each model have their own media listed in the children Set. Some medias are used by several models at same time, for exemple : model1 - media1 - media2 - media3 model2 - media1 - media3 - media4 Now, when I display my hierarchical list into a Tree, there is stange behaviours... When I display all the hierarchy for all models, and roll over an item used several times, the selection focus is displayed on the last item... ie if I roll over the media1 from model1, the focus is displayed on the media1 from model2... It seems that the items used some times are referenced at the same memory allocation... Flex doesn't recognize each item as single item, it see item used several times as the same item... Anybody have encounted the same behaviours ?? I don't know how to resolve it... any suggestion are welcome, thanks in advance Thierry
RE: [flexcoders] How to connect SSL pop server such as Gmail?
Flash and AIR do provide general client Socket support, but unfortunately this doesn't currently include support for SSL/TLS. Neither Flash nor AIR provides a ServerSocket API. http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/Socket.html LCDS supports RTMP connections from the player, which do support SSL/TLS and can be configured to use whatever port you wish, but as Josh mentioned that's not generally useful for connecting to a POP server. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, June 10, 2008 7:03 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] How to connect SSL pop server such as Gmail? Unfortunately neither Flex nor Air have general socket support, they can only connecting to a LCDS server on a specific port which isn't much use for general network programming. I'm *really* hoping this is coming real soon now, at least to Air. -Josh On Wed, Jun 11, 2008 at 8:59 AM, lgks701 [EMAIL PROTECTED] wrote: How to connect SSL pop server such as Gmail? Java uses SSLSocket which extends Socket to connect SSL pop server, and how about actionscript? -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] Error in Adobe class MultiTopicConsumer
Hi Andrew, Definitely a bug, and I've logged it: https://bugs.adobe.com/jira/browse/BLZ-189 I'd recommend voting for it and adding yourself as a watcher. Thanks, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bbloggs96 Sent: Monday, June 02, 2008 8:43 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Error in Adobe class MultiTopicConsumer I am using the MultiTopicConsumer with Blaze. I have had problems with removeSubscription, it gives me an error when I remove the last subtopic in the array of subscriptions. It works OK if any other subtopic is removed. I tracked down the problem to the actual Adobe Class MultiTopicConsumer and method removeSubscription. The code removes the subtopic, but then does a check afterwards to see if it is ttrying to remove a subtopic that does not exist. But when it is the last subtopic, it always fails. Does anybody have a work around? This is the method from Adobe Class MultiTopicConsumer: public function removeSubscription(subtopic:String = null, selector:String = null):void { for (var i:int = 0; i subscriptions.length; i++) { var si:SubscriptionInfo = SubscriptionInfo(subscriptions.getItemAt(i)); if (si.subtopic == subtopic si.selector == selector) { subscriptions.removeItemAt(i); break; } } if (i == subscriptions.length) throw new MessagingError(Attempt to remove a subscription with subtopic: + subtopic + and selector: + selector + that this consumer does not have); } The problem is the if (i == subscriptions.length), which always is true because it has just been removed. Andrew
RE: [flexcoders] BlazeDS Long Polling Question
Hi Satish, The wait-interval-millis setting controls how long the server will park a poll request and wait for something to return. With a wait of just 100 ms, the server will return an empty poll response to the client almost immediately. Try increasing this setting to 6 (1 minute). Also, HTTP 1.1 connections don't close when a response is returned to the client. Connections are persistent by default, and will be closed by the user agent after a period of inactivity. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Satish Kore Sent: Thursday, May 29, 2008 12:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] BlazeDS Long Polling Question Hello All, I am bit confused about Long polling in BlazeDS, as far as I understand long polling technique that is Long-polling sends a request to the server, but a response is not returned to the client until one is available. As soon as the connection is closed, either due to a response being received by the client or if a request times out, a new connection is initiated. Now by this definition I assume that once request is sent to server it holds it until some response data is available and then it returns that requests and waits for next long polling request. But when I tried using debugging tool like ServiceCapture to capture long polling requests in BlazeDS it shows that requests are sent to server every 10ms or so and server does not hold that connection instead it returns with 200 OK http response code almost immediately, Now I don't understand this but I am pretty sure that this is wrong. Could anybody please let me know what is that I am missing here? Following is my long polling channel definition channel-definition id=my-longpolling-amf class=mx.messaging.channels.AMFChannel endpoint url=http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling; class=flex.messaging.endpoints.AMFEndpoint/ properties polling-enabledtrue/polling-enabled polling-interval-seconds-1/polling-interval-seconds wait-interval-millis100/wait-interval-millis client-wait-interval-millis1/client-wait-interval-millis max-waiting-poll-requests50/max-waiting-poll-requests /properties /channel-definition I don't think there is any problem in above configuration but I am unable to understand this request and response model in long polling context. Check attached screen shot of ServiceCapture in action. Thanks, Satish Kore http://blog.satishkore.com
RE: [flexcoders] Re: HTTPService multiple requests not being sent?
Injecting a current client-side timestamp into an outbound request is a good way to avoid Http response caching if you don't control the server. If you do control the server, you should consider configuring it to set HTTP no-cache headers in these responses to suppress caching. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of valdhor Sent: Tuesday, May 27, 2008 9:15 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: HTTPService multiple requests not being sent? This is pretty close to another qustion that was asked lately. Seth Hodgson summed up what was going on here: http://tech.groups.yahoo.com/group/flexcoders/message/113808 --- In flexcoders@yahoogroups.com, javadmanx [EMAIL PROTECTED] wrote: I have the following service: getStudentById.send({action: 'student_by_id', id: event.currentTarget.selectedItem.id}); If I make multiple requests on this same service with the same values it seems to cache and not send the request to the server again. The only way I've found to stop it from doing this is to add a time stamp the changes the request values. Below is the code I've used to get it to send the request on every call. So what it does is, if the request values are the same it just gives me the same data, but never calls the server. But if I use this below it calls the server every time. getStudentById.send({action: 'student_by_id', id: event.currentTarget.selectedItem.id, tt: new Date().getTime()}); What am I doing, and is there a better way to get all requests to call the server even if the request values are the same? Thanks.
RE: [flexcoders] Publish Flex dev application to Production problem!
Have you tried hitting http://myapp.4java.ca/messagebroker/amf (the URL your channel is configured to use) in a browser? You either need to get that working, or if your endpoint is running at a different URL (maybe using a non-empty context root?), update your configuration such that the client is using the correct value. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of guillaumeracine Sent: Saturday, May 24, 2008 12:56 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Publish Flex dev application to Production problem! Hi, my application in dev mode works fine with blazeDS. But when i put it on my web server i cannot access the blazeDS application (messagebroker) anymore from my flex client. in dev mode i access to my flex app like this http://192.168.1.101:8080/myapp/chidaca.html In production mode i use myapp.4java.ca/chidaca.html Do i have to change the service-config.xml before deploying or change any compiler arguments in flex builder ??? Here is my error : FaultEvent fault=[RPC Fault faultString=Send failed faultCode=Client.Error.MessageSend faultDetail=Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://myapp.4java.ca/messagebroker/amf'] messageId=4DAEE9EF-90D9-499E-977A-1C7FCE4EFFFD type=fault bubbles=false
RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS
Hi Jay, You could fork the endpoint code and build your own custom AMF filter chain to do something like this, but the problem remains that when you receive a single HTTP request, you have to return all your results in a single HTTP response. Say you have 3 batched calls with average execution times on the server of 10ms, 6 seconds, and 50ms respectively. Even if you split these invocations out across concurrent threads in your custom AMF filter chain you'd still need to join on these threads, wait for them all to finish and then bundle the 3 results back up in a single response. So you're not really buying yourself much.. Which is why I recommend a truly async approach where your initial call just queues a job(s) for async execution on the server and you use the messaging infrastructure to get the eventual result(s)/fault(s) back to your client. Good luck, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MyoT Sent: Thursday, May 22, 2008 6:17 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Hi Seth, This is awesome information. I didn't know player batch them up and send in one post. I learned something today. I digged through Blaze source code and found out that BatchProcessFilter is responsible for processing those messages . I am wondering is there any way, I can write our own batch process filter and plug that in instead of default one. What I am thinking is to process those messages in parallel on server then response to the client in one response. Basically, it would cut down the time server has to wait to finish processing all those messages sequentially. Any thoughts or insight info would be appreciated. Thanks, Jay --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: There is a single thread that advances through SWF frames and runs your ActionScript code and event handlers, but network calls are performed by separate background threads concurrently. In order to have calls processed concurrently on the server, they need to arrive as separate requests. In the case of AMF, if you make a series of calls quickly chances are good/excellent that the Player will batch them up and send them to the server in the body of a single HTTP POST. When this happens, the server must unpack them and process them serially and then pack the results for all these calls back up in the body of a single HTTP response. Because we're dealing with a single request and response, there's no way to send back results for individual calls separately. When these results get back to the browser and are passed back into the Player, they are dispatched to your ActionScript handling code as asynchronous events. There's not a good way to force calls to be sent as separate requests, and even if you could, browsers impose limits on the number of concurrent connections they'll open to a server, so this really isn't the right way to solve your scenario. Also, in the case of RTMP all traffic between the client and server happens over a single connection and is ordered serially. If you want to process calls/messages/data asynchronously on the server the proper way, it requires a bit of work on your part to accomplish at this point. Rather than running your current logic in your RemoteObject directly when it is invoked, you need to break that out into a Runnable class, and when you're invoked, create an instance of this class that packages up the incoming args and info about the client making the call and then submit that for asynchronous execution to a java.util.concurrent.Executor that you'd need to set up during server startup. Your remoting method could return a job id or just void once it has queued an instance of your Runnable with the Executor. On the client when you get a ResultEvent for your call you don't get the actual result - you just know that your invocation was successfully queued for asynchronous execution on the server. So the second half of the equation is how to get the result or fault generated when the Executor runs your Runnable back to the client. You need to take advantage of messaging in BlazeDS or LCDS to achieve this. In your client app, create a Consumer and subscribe to a destination you define that you can publish results/faults as AsyncMessages back to target clients from your Runnable. Your Consumer should subscribe to a subtopic that applies only to it, or use a selector expression. When your Runnable runs and generates the result or fault to return, you'd can create an AsyncMessage containing the result of fault info and publish it to this destination, using either a subtopic header, or some other message header that will be evaluated against the Consumer's selector expression such that the message is routed to the proper Consumer. That lets you return async results or faults to clients in a truly asynchronous manner
RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS
Hi Tim, Yeah, it's the same issue. With proxied calls though, it's a bit more complicated to solve. In the remoting case, your remote object method is generally just doing some local computation on the server and maybe hitting a database. It's simple to wrap this up in a Runnable and execute it asynchronously. In the case of the proxy service, we use the Apache HttpClient library to make proxied calls on your behalf, and this would be _much_ harder for you to wrap up in a Runnable to execute concurrently. I'd like to see us support async mode for the proxy service as well as for the remoting service, and the proxy service itself should be updated to use NIO to support making proxied calls that don't tie up a server thread for the duration of the proxy request. Right now, in BlazeDS, because Servlet IO is blocking, when you make a proxy service call that hits our server the servlet request handler thread has to wait for the proxy request to return before it can return. So you tie up the thread for the duration of the call which could take awhile. Would you mind logging an enhancement request for async proxy service support in our bugbase? Thanks, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tim Stewart Sent: Thursday, May 22, 2008 9:56 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Hi Seth, could you say whether this is similar to the limitation in LiveCycle / Blaze proxy service, which causes multiple web service calls to be queued and executed in sequence rather than simultaneously - and whether there could be a similar approach to working around this? I have an application that calls several web services at startup, and the sequential vs. simultaneous thing really slows it down. Regards Tim From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MyoT Sent: Friday, 23 May 2008 11:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Hi Seth, This is awesome information. I didn't know player batch them up and send in one post. I learned something today. I digged through Blaze source code and found out that BatchProcessFilter is responsible for processing those messages . I am wondering is there any way, I can write our own batch process filter and plug that in instead of default one. What I am thinking is to process those messages in parallel on server then response to the client in one response. Basically, it would cut down the time server has to wait to finish processing all those messages sequentially. Any thoughts or insight info would be appreciated. Thanks, Jay --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: There is a single thread that advances through SWF frames and runs your ActionScript code and event handlers, but network calls are performed by separate background threads concurrently. In order to have calls processed concurrently on the server, they need to arrive as separate requests. In the case of AMF, if you make a series of calls quickly chances are good/excellent that the Player will batch them up and send them to the server in the body of a single HTTP POST. When this happens, the server must unpack them and process them serially and then pack the results for all these calls back up in the body of a single HTTP response. Because we're dealing with a single request and response, there's no way to send back results for individual calls separately. When these results get back to the browser and are passed back into the Player, they are dispatched to your ActionScript handling code as asynchronous events. There's not a good way to force calls to be sent as separate requests, and even if you could, browsers impose limits on the number of concurrent connections they'll open to a server, so this really isn't the right way to solve your scenario. Also, in the case of RTMP all traffic between the client and server happens over a single connection and is ordered serially. If you want to process calls/messages/data asynchronously on the server the proper way, it requires a bit of work on your part to accomplish at this point. Rather than running your current logic in your RemoteObject directly when it is invoked, you need to break that out into a Runnable class, and when you're invoked, create an instance of this class that packages up the incoming args and info about the client making the call and then submit that for asynchronous execution to a java.util.concurrent.Executor that you'd need to set up during server startup. Your remoting method could return a job id or just void once it has queued an instance of your Runnable with the Executor. On the client when you get a ResultEvent for your call you don't get the actual result - you just know that your invocation
RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS
Right, only for AMF, and I'm not aware of any documentation on that. If there was, it would be regarding NetConnection.call(...). URLLoader doesn't do any batching - it just hands off HTTP requests to the browser to send. But when using URLLoader, you need to be aware that browsers impose connection limits to a single domain (a recommendation in the HTTP 1.1 spec) so even there you end up in a pseudo-serial situation with no direct control over whether requests will be sent serially or concurrently. You can use CNAME hacks to circumvent this (ie. Yahoo/Google maps downloading map tiles), but that's quite a bit more complex to configure and deploy and your app needs to be hardcoded to know about all your CNAMEs and to know when to use which for what calls. Our HTTPChannel, which uses URLLoader internally, serializes the requests it sends to sync up with the behavior of the AMFChannel and RTMPChannel and try to ensure that requests from the client to the server have a consistent, expected order (very important for Data Management). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Knudsen Sent: Friday, May 23, 2008 10:05 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Seth, where is this documented? Been looking for info on if the player batches calls up or not. So it does, but only for AMF? DK On Thu, May 22, 2008 at 2:34 PM, Seth Hodgson [EMAIL PROTECTED] wrote: There is a single thread that advances through SWF frames and runs your ActionScript code and event handlers, but network calls are performed by separate background threads concurrently. In order to have calls processed concurrently on the server, they need to arrive as separate requests. In the case of AMF, if you make a series of calls quickly chances are good/excellent that the Player will batch them up and send them to the server in the body of a single HTTP POST. When this happens, the server must unpack them and process them serially and then pack the results for all these calls back up in the body of a single HTTP response. Because we're dealing with a single request and response, there's no way to send back results for individual calls separately. When these results get back to the browser and are passed back into the Player, they are dispatched to your ActionScript handling code as asynchronous events. There's not a good way to force calls to be sent as separate requests, and even if you could, browsers impose limits on the number of concurrent connections they'll open to a server, so this really isn't the right way to solve your scenario. Also, in the case of RTMP all traffic between the client and server happens over a single connection and is ordered serially. If you want to process calls/messages/data asynchronously on the server the proper way, it requires a bit of work on your part to accomplish at this point. Rather than running your current logic in your RemoteObject directly when it is invoked, you need to break that out into a Runnable class, and when you're invoked, create an instance of this class that packages up the incoming args and info about the client making the call and then submit that for asynchronous execution to a java.util.concurrent.Executor that you'd need to set up during server startup. Your remoting method could return a job id or just void once it has queued an instance of your Runnable with the Executor. On the client when you get a ResultEvent for your call you don't get the actual result - you just know that your invocation was successfully queued for asynchronous execution on the server. So the second half of the equation is how to get the result or fault generated when the Executor runs your Runnable back to the client. You need to take advantage of messaging in BlazeDS or LCDS to achieve this. In your client app, create a Consumer and subscribe to a destination you define that you can publish results/faults as AsyncMessages back to target clients from your Runnable. Your Consumer should subscribe to a subtopic that applies only to it, or use a selector expression. When your Runnable runs and generates the result or fault to return, you'd can create an AsyncMessage containing the result of fault info and publish it to this destination, using either a subtopic header, or some other message header that will be evaluated against the Consumer's selector expression such that the message is routed to the proper Consumer. That lets you return async results or faults to clients in a truly asynchronous manner. This is actually something I'd like to see us bake into the product directly. Would one of you on the thread log an enhancement request here and the rest of you vote for it: https://bugs.adobe.com/blazeds/ No promises because resourcing is always a juggle but lots of people ask for this, I'd like to see it happen, and your votes matter J Seth From: flexcoders
RE: [flexcoders] Application crash due to Channel disconnected
Hi, What version of Data Services are you using and what Linux distro? I'd suggest turning on server-side logging in services-config.xml, with at least the Endpoint.RTMP and Protocol.RTMP categories enabled. The RTMP connection between the client and server is closing while the client has an outstanding call in progress (hence the 'DeliveryInDoubt'). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tuncay A. Sent: Friday, May 23, 2008 12:43 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Application crash due to Channel disconnected Hi, I hope some of you guys can help me. I made my first company Flex application integrated into a webapplication using Java Dataservice to communicate to backend. On Windows machine it works properly. When deploying into a Linux machine it crashes almost all time when the application either is launched or refreshed in a browser (IE/Firefox). Using Adobe flex SDK 3.+ , DataService, Flash 9+ on client it doesn't help. The exception I get is: --- [RPC Fault faultString=Channel disconnected faultCode=Client.Error.DeliveryInDoubt faultDetail=Channel disconnected before an acknowledgement was received] at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::dispatchFaultEvent() at DataListRequestResponder/fault() at mx.rpc::AsyncRequest/fault() at NetConnectionMessageResponder/channelDisconnectHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.messaging::Channel/disconnectSuccess() at mx.messaging.channels::NetConnectionChannel/internalDisconnect() at mx.messaging.channels::RTMPChannel/internalDisconnect() at mx.messaging.channels::RTMPChannel/statusHandler() I'm stuck and hope some can help. -tuncay -- View this message in context: http://www.nabble.com/Application-crash-due-to-Channel-disconnected-tp17316630p17316630.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS
There is a single thread that advances through SWF frames and runs your ActionScript code and event handlers, but network calls are performed by separate background threads concurrently. In order to have calls processed concurrently on the server, they need to arrive as separate requests. In the case of AMF, if you make a series of calls quickly chances are good/excellent that the Player will batch them up and send them to the server in the body of a single HTTP POST. When this happens, the server must unpack them and process them serially and then pack the results for all these calls back up in the body of a single HTTP response. Because we're dealing with a single request and response, there's no way to send back results for individual calls separately. When these results get back to the browser and are passed back into the Player, they are dispatched to your ActionScript handling code as asynchronous events. There's not a good way to force calls to be sent as separate requests, and even if you could, browsers impose limits on the number of concurrent connections they'll open to a server, so this really isn't the right way to solve your scenario. Also, in the case of RTMP all traffic between the client and server happens over a single connection and is ordered serially. If you want to process calls/messages/data asynchronously on the server the proper way, it requires a bit of work on your part to accomplish at this point. Rather than running your current logic in your RemoteObject directly when it is invoked, you need to break that out into a Runnable class, and when you're invoked, create an instance of this class that packages up the incoming args and info about the client making the call and then submit that for asynchronous execution to a java.util.concurrent.Executor that you'd need to set up during server startup. Your remoting method could return a job id or just void once it has queued an instance of your Runnable with the Executor. On the client when you get a ResultEvent for your call you don't get the actual result - you just know that your invocation was successfully queued for asynchronous execution on the server. So the second half of the equation is how to get the result or fault generated when the Executor runs your Runnable back to the client. You need to take advantage of messaging in BlazeDS or LCDS to achieve this. In your client app, create a Consumer and subscribe to a destination you define that you can publish results/faults as AsyncMessages back to target clients from your Runnable. Your Consumer should subscribe to a subtopic that applies only to it, or use a selector expression. When your Runnable runs and generates the result or fault to return, you'd can create an AsyncMessage containing the result of fault info and publish it to this destination, using either a subtopic header, or some other message header that will be evaluated against the Consumer's selector expression such that the message is routed to the proper Consumer. That lets you return async results or faults to clients in a truly asynchronous manner. This is actually something I'd like to see us bake into the product directly. Would one of you on the thread log an enhancement request here and the rest of you vote for it: https://bugs.adobe.com/blazeds/ No promises because resourcing is always a juggle but lots of people ask for this, I'd like to see it happen, and your votes matter J Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of MyoT Sent: Thursday, May 22, 2008 10:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS If Flex (Flash) uses async request, does Single Threaded matter? I tried to have more than one channel, it doesn't help either. - Jay --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , twcrone70 [EMAIL PROTECTED] wrote: Your server code might be able to run things concurrently but unless I misread something, Flash is currently single threaded I believe. So actually sending the requests at the 'same time' is difficult if even possible. - Todd --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , MyoT bighead007us@ wrote: Hi There, I am wondering is there any way, you can make concurrent requests to one destination via RemoteObject over AMF. Basically, I want to issue multiple request of getItem operations to one destination. Currently, my command is making multiple async requests but RemoteObject doesn't seem to be calling server concurrently. Server got those request in sequential. Any help or pointer would help. Thanks in advance, Jay image001.jpgimage002.jpg
RE: [flexcoders] Re: RemoteObject connections over HTTPS fails..
that is in the samples provided by BlazeDS all i see is the MessageBrokerServlet in web.xml. But we wanted the autogeneration of SWF Files when a request is made for *.mxml Files.. Appreciate your help.. Thanks Mars --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: What version of the product are you using? Based on that stack trace, it looks like your FlexMxmlServlet is attempting to load and init a MessageBrokerServlet. That seems odd. How do you have these servlets configured in web.xml? Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sk_acura Sent: Wednesday, May 21, 2008 3:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: RemoteObject connections over HTTPS fails.. Hi, First of all thanks so much for your response.. I tried chaning my secure channel defintion as you suggested and now i am getting the following Error in the log.. [ERROR] flex.messaging.config.ConfigurationException: Invalid channel endpoint class 'flex.messaging.endpoints.AMFEndpoint' specified for 'channel-secure-amf'. INFO: FlexMxmlServlet: Adobe Flex Web Tier Compiler Build: 155539 May 21, 2008 6:16:59 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable flex.messaging.config.ConfigurationException: Invalid channel endpoint class 'flex.messaging.endpoints.AMFEndpoint' specified for 'channel-secure-amf'. at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:141) at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:82) at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:105) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:619) May 21, 2008 6:16:59 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet MessageBrokerServlet flex.messaging.config.ConfigurationException: Invalid channel endpoint class 'flex.messaging.endpoints.AMFEndpoint' specified for 'channel-secure-amf'. at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:141) at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:82) at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:105) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:619) [/ERROR] Here is the channel Def.. [CODE] channel-definition id=my-secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint uri=https://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition [/CODE] I tried even copying the Flex3 SDK Jars and the Jars from BalzeDS (3.0.544) build with no luck.. Thanks Mars --- In flexcoders@yahoogroups.com, Seth Hodgson shodgson@ wrote: If you have a proxy between the client and server that rewrites HTTPS requests to HTTP requests before forwarding to the app server you need you channel-definition to specify a secure client-side channel class and URL, and an insecure server side endpoint class. So, something like
RE: [flexcoders] Re: Is it possible to invoke a AMF call just before browser close?
Also, watch out for the fact that BlazeDS automatically resets the session when it is invalidated, so if you do session.invalidate() within a remoteobject method on the server the current session will be invalidated but a new, empty session is automatically regenerated (i.e. request.getSession(true)). This is done in case there are any further messages in the current batch being processed that could potentially blow up during processing if there's a dependency on the session. Using the trick Mete mentions below, you can call into your swf and invoke disconnectAll() on your channelSet. This will inform the server that the client is going away. The default behavior on the server in this scenario is to leave the current session in place in case the user has other apps/pages running that depend on it. But you can trigger a clean session invalidation (that will not create a new session) by adding the optional 'invalidate-session-on-disconnect' config setting to your endpoint. Eg. channel-definition id=my-amf class=mx.messaging.channels.AMFChannel endpoint url=http://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ properties invalidate-session-on-disconnecttrue/invalidate-session-on-disconnect /properties /channel-definition When you handle a click of your logout button, you could just invoke logout() on your channelSet which will invalidate your server session, clear out any authed Principal, and leave you in a state where the user could log back in if they wished. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of meteatamel Sent: Tuesday, May 20, 2008 5:37 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Is it possible to invoke a AMF call just before browser close? I'd try onunload and onbeforeunload events to see they help. If that doesn't help, I'd try putting up an Alert box before making the AMF call to make sure AMF call is made before the browser is closed. -Mete --- In flexcoders@yahoogroups.com, Dan [EMAIL PROTECTED] wrote: Hi, I am trying to invalidate a session by explicity invoke a AMF call when the user click logout or closing the browswer. By ExternalInterface, the CLOSE event is capture within the FLEX correctly. But by tracing in the debugger, if a AMF is invoke upon this, the call did invoke but the AMF call is not sent to through the FDS, I wonder if the application is being killed before the FDS successfully sent the request. Is it not a good idea to invalidate a session in this way? Any Flexpert suggestion? : Dan
RE: [flexcoders] Re: Is it possible to invoke a AMF call just before browser close?
Yeah, that's a nice idea. For folks that use polling (with a polling interval of a few seconds) or long polling (with a server-side wait of up to a minute or two), if you tune your session timeout down to a little more than your polling roundtrip time then clients that are closed will not issue any more polls and their server sessions will be cleaned up pretty quickly. For streaming connections, which ping the client periodically if the connection is quiet, the session will stay alive as long as the streaming connection is open. When it closes, the session will get a chance to time out, so here as well, tuning down to a minute or two would probably do the trick. If you need to shoot for more immediate disconnect notification, see the comments for the thread titled: Re: Is it possible to invoke a AMF call just before browser close? If you're doing RPC style interaction (no messaging) with the server over a non-polling, non-streaming channel, Todd's approach is a great way to handle this (he's avoiding busy polling the server by scheduling his keep alive ping just a bit shorter than his tuned down server session timeout). If you're using a polling or streaming channel you don't need to do this manually because the channel is doing more or less the same thing on your behalf. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of twcrone70 Sent: Tuesday, May 20, 2008 6:16 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Is it possible to invoke a AMF call just before browser close? My guess is this is highly unlikely to work consistently if at all. We simply have our session timeout short enough that the session will not be 'orphaned' very long. In the client app, we put in a 'keep alive' call to 'something' on the server on a timer shorter than the session timeout. If this call fails, it tries again several times more quickly before warning the user that the server session may have timed out or something. Not sure if this is a great idea but I'd love to hear any other suggestions on this one. - Todd --- In flexcoders@yahoogroups.com, meteatamel [EMAIL PROTECTED] wrote: I'd try onunload and onbeforeunload events to see they help. If that doesn't help, I'd try putting up an Alert box before making the AMF call to make sure AMF call is made before the browser is closed. -Mete --- In flexcoders@yahoogroups.com, Dan yldleung@ wrote: Hi, I am trying to invalidate a session by explicity invoke a AMF call when the user click logout or closing the browswer. By ExternalInterface, the CLOSE event is capture within the FLEX correctly. But by tracing in the debugger, if a AMF is invoke upon this, the call did invoke but the AMF call is not sent to through the FDS, I wonder if the application is being killed before the FDS successfully sent the request. Is it not a good idea to invalidate a session in this way? Any Flexpert suggestion? : Dan
RE: [flexcoders] Re: Is the context-root value burnt into SWF?
Hi Robert, You're best of in this scenario just creating your Channels directly. The ChannelSet, in its auto-configured mode, lazily fills in its list of Channels as needed based on their ids. That's why your code below is returning 'undefined'. Alternately, you could take a look at the mx.messaging.config.ServerConfig class and do something similar to bootstrap your channels based on baked in config (if you compile with -services). Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Csiki Sent: Tuesday, May 20, 2008 8:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Is the context-root value burnt into SWF? Hi Seth, Sorry to bother you again... how to get the channel sets before connecting? This is what I'm trying to do: _remoteObject = new RemoteObject(); _remoteObject.destination = remoteObjectDestination; var cs:ChannelSet = ServerConfig.getChannelSet(remoteObjectDestination); cs.channels.forEach( function(channel:*, index:uint, array:Array):void { Channel(channel).uri.replace({context.root}, contextRoot); }); This approach does not work, all the channels from the channel set are marked as undefined. remoteObjectDestination and contextRoot are both String properties. Thanks, Robert --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: What about allowing your customers to edit the HTML wrapper to pass a flashvar in to the swf that explicitly defines the context root they're deploying to? Your code could check for this value and do your own string replace of any {context.root} tokens in your channel uris with this value before connecting (be careful when handling empty context root values). Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Csiki Sent: Friday, May 16, 2008 2:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Is the context-root value burnt into SWF? Thanks Seth, I understand it's different in Flex world. So does this mean customers are stuck with the context root we used when compiling the applic! ation (e.g. which is equals to the application WAR filename, less the extension)? We do not package the source code, all they get is the SWFs and some html wrappers. Robert --- In flexcoders@yahoogroups.com, Seth Hodgson shodgson@ wrote: A context root is a Java servlet-ism, which allows the container to route incoming requests to the correct web app. In HTML-land if you're using relative URLs, you generally never have to worry about this because the right value will be used automatically. It's a little more complicated for a non-HTML client. The context root for a web app can either be empty (i.e. /) or non-empty (i.e. /MyApp), and on the client when a swf loads, it can inspect its URL but it doesn't have any way to know what the server-side context root is. The MessageBrokerServlet that processes HTTP-based requests from F! lex clients is not relative to where the swf was loade! d from. You can define its path, which will generally be something like: http://{server}:{port}/{context.root}/messagebrokerservlet, but it could be anything. To send a request to it successfully, the client needs to use the correct context root. Take your URL below for example, http://localhost:8080/MyApp/..., is the context root / or is it /MyApp - who knows? Only the server. So unlike server name and port, the swf can't dynamically determine the correct context root value at runtime on the client. This means you need to either: 1. Specify it at compile time by hardcoding the proper context root into the URL in your services-config.xml file, or by using a {context.root} token in your URL in services-config.xml and passing the desired value at compile time using the mxmlc -context-root flag. 2. Hardcode i! t into your client side ActionScript code. 3. Use the web tier mxmlc compiler which can replace a {context.root} token with the correct value using HttpServletRequest#getContextPath() when you request a .mxml in the browser Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Csiki Sent: Friday, May 16, 2008 1:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Is the context-root value burnt into SWF? Hi there, Say I'm using a context root value MyApp when compiling my LCDS-based Flex application. I package everything into an archive called MyApp.war, depoly it on my Tomcat, startup tomcat, access the application using http://localhost:8080/MyApp, everything works fine (I have an index.html t! here that serves up the SWF) Now, if I want to de! ploy usi ng a different context root for my application (say MyApp1)... call it using the URL http://localhost:8080/MyApp1 ... nothing would work this time. The SWF still gets loaded, and that's it. It seems this context-root value that's set
RE: [flexcoders] RemoteObject connections over HTTPS fails..
If you have a proxy between the client and server that rewrites HTTPS requests to HTTP requests before forwarding to the app server you need you channel-definition to specify a secure client-side channel class and URL, and an insecure server side endpoint class. So, something like: channel-definition id=secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint uri=https://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition Note that the endpoint class is AMFEndpoint, not SecureAMFEndpoint. Regarding the error you get when you hit the secure endpoint directly in the browser (flex.messaging.MessageException: No configured channel has an endpoint path '/messagebroker/amfsecure'...); that's odd - are you sure you didn't edit your config file without restarting? Hope that helps, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sk_acura Sent: Wednesday, May 21, 2008 10:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] RemoteObject connections over HTTPS fails.. HI All, We have a BalzeDS based web app deployed on tomcat working fine when we use HTTP. How ever when we try to expose our web app over extranet the swf files that tries to connect to the Remote Object gets timed out.. Here are the channels that are configured in the services-config.xml [CODE] channels channel-definition id=my-amf class=mx.messaging.channels.AMFChannel endpoint uri=http://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ properties polling-enabledfalse/polling-enabled /properties /channel-definition channel-definition id=my-secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint uri=https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure; class=flex.messaging.endpoints.SecureAMFEndpoint/ /channel-definition channel-definition id=my-polling-amf class=mx.messaging.channels.AMFChannel endpoint uri=http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling; class=flex.messaging.endpoints.AMFEndpoint/ properties polling-enabledtrue/polling-enabled polling-interval-seconds8/polling-interval-seconds /properties /channel-definition channel-definition id=my-http class=mx.messaging.channels.HTTPChannel endpoint uri=http://{server.name}:{server.port}/{context.root}/messagebroker/http; class=flex.messaging.endpoints.HTTPEndpoint/ /channel-definition channel-definition id=my-secure-http class=mx.messaging.channels.SecureHTTPChannel endpoint uri=https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure; class=flex.messaging.endpoints.SecureHTTPEndpoint/ /channel-definition /channels [/CODE] And the default-channels set in remoting-config.xml and proxy-config.xml are [CODE] default-channels channel ref=my-secure-amf/ channel ref=my-secure-http/ channel ref=my-amf/ channel ref=my-http/ /default-channels [/CODE] First of all do i need to enable the secure-channels ?? As the https port is not enabled in the tomcat on which this web app is deployed.. How ever there is a proxy in between which rewrites the https requests as http requests and redirects them to the tomcat.. When i add the secure channels ( amf and http) in my default-channel list and i have included the trace target in my main mxml File.. It shows that it is pinging the my-secure-amf endpoint and doesn't get any response..( i get the same when i connect using http i.e, from the intranet) Now when i remove the secure channels from my default channel list and regenerate the .swf files (i have the servlet mapping configured to regenerate them if they don't exists already..) i can connect to the web app from intranet which uses my-amf channel. How ever when i try to connect over https the trace shows it is not getting any ping response from my-amf channel.. Also when i try the following URLs from my browser i get an Error.. http://localhost:8080/myapp/messagebroker/amfsecure [ERROR] flex.messaging.MessageException: No configured channel has an endpoint path '/messagebroker/amfsecure'. flex.messaging.MessageBroker.getEndpoint(MessageBroker.java:318) flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) [/ERROR] I am getting this Error in both intranet (using HTTP) and Extranet Environments (using Https) I have read the blog posts related to this (http://blog.crankybit.com/flex-remoting-over-ssl/) and doing exactly as it is suggested still unable to resolve the issue..!! Thanks Mars
RE: [flexcoders] Re: RemoteObject connections over HTTPS fails..
What version of the product are you using? Based on that stack trace, it looks like your FlexMxmlServlet is attempting to load and init a MessageBrokerServlet. That seems odd. How do you have these servlets configured in web.xml? Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sk_acura Sent: Wednesday, May 21, 2008 3:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: RemoteObject connections over HTTPS fails.. Hi, First of all thanks so much for your response.. I tried chaning my secure channel defintion as you suggested and now i am getting the following Error in the log.. [ERROR] flex.messaging.config.ConfigurationException: Invalid channel endpoint class 'flex.messaging.endpoints.AMFEndpoint' specified for 'channel-secure-amf'. INFO: FlexMxmlServlet: Adobe Flex Web Tier Compiler Build: 155539 May 21, 2008 6:16:59 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable flex.messaging.config.ConfigurationException: Invalid channel endpoint class 'flex.messaging.endpoints.AMFEndpoint' specified for 'channel-secure-amf'. at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:141) at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:82) at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:105) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:619) May 21, 2008 6:16:59 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet MessageBrokerServlet flex.messaging.config.ConfigurationException: Invalid channel endpoint class 'flex.messaging.endpoints.AMFEndpoint' specified for 'channel-secure-amf'. at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:141) at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:82) at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:105) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:619) [/ERROR] Here is the channel Def.. [CODE] channel-definition id=my-secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint uri=https://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition [/CODE] I tried even copying the Flex3 SDK Jars and the Jars from BalzeDS (3.0.544) build with no luck.. Thanks Mars --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: If you have a proxy between the client and server that rewrites HTTPS requests to HTTP requests before forwarding to the app server you need you channel-definition to specify a secure client-side channel class and URL, and an insecure server side endpoint class. So, something like: channel-definition id=secure-amf class=mx.messaging.channels.SecureAMFChannel endpoint uri=https://{server.name}:{server.port}/{context.root}/messagebroker/amf; class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition Note that the endpoint class is AMFEndpoint, not SecureAMFEndpoint. Regarding the error you get when you hit the secure endpoint directly in the browser
RE: [flexcoders] LCDS and channel usage
Hi Robert, Chances are you're trying to use DataService with auto-sync enabled over an AMFChannel that doesn't have polling enabled; if that's the case you won't receive any pushed updates. Auto-sync can be disabled for a DataService (say you're just doing CRUD interactions with the server and don't need pushed data in your app), and in that scenario using an AMFChannel with polling disabled works fine. Any channel type can be used with any service component. There's a general overview of the channel options and why you'd prefer one over another here, and the doc team is currently working on lots of improvements to the official docset in these areas: http://www.dcooper.org/blog/client/index.cfm?mode=entryentry=8E1439AD-4E22-1671-58710DD528E9C2E7 In terms of which channels are used by the client to interact with the server, this is defined by the order that Channels are assigned to your client-side ChannelSet (if you set things up directly in code). Or in the more automatic case, it's based on your services-config.xml file default-channels config, or a specific service's default-channels or a specific destination's channels. The best practice is to just define this list once at the top level in services-config.xml within the services section: services ... default-channels channel ref=rtmp/ channel ref=amf-polling/ /default-channels /services This default setting is applied to all services and destinations, unless you override at a specific service or destination. There's really no good use case to do that though, so just define the set of channels clients should use here at the top level. This list of Channels is what is burned into your swf when you compile with the -services option, and it's used to dynamically construct a ChannelSet on the client at runtime. There's no magic in the ChannelSet to determine which Channel from among the set to connect with - it starts with the first, and advances through until it successfully connects. If it looses connectivity, it continues through the list from its current position. So this component provides reconnect and high-availability by falling back through its options. So for the example above, the client will first try to connect via RTMP to your server-side RTMP endpoint's URL, and if that fails (say the client has a firewall blocking that port), it will fall back to a connect attempt over your AMFChannel (which has polling enabled). Hope that helps, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Csiki Sent: Friday, May 16, 2008 8:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] LCDS and channel usage Hi there, What channels are compatible with what service objects? For instance, I noticed the AMF family is not good for DataService. If you know of a ling that contains this service/channel matrix, I'd appreciate if you'll point it to me. Also: for each of the available services (DataService, HttpService, WebService, RemoteService), whenever they support multiple channels, what's the order these channels are being tried by the framework? Is this order configurable? How the framework decides the channel to use (the current channel)? Thanks, Robert
RE: [flexcoders] Re: RTMP port 2038
The RTMP endpoint runs its own internal server process to handle RTMP connections. This process needs to bind a port to accept connections on. If you're running multiple web apps on the same server, each with their own RTMP endpoint, these endpoints need to use unique ports (you can't have multiple processes bind the same server port to accept connections on). We deploy into a Java server as a web app which has pros and cons, and while the pros outweigh the cons, in this specific case RTMP configuration is not as trivial as it would be in a perfect world when you're deploying multiple apps in the same container. For servlet-based HTTP traffic, the servlet container is handling all network connections and IO, and routes inbound requests to the proper web app based on the requested URL; the web apps themselves aren't handling any network connections or HTTP traffic directly. This means that all of your web apps can be exposed on a single HTTP port (80 or 8400 or whatever) uniformly. But for RTMP, where we have to handle the networking ourselves, there's no safe way to have a single RTMP endpoint that services connections for any and all web apps because we're running within the context of a specific web app rather than as core code in front of all the web apps, and web application startup order isn't guaranteed to be deterministic and individual apps can be undeployed/redeployed at runtime making sharing a single RTMP endpoint defined in one web app with other web apps something we haven't tried to support - there are all kinds of ways for things to go wrong with that. An analogy would be trying to run each of your web apps in a unique instance of your Java server on the same machine. Try starting up multiple instances of Tomcat, each hosting just one of your web apps, where each Tomcat instance is configured to handle HTTP traffic on port 8400 - it doesn't work. So you need to define a unique port for each RTMP endpoint, and you'd need to build your client for each web app to use the proper corresponding port. Hope that helps, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Csiki Sent: Friday, May 16, 2008 8:25 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: RTMP port 2038 Thank you all. The use case is we noticed we can't depoy the same webapp twice on the same server host (the second one won't work right, because port 2048 is already taken). We tried changing the port but it did not work as the initial port value is burnt into the SWF. BTW, I can't find the DataService in FB3 online help documentation. It used to be ther ein FB2. What happened? Thanks, Robert --- In flexcoders@yahoogroups.com, Seth Hodgson [EMAIL PROTECTED] wrote: Create your RTMPChannel in ActionScript and assign it to your components for use. When you want to change its URL, invoke disconnectAll() on your ChannelSet, update your RTMPChannel's URL, and reconnect (by making a remoting call, issuing a DataService fill, etc.) I'm not sure what the use case is here though? Distributing a swf that will work against various servers which may be running their RTMP endpoints on different ports? Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Csiki Sent: Thursday, May 15, 2008 3:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] RTMP port 2038 Is it possible to change this port value in LCDS without the need to rebuild the SWF? Thanks.