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
Similar Messages
-
Kde4.1 beta Ksysguard issue "connection to localhost has been lost"
whenever I open system monitor I get pop-ups saying "connection to localhost has been lost", I keep getting the pop-ups and there is no way for me to kill the program and i have to do a hard restart, is there a way to get rid of the pop-up, I am unable to use ksysguard because of it.
I am using kdemod4xvalentinex wrote:
Hello, a little bit late, but posting for anyone coming to this thread in the future.
Try running ksysguardd from konsole.
For me, it errored out saying that I needed libXRes. A simple install of libxres fixed my problem.
Thanks for posting the fix. I've run into that issue several times under KDE4.x builds. -
E71x not vibrate after connected with PC Suite
Anyone has the same problem? My E71x purchased 2 days ago does not vibrate while and after connected with PC Suite. I had to turn off and turn it back on to activate the vibrating thing.
Thanksmmm... ill describe the whole situation:
phone has 2 days old
I connected it to the PC
Running PC SUITE
All was functioning normal, i had about half charge
i got a phone call from my gf, when i picked up the call, i disconnected the phone
the line dropped dead. so did the phone
i tried to restart it to no avail
i plugged it to the pc, didnt work
i removed the batter, didnt work
so i connected it to the power cord, and the lights turned on
i disconnected then tried to boot it up, and didnt work
i reconnected the power cord and started it while on external power, and it did start, showing just 1 little bar of battery.
I left it there for about 1hr and removed it, and charge was FULL
i reconnected to PC and im monitoring it and it hasn't discharged
so its weird... <.<
my guess is that unlike HTC or Sony Ericsson phones, the data cable and hte power cable CAN be connected at the SAME TIME. that would be the only explanaition on why it doenst charge up on the USB (but ohter theory of mine is that if i connect it to the PC on file trnasfer mode, it might charge it) -
Device button no longer appears in iTunes after connecting with USB cable
Since updating software to OUS 7.0.4 my device buttton no longer appears in the iTunes window after connecting with USB cable
Problem solved. I needed to reinstall my Apple Mobile Driver. I found the solution on this web site.
iOS: Device not recognized in iTunes for Windows http://support.apple.com/kb/YS1538
After I reinstalled the driver, my iPohne immediately synchronized with my computer. -
I have tried everything, but still I can't locate the photos tab in iTunes...I have tried changing the resolution, started iTunes after connecting with the ipad2, nothing seems to work! please advise!
I am also providing you with a screenshot of what appears! I need photos on my iPad2
Message was edited by: anganaYou don't see it on the left-hand side of iTunes - you need to connect and select the iPad on the left-hand side, and then one of the tabs on the right-hand side that you use to select which content to sync to the iPad should be Photos : http://support.apple.com/kb/HT4236
You will need to select and sync all the photos that you want on the iPad together in one go as only the most recent sync remains on the iPad, not including photos in a subsequent sync is how you delete them from it. -
My ipod ejects itself, immediately after connecting with usb cable, before synchronizing could start. What’s wrong?
Have you tried plugging the iPod in with a different USB sync cable to verify the issue is not with the cable? It might not also hurt to connect it to another USB port as well.
Otherwise, try manually placing the iPod into Disk Mode and then connecting it to your PC.
Putting iPod into Disk Mode
B-rock -
I am using I phone 5c after connected with my HP elite book 6930p laptop, (Installed Window 7 32 bit). automatic software driver is not deducting, and display Windows found driver software for your device (MTP USD Device) but encountered an error while attempting to install it.
I did install itunes and update also. but the above problem still same.
Kindly give me solution of it. awaiting.
Regards
Abbas Kadertry it with another computer to check if it shows up
if so
uninstall all apple software
reboot
use regedit to search and remove all itunes keys
reboot
resinstall apple software
if non of that helps then try another cable
if that don't help could be your phones connector is damaged -
Why is atv slow to buffer after connecting with cat5 cable
Why is atv slow to buffer after connecting with cat5 cable
Update on some things I have tried
As I am not sure the cause, I have been reading and trying different things, last thing was to set the interfaces to Duplex Full
I did this on both the Ethernet ports on the routers, and both of the Fast Ethernet ports being used on the switch, but has not changed the speed that PC1 is getting.
Also turned on CEF on both routers -
Password failure after connecting with Desktop software
Hi everyone,
I recently installed the BB desktopsoftware on my MacBook Air and today tried to sync my BB.
My BB is password protected (4 digits) and the Air is also password protected.
Problem is; the desktop software started after connecting with the BB, a password prompt came up and I typed the device password --> wrong password message!!
What did I do wrong?
Should I typ the MacBook password?
Please help !!
I stand to lose a lot of information, as this is my first back-up/sync.
Thanks.Hi everyone,
I recently installed the BB desktopsoftware on my MacBook Air and today tried to sync my BB.
My BB is password protected (4 digits) and the Air is also password protected.
Problem is; the desktop software started after connecting with the BB, a password prompt came up and I typed the device password --> wrong password message!!
What did I do wrong?
Should I typ the MacBook password?
Please help !!
I stand to lose a lot of information, as this is my first back-up/sync.
Thanks. -
HT4623 How to use epson iprint after connected with iPad help
How to use epson iprint after connected with iPad help.
When you open Epson iPrint, you will see the various options of ways to proceed, e.g., Photos (to print photos), Maintenance (for printer maintenance). Scan (to perform scanning).
-
How do I get into iTunes to access Netflix, when I get "iTunes unable to connect until time has been set", after submiting my password?
You need to follow the instructions in this article that best apply to your situation:
Forgot passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support
If you do not have a backup in either iCloud or iTunes, then you will have no way to retain the information on your device because you will have to restore it in order to access it again.
Sorry,
GB -
The network connection to the printer has been lost.
I have reserved an IP address for my printer in my router. I routinely get the following message in Windows 8.1 64: "Scan to computer is no longer activated. The network connection to the printer has been lost." Also, when printing, sometimes the printing cuts out (i.e. half the job).
bcbrewster
Well, then the issue remains vague and you must track down a reason for the disconnect -- the connection is breaking between the printer and the computer -- and apparently, from your description - this even happens on occasion during a print job.
Event Viewer Logs
If the computer is aware of the cause, you might find it in the Event Viewer logs. There is a wealth of information packed into the daily logs kept by the system on a great many of the computer's actvitiies. The trick is to 1) find the log containing the information you seek, and 2) Decipher what you have found.
Reading Event Viewer logs is part science and part art. I cannot tell you precisely where to look because I don't know where your problem is located.
I can give you some information on how to get started:
Windows 8 Event Viewer
===============================================
Disconnections
Disconnection can be caused by a number of things, most of which you have probably already read about in your searches:
The issue could be due to the need for a Firmware Update. You would have noted this during your previous Troubleshooting - and the only Firmware update for this model is dated 2013.
HPCOM_HP_ENVY_4500_series_x86_000_003.exe
Reference:
HP ENVY 4500 e-All-in-One Printer
=======================================================
Possible causes for connection issues include and are not limited to:
The router should be no closer than three feet (about a meter) to the printer - too close is as bad as too far away
You can try moving things around -- even a few inches one way or another can help
Weak antennas or single antenna routers cannot be "magically" made better; these routers might perform better when placed higher in a room rather than lower. That is, place the router high on a shelf instead of low in a cabinet
Try changing the channel -- 6, 11 might work better
Try using a static IP outside of the DHCP range of the computers on the same network.
==========================================
References and Power Options
IF you are running a notebook
and if the notebook is running on battery
and if that notebook is running wireless
and if the notebook is having trouble staying connected
THEN:
Control Panel > icon view > Power Options >
Under Choose or customize a power plan >>
Under Plans shown on the battery meter >>
Next to HP Recommended >> Click Change Plan Settings >
Click Change advanced power Settings >
Scroll down and Open Wireless Adapter Settings >
Click Power Saving Mode >>
Adjust Power settings for On battery and for Plugged in Options
Click on the current option to enable the drop down menu and see the available settings wireless adapter / system
If you have been having trouble with running wireless on battery, consider setting the wireless to maximum performance while on battery.
Understand this uses more battery resource.
Click OK to save and exit
=================================
References:
Static IP Address for Printer
Settings to Improve Wireless Connectivity
Click the Kudos Thumbs-Up to say Thank You!
And...Click Accept as Solution when my Answer provides a Fix or Workaround!
I am pleased to provide assistance on behalf of HP. I do not work for HP.
Kind Regards,
Dragon-Fur -
The wifi has been lost or disconnected on my iPad. It's the iPad 2 and has not been updated yet. It's IOS 6.1.3 .. how do I add a network back onto it? I have typed in the name and chosen each of the securities and still hasn't connected!
Hey there Luba_kalstad,
It sounds like you are unable to join your network and cannot see it in the Wi-Fi list in Settings. I would try the troubleshooting outlined in this article named:
iOS: Troubleshooting Wi-Fi networks and connections
http://support.apple.com/kb/ts1398
Be sure you're in range of your Wi-Fi router (access point).
Tap Settings > Wi-Fi and turn Wi-Fi off and on. If your Wi-Fi setting is dimmed, follow these steps.
Confirm that your Wi-Fi router and cable or DSL modem are connected to power, turned on, and connected to the Internet. If not, refer to your network administrator or Internet service provider (ISP) for assistance.
Restart your iOS device.
Tap Settings > Wi-Fi and locate the Wi-Fi network to which you're connected.
Tap and Forget this Network.
Try to connect to your desired Wi-Fi network.
Note: You may need to enter your Wi-Fi password again if your network requires one.
Turn your Wi-Fi router off and on2. If your ISP also provides cable or phone service, check with them before attempting this step to avoid interruption of service.
Update your device to the latest version of software.
Update your Wi-Fi router to the latest firmware2. For AirPort Base Stations, install updates using the AirPort Utility.
And this section down toward the bottom if needed:
Unable to locate a Wi-Fi network
Verify that the network is available by tapping Settings > Wi-Fi and choosing from the available networks.Note: It may take a few seconds for the Wi-Fi network name to appear.
Move closer to your wireless router (access point) and attempt to locate the Wi-Fi network.
If you do not see the network you would like to join, you may be attempting to connect to a hidden network. Learn how to join a hidden network.
Supported Wi-Fi configurations vary by iOS device model. Find out which standards your device supports3.
Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including:
previously connected Wi-Fi networks and passwords
recently used Bluetooth accessories
VPN and APN settings
Thank you for using Apple Support Communities.
Take care,
Sterling -
I have been successfully downloading Aps from CC, but it is stuck at 90% on after effects. It has been stuck since last night. I am on a Mac.
Jonellel53796317 I would recommend reviewing the installation logs for the update which is failing to apply. You can find details on how to locate and interpret the installation log files at Troubleshoot install issues with log files | CC. You are welcome to post any specific errors you discover to this discussion.
-
How can we send workitem after Po approval decision has been taken by appro
Hi.
How can we send workitem after Po approved decision has been taken by approver1 to approver2 in the same flow?
Regards,
Chow.Some kind requests from a user who is of a different opinion:
Please create one thread for each different question, with a precise thread subject. It will make it easier to search for previously answers to the question someone has, and it will help keep each thread short.
Please do not introduce new questions on an entirely different topic in an existing thread.
Please always check if your answer has been answered already before you start a new thread.
Please do not ask the same question twice just because you did not receive an answer when you asked it first. Post a follow-up to your first thread if you want to make everyone aware that you are still looking for help to solve your problem.
Please mark questions as answered when you either have reiceived the answer, or solved the problem. It is also nice if you leave a little comment about how the problem was solved.
I guess that was all for today...
Maybe you are looking for
-
Getting WMV and MVI files to itunes.And ipod
I recently filmed a video of a family event. And wanted to transfer the video to Itunes. The original file extension was mvi. but i also changed the file to wmv. But, itunes would not allow me to import or click and drag into my library. Any Help?
-
Does Compressor 3.5 Conflict With FCE 4 And LiveType?
Last week my Compressor 3.5 app suddenly refused to open. I tried all the usual remedies including deleting it with FCS Remover but to no avail. Eventually it was cured by deleting all the FCS 3 apps and reinstalling. This morning Compressor once aga
-
Hi! There is an application I've created uses key event that needs your help. As you know, that setting 'Mnemonic' to a JButton object makes the button accessible by a key mentioned in the parameter as the following -> OkButton.setMnem
-
Whats mean by multiple page formats in smartform?
Hi! Can u pls tell me whats mean by multiple page formats in smartform? Thanks Imran.
-
Organizer shuts down everytime you open it
my photo shop 11 organizer shuts down every time it is opened can't do anything.