Ajax call JS works but LiftRules.ajaxEnd doesn't

22 views
Skip to first unread message

Joe Barnes

unread,
Aug 30, 2015, 1:09:32 PM8/30/15
to Lift
I'm working on an example Lift project deployed in AWS, and I have something slightly wrong with how it's deployed.  Locally, it runs great.  I have an ajax call that briefly shows the default ajax-loader and it disappears when done.  But once it's deployed to AWS, the my ajaxCall JS gets executed on the client after the call as expected, but the spinner remains for several seconds until a popup warning displays "The server cannot be contacted at this time".  

I initially suspected my security groups were too restrictive, blocking traffic from the Lift instance from the load balancer.  Opening up traffic in that direction didn't resolve the problem, tho.

Can anyone with a better understanding of Lift's ajax provide some hints on why my ajax JS works but not the JS provided to LiftRules.ajaxEnd?

Joe



Joe Barnes

unread,
Aug 31, 2015, 12:20:59 PM8/31/15
to Lift
Ok, I figured it out... Firstly what I stated isn't entirely correct.  The LiftRules.ajaxEnd function DOES get called, but not until after the popup warning.  So it seems everything is in place, but something is causing us to believe there is a failure.

...and it was my JS fu that was the problem.  In development mode, Lift quickly prints out to the console that my JS didn't work.  (I was attempting to set an input text box to blank, and didn't pay close enough attention to realize that was failing).  Once in production mode, Lift figures that it is a communication error with the server.  Running in prod mode locally produces the same behavior.

Lesson learned: Don't be too hasty whipping up example Lift projects.  

Joe
Reply all
Reply to author
Forward
0 new messages