AMF Channel - Project Relocation Issue

The problem I'm having came up when I tried moving a working BlazeDS/Flex/Java project on my local machine to a remote server. The way I've set up the server is with user directories (~username) style so I wanted to move my BlazeDS project under that directory (so the access url for the project would be something like: http://ip_address:8080/~username/blazeProject )
So I moved the project folder into the ~username subfolder of my web directory. When I moved the project there I started having problems with my AMF channel when I tried to use the RemoteObject communications that worked locally but now don't. This is the fault information I received:
>(mx.rpc::Fault)#0
errorID = 0
faultCode = "Client.Error.MessageSend"
faultDetail = "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://192.168.111.201:8080/blazeProject/messagebroker/amf'"
faultString = "Send failed"
message = "faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://192.168.111.201:8080/blazeProject/messagebroker/amf''"
name = "Error"
rootCause = (mx.messaging.events::ChannelFaultEvent)#1
bubbles = false
cancelable = false
channel = (mx.messaging.channels::AMFChannel)#2
authenticated = false
channelSets = (Array)#3
[0] (mx.messaging::ChannelSet)#4
authenticated = false
channelIds = (Array)#5
[0] "my-amf"
channels = (Array)#6
[0] (mx.messaging.channels::AMFChannel)#2
clustered = false
connected = false
currentChannel = (mx.messaging.channels::AMFChannel)#2
initialDestinationId = (null)
messageAgents = (Array)#7
[0] (mx.rpc::AsyncRequest)#8
authenticated = false
autoConnect = true
channelSet = (mx.messaging::ChannelSet)#4
clientId = (null)
connected = false
defaultHeaders = (null)
destination = "remoteReference"
id = "245BCB93-2D25-4C42-D6F7-92948FE615C8"
reconnectAttempts = 0
reconnectInterval = 0
requestTimeout = -1
subtopic = ""
connected = false
connectTimeout = -1
enableSmallMessages = true
endpoint = "http://192.168.111.201:8080/blazeProject/messagebroker/amf"
failoverURIs = (Array)#9
id = "my-amf"
mpiEnabled = false
netConnection = (flash.net::NetConnection)#10
client = (mx.messaging.channels::AMFChannel)#2
connected = false
objectEncoding = 3
proxyType = "none"
uri = "http://192.168.111.201:8080/blazeProject/messagebroker/amf"
piggybackingEnabled = false
polling = false
pollingEnabled = true
pollingInterval = 3000
protocol = "http"
reconnecting = false
recordMessageSizes = false
recordMessageTimes = false
requestTimeout = -1
uri = "http://{server.name}:{server.port}/blazeProject/messagebroker/amf"
url = "http://{server.name}:{server.port}/blazeProject/messagebroker/amf"
useSmallMessages = false
channelId = "my-amf"
connected = false
currentTarget = (mx.messaging.channels::AMFChannel)#2
eventPhase = 2
faultCode = "Channel.Connect.Failed"
faultDetail = "NetConnection.Call.Failed: HTTP: Status 404: url: 'http://192.168.111.201:8080/blazeProject/messagebroker/amf'"
faultString = "error"
reconnecting = false
rejected = false
rootCause = (Object)#11
code = "NetConnection.Call.Failed"
description = "HTTP: Status 404"

>        details = "http://192.168.111.201:8080/blazeProject/messagebroker/amf"
        level = "error"
      target = (mx.messaging.channels::AMFChannel)#2
    type = "channelFault"
Whoops that's not the right endpoint for the channel!  Instead of "http://192.168.111.201:8080/blazeProject/messagebroker/amf", I want http://192.168.111.201:8080/~username/blazeProject/messagebroker/amf" right?  So I went into my services-config file and changed the my-amf endpoint url to "".  Hmm, I'm still running into the same fault as above except that the endpoint url is now "http://192.168.111.201:8080/~username/blazeProject/messagebroker/amf".
Changed:
>     
To:
>     
I've also tried hard coding an absolute url in there to no avail:
>     
I've tried setting up a similar username subfolder setup on my local machine and am getting the same error so it must be something in my configuration files that is amiss.  It looks like my Flex code is looking for the AMF channel in the right place, but it the server side stuff isn't setting it up properly (when I navigate to "http://192.168.111.201:8080/~username/blazeProject/messagebroker/amf" in a browser it returns a 404 response when a 200 response is expected).  Any idea where I'm missing that code?  I've been looking at the web.xml file and am thinking that the solution may be in the servlet-mapping there, but I'm not sure how I would change that to do what I wish.
I've done a lot of tinkering and can't seem to find a solution myself, so I'm hoping someone on here can steer me in the right direction!  Any suggestions would be greatly appreciated!
One other thing: I've read that sometimes this error is thrown when there are initialization errors when deploying the project, but I've checked the server logs and that's not the case here...

Similar Messages

  • Amf channels overrided in modules?

    Hi All,
          I am facing serious problem in modules amf channels... I have two modules like Module1 and Module2. Module one having seperate context root and seperate services-config.xml and module2 has also separate context root and services-config.xml..
          Modules having following end points and channels...
        Module1
             Channel :  my-amf
             endpoint : http://localhost:8080/Module1/messagebroker/amf
       Module2
           Channel : sen-amf
           endpoint : http://localhost:8080/Module2/messageborker/amf
            Now what is my problem is I am loading Module2 into Module1. when I do some service calls in Module1 it is directly taking Module2 endpoints and over there it is searching for the destination and service... I dont know why this happens.. Please help.. This is creating sevious problem in my project please help ..
    how to get out from this issue..
    Thanks
    Ram.

    I think each SWF might be installing its config in a central place so the
    last one overrides the first one.
    This is not my area of expertise, but I believe you can dynamically create
    the destinations.

  • AMF channel return object format

    Hey,
    I am working with BlazeDS and JBoss 5.
    In Jboss I have AuthentificationFilter  before  Remote Objects... So each request must pass throw this filter.
    On server side:
    In the filter I am checking login session data and if it is ok ,it passes to Remote Object.
    If not I make following :
    httpResponse.getWriter().write("Session Invalid");
    On flex side :
    I get fault result from server, and I don't see "Session invalid" string. I have the fault of Bad Version, because  it is not AMF Channel , I quess.
    The question is how can I get String from this filter ???
    Thanks a lot!

    Hello,
    I wanted to start a new post but when reading this post, I think it is the same kind of issue I am facing for a few days now.
    I am using WebSphere (v6.1) and Java (EJB 2...) with Flex 3.4 as the frontend talking to BlazeDS.
    In some cases based on properties, my application (EJBs) should still be available but the UI (Flex) should be disabled.
    Throwing java exception in the (java) services methods works just fine since you can get the exception in Flex through the fault rootCause but I need/want to block the Flex app/calls before that...
    To do so, I thought that a (java) ServletFilter added in the web.xml would be the right place to process this check.
    If the properties says that the UI should not be accessed before launching the application frontend it is working just great. Indeed I am calling a servlet that will display the flash <object ...> but the filter is able to return an HTML information page...
    if the properties are set later on, when the flex app is already running, I am facing the issue!
    I tried several things but I can't get a usable message on flex side...
    In my "doFilter" method, I did try this:
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
              throws IOException, ServletException {
         // Cast the request & response
         HttpServletRequest request = (HttpServletRequest) req;
         HttpServletResponse response = (HttpServletResponse) res;
         // Try to send an exception that I could catch/match (at least the message) on the flex side...
         response.resetBuffer();
         response.setContentType("application/x-amf");
         MessageException me = new MessageException("Application closed");
         ErrorMessage em = me.getErrorMessage();
         FlexClient flexClient = FlexContext.getFlexClient();
         em.setClientId(flexClient.getId());
         Amf3Output amfOutput = new Amf3Output(SerializationContext.getSerializationContext()); 
         amfOutput.setOutputStream(response.getOutputStream()); 
         amfOutput.writeObject(em);
         amfOutput.flush(); 
         amfOutput.close(); 
         return;
    When doing so, I get an "Unsupported AMF version 2689" in Flashbug/Firebug under Firefox.
    And I first tried a much more simple thing (in the "doFilter" method) such as :
    throw new UnavailableException("Application closed");
    or
    res.sendError(HttpServletResponse.SC_TEMPORARY_REDIRECT);
    return;
    and I get this error :
    faultCode:Client.Error.DeliveryInDoubt faultString:'Channel disconnected'
    faultDetail:'Channel Disconnected before an acknowledement was received'
    I really hope someone will be able to help us since it does not look like a crazy use case.
    I have also tried to override the MessageBrokerServlet but I am facing the same issues...
    Thank you very much for your help and keep on doing great job on BlazeDS!!!

  • Java Remoting over AMF channel slow from internet

    Hi
    We have a Flex app that uses an AMF channel to call a Java object on LCDS. The LCDS is a default 2.5.1 install on windows, running the built in JBOSS server.
    When we run the flex client on the lan, response is excellent. When we call it from outside the firewall, we get a 5 to 7 second delay on the all Java calls. The app also uses SQL assember, but we dont see any perfomance issue with the data service calls.
    The LCSD server is behind our firewall, and we are doing simple port forwarding of 8700 and 2038 to enable access from outside teh firewall.
    To test, I set up a very simple java method, and if I call it from a pc on the lan I get an instant response. If I call it via the internet, I get a 5 second delay. This shows that bandwidth is not the issue.
    My suspicion is that the problem is with polling on a simple amf channel. I tried to setup a streamingAMFchannel, but got a class not found error. I set up long polling, but got the same result.
    Here is more background:
    I created a simple java method:
        public String ping() {
            Calendar cal = Calendar.getInstance();
            String time = cal.getTime().toString();
            fLogger.info("Ping Received at "+time);
            return time;
    I call this from a form
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
          <mx:RemoteObject
                id="testBed" 
                destination="testBed">
              <mx:method name="ping" result="pingHandler(event.result)"/>
          </mx:RemoteObject>
                <mx:Script><![CDATA[
                private function ping():void {
                      var date:Date = new Date();
                      msgBox.text=msgBox.text+"Calling ping  at "+date.toLocaleTimeString()+" "+date.getMilliseconds()+"\n"
                      testBed.ping()
                      date = new Date();
                      msgBox.text=msgBox.text+"Ping  called  at "+date.toLocaleTimeString()+" "+date.getMilliseconds()+"\n"
                private function pingHandler(result):void {
                      var date:Date = new Date();
                      msgBox.text=msgBox.text+"Ping returned at "+date.toLocaleTimeString()+" "+date.getMilliseconds()+"\n"
                      msgBox.text=msgBox.text+"Ping returned   :"+result+"\n"
                }     ]]>   </mx:Script>
                <mx:Button x="35" y="268" label="Ping" id="pingButton" click="ping()"/>
                <mx:TextArea x="19" y="10" width="371" height="250" id="msgBox" text=""/>
    </mx:Canvas>
    When I run over the net I get
    Calling ping  at 04:19:11 PM 593
    Ping  called  at 04:19:11 PM 593
    Ping returned at 04:19:16 PM 562
    Which is a 5 second delay
    I have attached my config files.
    Any suggestions would be appreciated.
    Cheers
    James

    Can you give a little more information on the architecture of your application layers and where do they run?
    Do you use ADF BC? Are they running on the client machine or on a server through EJB?
    Also does running a form that doesn't connect to the DB also slow on the remote clients?
    You can try to use the profiler in JDeveloper to monitor your application and see which events takes place when.

  • Develop a Integrated Report of Program and Project Risks, Issues and Opportunities from Project Sites

    Does anyone know if it is possible to create an integrated report of all program / project risks, issues and opportunities as identified on project sites? We plan on having our project teams identify and manage these on their project sites but would like
    to  ability to roll this information up into a report for management review.  Need to know if this is possible and how it might be done. Thanks.

    Hi,
    are you asking for a Reporting Services Report? You can find this information in Reporting DB (2010) resp. schema dbo for reporting (2013).
    Here a simple query:
    SELECT PROJ.ProjectName
    , ISSUE.Title AS Issue
    , RISK.Title AS Risk
    FROM dbo.MSP_EpmProject_UserView AS PROJ
    LEFT OUTER JOIN dbo.MSP_WssIssue_OlapView AS ISSUE ON PROJ.ProjectUID = Issue.ProjectUID
    LEFT OUTER JOIN dbo.MSP_WssRisk_OlapView AS RISK ON RISK.ProjectUID = PROJ.ProjectUID
    Or are you looking for something different?
    Regards
    Barbara
    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find
    an appropriate solution faster. Thanks for your support!

  • My AMF channel seem to be a polling one

    Hello everyone.
    When i'm trying to use a simple amf channel for my messaging service, it looks like that some king of polling is happening instead. I'm testing this on simple chat application, and when i'm sending, for example, 4 message in a row I have to wait few second to see them appear in the right place.
    Beside that i'm not doing anything, once i have subscribed to the destination, i can see in the blazeds log that the same messaging action is going over and over. Here is a sample of the log
    [BlazeDS] Channel endpoint my-lol received request.
    [BlazeDS] Deserializing AMF/HTTP request
    Version: 3
    (Message #0 targetURI=null, responseURI=/99)
    (Array #0)
    [0] = (Externalizable Object #0 'flex.messaging.messages.CommandMessageExt')
    (Object #1)
    (Object #2)
    DSId = "5669DA6B-360B-0DB5-61E4-2B7EF19B15B5"
    (Byte Array #3, Length 16)
    2
    [BlazeDS] Before handling general client poll request.
    incomingMessage: Flex Message (flex.messaging.messages.CommandMessageExt)
    operation = poll
    clientId = null
    correlationId =
    destination =
    messageId = AFDBF526-C039-0761-A2CD-CF71C19A7061
    timestamp = 1223251050921
    timeToLive = 0
    body = {}
    hdr(DSEndpoint) = my-lol
    hdr(DSId) = 5669DA6B-360B-0DB5-61E4-2B7EF19B15B5
    [BlazeDS] After handling general client poll request.
    reply: Flex Message (flex.messaging.messages.AcknowledgeMessage)
    clientId = null
    correlationId = null
    destination = null
    messageId = 5674B9CD-9919-6D3D-2E72-A81BC9E2866B
    timestamp = 1223251050921
    timeToLive = 0
    body = null
    [BlazeDS] Serializing AMF/HTTP response
    Version: 3
    (Message #0 targetURI=/99/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
    1.223251050921E12
    (Byte Array #1, Length 16)
    And so on ! (only the Id are changing)
    Again i'm doing simple things here, I have a producer and a consumer with the same destination "chat". This destination is using a channel named "my-lol" but it's a copy of the default "my-amf" one.
    Can you explain to me what is happening ?
    Thank you

    As you know, to use a Consumer you'll need a channel capable of push (or at least one that can simulate it) in order to receive updates. The AMFChannel sends and receives AMF messages over HTTP, so if you want to received pushed messages you'll either need a long lived connection or some method of polling at a reasonable interval to simulate it.
    While LCDS more channels than BlazeDS, I suggest reading Seth's documentation on the pros and cons of each kind of channel so that you can pick which approach you want based on your needs and application environment.
    http://www.dcooper.org/Blog/client/index.cfm?mode=entry&entry=8E1439AD-4E22-1671-58710DD52 8E9C2E7
    Pete
    From: Jordan Amar [mailto:[email protected]]
    Sent: Sunday, October 05, 2008 8:10 PM
    To: [email protected]
    Subject: my AMF channel seem to be a polling one
    A new discussion was started by Jordan Amar in
    Configuration and Getting Started Discussion --
    my AMF channel seem to be a polling one
    Hello everyone.
    When i'm trying to use a simple amf channel for my messaging service, it looks like that some king of polling is happening instead. I'm testing this on simple chat application, and when i'm sending, for example, 4 message in a row I have to wait few second to see them appear in the right place.
    Beside that i'm not doing anything, once i have subscribed to the destination, i can see in the blazeds log that the same messaging action is going over and over. Here is a sample of the log
    [BlazeDS] Channel endpoint my-lol received request.
    [BlazeDS] Deserializing AMF/HTTP request
    Version: 3
    (Message #0 targetURI=null, responseURI=/99)
    (Array #0)
    [0] = (Externalizable Object #0 'flex.messaging.messages.CommandMessageExt')
    (Object #1)
    (Object #2)
    DSId = "5669DA6B-360B-0DB5-61E4-2B7EF19B15B5"
    (Byte Array #3, Length 16)
    2
    [BlazeDS] Before handling general client poll request.
    incomingMessage: Flex Message (flex.messaging.messages.CommandMessageExt)
    operation = poll
    clientId = null
    correlationId =
    destination =
    messageId = AFDBF526-C039-0761-A2CD-CF71C19A7061
    timestamp = 1223251050921
    timeToLive = 0
    body = {}
    hdr(DSEndpoint) = my-lol
    hdr(DSId) = 5669DA6B-360B-0DB5-61E4-2B7EF19B15B5
    [BlazeDS] After handling general client poll request.
    reply: Flex Message (flex.messaging.messages.AcknowledgeMessage)
    clientId = null
    correlationId = null
    destination = null
    messageId = 5674B9CD-9919-6D3D-2E72-A81BC9E2866B
    timestamp = 1223251050921
    timeToLive = 0
    body = null
    [BlazeDS] Serializing AMF/HTTP response
    Version: 3
    (Message #0 targetURI=/99/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
    1.223251050921E12
    (Byte Array #1, Length 16)
    And so on ! (only the Id are changing)
    Again i'm doing simple things here, I have a producer and a consumer with the same destination "chat". This destination is using a channel named "my-lol" but it's a copy of the default "my-amf" one.
    Can you explain to me what is happening ?
    Thank you
    View/reply at my AMF channel seem to be a polling one
    Replies by email are OK.
    Use the unsubscribe form to cancel your email subscription.

  • [svn:bz-4.0.0_fixes] 23961: Bug#3200562: New Flex Session Id generated while disconnect with streaming amf channel

    Revision: 23961
    Revision: 23961
    Author:   [email protected]
    Date:     2012-06-15 04:42:44 -0700 (Fri, 15 Jun 2012)
    Log Message:
    Bug#3200562: New Flex Session Id generated while disconnect with streaming amf channel
    While invalidating session, make sure a new one does not get created.
    Modified Paths:
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/endpoints/BaseStreamingHTTPE ndpoint.java
    Property Changed:
        blazeds/branches/4.0.0_fixes/modules/

    You're trying to do this directly in ActionScript without using Flex, correct?
    The mxmlc compiler for Flex adds some registerClassAlias calls to map types between the client and the server. This will be missing if try to use the messaging code outside of a Flex app.
    Take a look at the mx.utils.RpcClassAliasInitializer class in rpc.swc. This has a static registerClassAliases method that will do the class registration for you. You should just need to call this before running your messaging code.
    -Alex

  • [svn:bz-4.6.x] 23962: Bug#3200562: New Flex Session Id generated while disconnect with streaming amf channel

    Revision: 23962
    Revision: 23962
    Author:   [email protected]
    Date:     2012-06-15 04:57:45 -0700 (Fri, 15 Jun 2012)
    Log Message:
    Bug#3200562: New Flex Session Id generated while disconnect with streaming amf channel
    While invalidating session, make sure a new one does not get created.
    Modified Paths:
        blazeds/branches/4.6.x/modules/core/src/flex/messaging/endpoints/BaseStreamingHTTPEndpoin t.java

    I thought the same that those devices simply are too old. However I would like to know what causes this capabilities change. We want to get rid of the old H/W, but at the moment it looks as if we would need to revert back to the 4402 in order to get those things working again.
    I have not enough information, but those devices are some kind of handhelds. Their MAC OUI belongs to Newport Electronics.
    Regards,
    Patrick

  • [svn:bz-trunk] 23960: Bug#3200562: New Flex Session Id generated while disconnect with streaming amf channel

    Revision: 23960
    Revision: 23960
    Author:   [email protected]
    Date:     2012-06-15 04:15:18 -0700 (Fri, 15 Jun 2012)
    Log Message:
    Bug#3200562: New Flex Session Id generated while disconnect with streaming amf channel
    While invalidating session, make sure a new one does not get created.
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseStreamingHTTPEndpoint.java

  • [svn:bz-trunk] 23948: Bug##3200562: New Flex Session Id generated while disconnect with streaming amf channel

    Revision: 23948
    Revision: 23948
    Author:   [email protected]
    Date:     2012-06-13 06:11:35 -0700 (Wed, 13 Jun 2012)
    Log Message:
    Bug##3200562: New Flex Session Id generated while disconnect with streaming amf channel
    On session time out, Flex Client is invalidated on the server side. It also results in Flex Session getting invalidated. In order to complete the client-server streaming connection handshake, the client ends up sending a CLOSE command. On the server side, for any work to be done, the MB first needs to creates a Flex Session (if none exists). After doing the necessary cleanup, the newly created Flex Session will also be invalidated. No stray Flex Sessions will left dangling...
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseStreamingHTTPEndpoint.java

  • [svn:bz-trunk] 18389: Eclipse Project Classpath issues:

    Revision: 18389
    Revision: 18389
    Author:   [email protected]
    Date:     2010-11-01 03:49:03 -0700 (Mon, 01 Nov 2010)
    Log Message:
    Eclipse Project Classpath issues:
    - Fixing class path entries.
    - Instead of jars pointing to the actual projects.
    Modified Paths:
        blazeds/trunk/development/eclipse/projects/java/blazeds-proxy/.classpath
        blazeds/trunk/development/eclipse/projects/java/blazeds-team.war/.classpath

    Figured out that it was failing while building a product for MacOS. I updated Tycho to use version 0.15.0 and all work well.
    For more information on the bug (case sensitive file systems) see:
    bugs.eclipse.org/bugs/show_bug.cgi?id=349877

  • Find Project From Issue?

    Hi  , I want to find project from Issue ? I have Issue guid number and ref guid number but ı am not finding project ?
    thanks for helps .

    This is PC
    Got the (ANSI-Latin 1) down. We have a project that in D10 we
    had to localize in Russian. Problem is that D10 did not support
    that code to display Russian correctly when working within D10.
    This support is in D11.
    So if I understand you correctly D10 is in ANSI-Latin 1. This
    is confusing cause when we upgrade the files it defaults to some
    Turkish code page. Does D11 auto read this formating when upgrading
    the files and if so should we be allowing the default or should we
    be telling D11 to use ANSI-Latin 1?

  • [svn:bz-trunk] 8678: Bug: BLZ-255 - trader desktop sample with per-client-qos-polling-amf channel is confusing

    Revision: 8678
    Author:   [email protected]
    Date:     2009-07-20 01:20:31 -0700 (Mon, 20 Jul 2009)
    Log Message:
    Bug: BLZ-255 - trader desktop sample with per-client-qos-polling-amf channel is confusing
    QA: No
    Doc: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-255
    Modified Paths:
        blazeds/trunk/apps/samples/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml

  • Using SoapProxy adapter and AMF channel - deserialization issue

    Hi, I am wondering if it's possible to reasonably communicate with SOAP based web service and use BlazeDS (SoapProxy adapter) as man in the middle. I get inspired from the test drive samples from BlazeDS so I use AMF to communicate with BlazeDS (AMFChannel) which consequently communicates with SOAP service. Everything works fine except the fact the type of custom classes is not preserved when response is received on the client. I have correctly registered aliasses of particular classes by flash.net.registerClassAlias(). How I can set BlazeDS to serialize SOAP responses from soap endpoint to amf message and set correct class type?

    Hi Anil,
    Refer Archiving concepts in below links.
    http://help.sap.com/saphelp_nw73/helpdata/en/44/682bcd7f2a6d12e10000000a1553f6/content.htm?frameset=/en/44/6830e67f2a6d12e10000000a1553f6/frameset.htm
    http://scn.sap.com/docs/DOC-35572
    Warm Regards,
    DNK Siddhardha.

  • Reconnecting to AMF channel after connection with BlaseDS has been lost

    Hi there,
    I am beginner to flex and I have a problem with to login after the connection to the BlaseDS has been lost.
    Setup:
    The flex client calls a HelloWorld Java service exposed using spring-flex.  This service is called when the user hit the Hello World button on the UI.  The channel set on which this service is exposed is secured and for now we will resort to programmatic authentication.  (The user does is not required to input his username and password, just to simplify it a bit). 
    As a client framework Cairngrom is used and an appriopriate delegate is setup to handle the remote object call.
    Here is a snippet from the HelloWorld delegate class called after the user hits the Hello World button.  
              public function getHelloWorldMessage():void{
                if(!__service.channelSet.authenticated){
                    var token:AsyncToken = __service.channelSet.login("username", "password");
                    token.addResponder(new AsyncResponder(
                        function(event:ResultEvent, token:Object = null):void {
                            Alert.show("You are logged in", "Login");
                            // Send the amf request to the backend.
                            var token2:AsyncToken = __service.getHelloWorld();
                            // Add the responder.
                            token2.addResponder(__responder);
                        function(event:FaultEvent, token:Object = null):void {
                            Alert.show("You are NOT logged in", "Login");
                }else{
                    // Send the http request.
                    var token2:AsyncToken = __service.getHelloWorld();
                    // Add the responder.
                    token2.addResponder(__responder);
    The __service is the Hello World service has been defined as follows.
    <mx:RemoteObject id="helloWorldServiceRemoteObject" destination="helloWorldService" channelSet="{helloWorldChannels}"/>
    <mx:ChannelSet id="helloWorldChannels" >
            <mx:AMFChannel uri="http://localhost:8080/helloworldservice-war-1.0.0.SNAPSHOT/messagebroker/amf/" />       
    </mx: ChannelSet>   
    What happens:
    User clicks on the Helloworld, the program hits the getHelloWorldMessage and the ChannelSet.login("username", "password") is called.   The channelset authentication flag is set to true, and the _authAgent present in the ChannelSet class which was previously null is set
    The success handler is called and the secured spring function returns the "Hello World" message.  
    I restart the BlaseDS server to simulate an intermittent connection.
    Now the user clicks on Hello World button again and recieves an error since the authentication flag is still set to true there is no attempt to login again.
    The following FaultEvent is caught
    faultCode=Client.Authentication
    faultString=An Authentication object was not found in the SecurityContext
    The user reclicks the Hello World button this time however the ChannelSet.authenticated  is set to false and the client code attempts to reconnect however fails.  The snippet below is an extract from the ChannelSet.as, when the user reclicks, the second condition is met and the  IllegalOperationException with error message "ChannelSet is in the process of logging in or logging out."  is thrown.  The condition is met since the _authAgent is not null. 
    public function login(username:String, password:String, charset:String=null):AsyncToken
            if (authenticated)
                throw new IllegalOperationError("ChannelSet is already authenticated.");
            if ((_authAgent != null) && (_authAgent.state != AuthenticationAgent.LOGGED_OUT_STATE))
                throw new IllegalOperationError("ChannelSet is in the process of logging in or logging out.");
            if (charset != Base64Encoder.CHARSET_UTF_8);
                charset = null; // Use legacy charset, ISO-Latin-1.
    Does someone have any ideas as to how to resolve this?

    Hi. That sounds like a bug to me. What version/build of BlazeDS are you using? I'd try this out with the latest (nightly) BlazeDS 3.x or BlazeDS trunk build and see if it's still an issue. If it's still an issue you can log a bug at http://bugs.adobe.com/blazeds. I'd think that after getting the authentication error the state of _authAgent would be set to the logged out state but that doesn't seem to be the case.
    You may be able to manually reset it for the time being. Maybe try calling ChannelSet.logout() in your fault handler and see if that does it.
    -Alex

Maybe you are looking for

  • How can i remotely connect to my mac without sharing my screen

    Hi, I have a Mac at work to which I occasionally connect from another Mac at home. Now I would love to export the applications similar to Linux where I just set the display to another device. Alternatively, I would also use screen sharing if the remo

  • Sql expressions field option not available in field explorer

    Hello: I would like to create a sql expression field in my report. however when I go to the field explorer panel, a sql expression fields node is not available to create one. Does anybody know why is this not an option? Thank You Very Much

  • Address Book: contact pictures gone

    I have a couple of hundred contact pictures in my Address Book. After I did a lot of syncing back and forth recently between 2 Macs and an iPhone, I notice that a lot of them don't show any more. From inspecting the Images folder in my Library, I thi

  • Manage the beer stock in three aspect

    hi gurus: here is the situation ,our store purchase  beer from  vendor or distribution center , and we manage the beer stock in three aspect (acctually the material is 24 bottle beer in a box) : 1.beer (liquid )   ( 1 beer stock per bottle ) 2.bottle

  • Creating Database Link ..

    I have created a Database Link in Oracle 10g for Oracle 9i. Link is created is successfully but when i test it it gives me error ORA-12154 TNS COULD NOT RESOLVE THE CONNECT IDENTIFIER SPECIFIED I have tested the connect string, thats working pretty f