Posts Tagged bug
Flash Builder Network Monitor Project Property Causes HTTP Security Error
Posted by brianr in flash builder on October 6th, 2010
This sucker literally sucked up waaaay too many man hrs between my partner and myself trying to debug this issues, so I hope it saves someone else — for the short read, if you’ve used the Network Monitor in Flash Builder in a project make sure you open up .actionScriptProperties and set the property includeNetmonSwc = false.
includeNetmonSwc=”false”
For more of an explanation read the following — here’s the scenario:
We created an app that loads services.xml from within the same Java container as our SWF, so there’s no need for a crossdomain.xml file. The xml file was relative to the SWF and the HTML container for the SWF as such:
* main.html
* main.swf
* assets/service-locator/services.xml
In our local dev environments we have a Flex app that publishes itself to a Java app on Tomcat running in Eclipse with BlazeDS + Spring + Hibernate. Running locally, everything worked fine. When we deployed the WAR to a client’s remote Tomcat instance logged in via their VPN, my partner and I were able to hit the app and the XML file loaded fine. When the client tried, it failed and they received the following HTTPService Fault:
- faultCode = Channel.Security.Error
- faultDetail = Destination: DefaultHTTP
- faultString = Security error accessing url
This honestly baffled us for some time…why could we hit get the SWF to load the XML file when VPN’d in while the client received an error on their own network? After trying every security thing under the sun with the Flash Player, we simply created a new Flex project, put in a simple XML load via an HTTPService, and deployed it to the same WAR (as above with BlazeDS + Spring + Hibernate) and it worked for both us and them. Then we put the exact same Flex code from our original app into the test Flex app and again it worked for both us and out client…huh?
While it did work and we could just move on and fist pump the day away with out newfound success, we were obviously worried that something greater was at play and might come back to bite us in the ass. At this point we knew it was client code and not server code, so we decided to check the build properties and compiler options, etc, but it was all the same.
Finally we decided to do a compare on the project property files from the original project and the new one starting with .actionScriptProperties — and there it was, a simple flag difference of the property:
includeNetmonSwc=”true”
…and WHAM, it smacked me in the face.
Waaaaay back when we started this project I decided to play with the new Network Monitor (NM) integrated into Flash Builder. I used it maybe for 30 mins and said, ok, great…next. Well, this little flag apparently creates some settings (maybe opens ports or something) on dev machines that allows the NM to work like an HTTP Proxy/Sniffer similar to Charles or ServiceCapture…when this SWF is deployed to a server where these settings haven’t been set…well…you’re efffed. No dice. And you get the security error mentioned above.
Bottom line, make sure you either set the value to false:
includeNetmonSwc=”false”
or remove this sucker entirely. I really hope that helps someone as it cost us a ton of time. Thank you Adobe.
Workaround to Flex SDK 3.4 Bug 22333 :: HTTPService Responders Are Called Twice…Here’s a Fix!
Posted by brianr in actionscript, flex on September 29th, 2009
This one kicked my team’s ass for a couple of hours so I’m hoping it’ll help somone else…so we updated our Flex SDKs to 3.4 and all of a sudden all of our Delegates’ result handlers were getting called twice. We thought it was due to our service orchestration object (we have a base object that allows us to make sequential Cairngorm service calls) and somehow we were calling the services 2x, but nope…wasn’t it. Seemed our AbstractDelegate that sets up the responders for all of our service calls like so had the issue:
public function executeHTTPService(requestDTO:AbstractRequestDTO=null):void
{
logger.debug("executeHTTPService");
var token:AsyncToken;
var responder:mx.rpc.Responder;
// create a responder for the service
responder = new mx.rpc.Responder(result, fault); // WTF mate?
// execute the service
token = this.service.send(requestDTO);
token.addResponder(responder); // why yall busted up now???
}
Apparently, SDK 3.4 reintroduces an old defect that causes this implementation of setting up the responder with the async token to call the result handler twice…bummer, eh? So what to do…well, a simple workaround until they fix this is to do the following:
this.service.addEventListener(ResultEvent.RESULT, result); this.service.addEventListener(FaultEvent.FAULT, fault);
Just create your handlers with good-ole fashioned event handlers…DONE.
Get more info on the defect here.
Mac + Adobe AIR 1.5.1 + Flex Builder 3.0.2 + Flex SDK 3.3 = No Run or Debug Without This Fix; UPDATE
Posted by brianr in air, flex builder on July 30th, 2009
If you’re using a Mac and trying to build AIR applications with the following:
- Mac
- AIR 1.5.1
- Flex Builder 3.0.2.214193
- Flex SDK 3.3
You won’t be able to Run or Debug from Flex Builder and you won’t really get an error explainging why…here’s a list of instructions from the logged bug on Adobe’s Flex Bug and Issue Management System: http://bugs.adobe.com/jira/browse/SDK-19707
NOTE: If you just go to run the AIR app with this setup it’ll silently fail…if you try to debug it you’ll get the following: “DEBUG: error dialog with text: “Process terminated without establishing connection to debugger. If the program is already running, close it before attempting to debug.
To fix it, follow these steps:
- Download the attached change.sh.
- Copy the change.sh into the root directory of the SDK, at the same level of the ant, asdoc, bin, frameworks, lib, etc. folders. This probably looks something like: “/Applications/Adobe Flex Builder 3.0.2 Plugin-in/Adobe Flex Builder 3 Plug-in/sdks/3.3″ or wherever you keep your Flex SDKs…
- Change the script to executable (chmod 755 change.sh) — open up terminal and cd to the directory where you just put the change.sh file and run the command in bold: chmod 755 change.sh
- Run the script (./change.sh) run the bold command in terminal to execute the script: ./change.sh
- Open up FB and create a HelloWorld AIR app and make sure the SDK for Flex 3.3 is selected for this project.
- Run the AIR app and make sure it opens.
Big thanks to Joann Chuang Anderson for this fix, as it was driving me nuts!