Flex debugging when deploying to IDEA-managed JEE server?

Hi, I have a project with two facets, one for Flex and one for the Java back end using a JEE web application. I cannot find any way to launch the Flex app in debug mode, because the Flex bits are a dependency within the Java project, and are deployed when I deploy the Java project (to JBoss). If I try to debug the Flex app, I get an "Unexpected debugging error" or something similar. I'm fairly sure this is because the output of the Flex build is not the actual JBoss deployment folder in the /tmp directory, since I have no idea what that temp folder actually is (it is dynamically created by JBoss when the JEE app is deployed, using what looks like a UUID). I think I must be missing something, since this must be a pretty common setup. Can anyone shed any light? Thanks.

11 comments
Comment actions Permalink

Try specifying web server aplication url for debugging

Brian Kotek wrote:

Hi, I have a project with two facets, one for Flex and one for the Java back end using a JEE web application. I cannot find any way to launch the Flex app in debug mode, because the Flex bits are a dependency within the Java project, and are deployed when I deploy the Java project (to JBoss). If I t
ry to debug the Flex app, I get an "Unexpected debugging error" or something similar. I'm fairly sure this is because the output of the Flex build is not the actual JBoss deployment folder in the /tmp directory, since I have no idea what that temp folder actually is (it is dynamically created by JBo
ss when the JEE app is deployed, using what looks like a UUID). I think I must be missing something, since this must be a pretty common setup. Can anyone shed any light? Thanks.

---
Original message URL: http://www.jetbrains.net/devnet/message/5240359#5240359



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Hi Maxim. Thanks, but I already had the browser URL in my launch configuration pointing at the local JBoss URL (i.e. localhost:8080/myroot/index.html). I still get the unexpected debugging error has occured when I try to launch the Flex app in debug mode. Again, I could be wrong, but it seems like a likely culprit is that my Flex app is compiling to a folder within the Flex module (i.e. project/out/production). The Java module builds an EAR, then pushes it to JBoss and launches the server, so I'm wondering how the debugging-enabled version of the .swf can ever get to the server. Next I'll try starting JBoss, then run a debug config on the Flex app, and manually copy the .swf to JBoss to see if that helps. Any other ideas appreciated, but I also wanted to make sure that I was simply using a bad project setup by having separate Flex and Java modules, instead of possibly having a Java module with a Flex facet inside it? Thanks.

0
Comment actions Permalink

I don't think that mixing Java and Flex sources in one module is a good idea.
Below is an example that shows how to have compiled swf packed in war in case of Web facet. You should add dependency of Java module on Flex module and at Web facet tab 'Web Settings'  add dependency on Flex module at 'Modules and Libraries to Package'. I suppose your case is similar.
http://blogs.jetbrains.com/idea/2009/04/new-blazeds-support-demo/

0
Comment actions Permalink

Thanks Alex. What is shown in that video is pretty close to what I am doing. I have the Flex module as a dependency on the Java module. I cannot add the Java module as a dependency on the Flex module, because the IDE won't do it, telling me the two must have the same SDK set up, and since the Java module is using a Java SDK and the Flex module is using the Flex SDK, they can't be the same. Am I missing something here?

Otherwise, what they show in the video is almost exactly what I'm doing, except that I can't debug the Flex app. It *seems* like the problem is that once the JEE app is deployed, if I run the Flex app in debug mode, the updated version of the .swf is not actually deployed to the Java server. It writes it to the normal output folder (i.e. out/production/{modulename}) but I don't see how that file will ever got moved and deployed to the JBoss /servername/tmp/{uuid} directory where the JEE app is actually running.

Any advice appreciated. I'm using the EAP of IDEA 9 on Windows. I've tried using different browsers (IE, Firefox 3, Firefox 2) but still get the "Unexpected debugged player communication problem" with no other information or error data that I can find. I'm new to IDEA, so I'm happy to accept that I might be doing something incorrectly, but I can't figure out what that might be. Thanks.

0
Comment actions Permalink

You suspect that rebuilt Flex application is not redeployed on the server. But how about initial deployment?
Stuff that is deployed to the server is located in out/exploded folder. Contents of out/production/flex_module/ should be copied there if your configuration is correct (for example like that demo shows). Do you have compiled swf in exploded dir?

Are you able to launch Flex application from your server in a usual run mode (non-debug) or not from IDEA but just from browser?

What is there in the file http://localhost:8080/myroot/index.html that you launch? Is it an html wrapper for swf file? You may try to launch swf directly fia url like http://localhost:8080/myroot/HelloWorld.swf

Can you please describe in details what happens when you press Debug button? Where do you see "Unexpected debugged player communication problem" message? Does the browser get open? What is therу in the browser? What is in Debug console in IDEA toolwindow?

0
Comment actions Permalink

Sure Alex:

Yes, on initial deployment, the Flex app (the swf, wrapper html file, etc.) are deployed to JBoss, because I have the Flex project as a dependency in the Java project, and its web facet. I also see these files in the out/exploded/war folder along with the WEB-INF and my Groovy classes. So that part seems to work correctly.

However, if I *edit* the Flex project and attempt to run it, the Flex project compiles, but upon running the JBoss URL, the changes are not reflected. I have to do a make on the *Java* project to make it recompile and redeploy everything, including the updated swf. So that *seems* to be the same issue: changes to the Flex project are not pushed to the JBoss server unless I manaully force a redeployment.

Yes, I am able to launch it using the normal run configuration (but see above about changes not being reflected immediately). It is only the debugging that errors out (again, my instinct says it is due to the debug version of the swf not getting to JBoss, so the debugger has nothing to connect to, but this is just my gut feeling).

I tried launching using a direct URL to the swf file, but the error persists.

I just hit the debug button, the "make" spinner cycles around in the bottom panel, and then the first thing I see is a popup message from IDEA that says "Unexpected debugged player communication problem. There is a known problem of gdb disconnecting right after start with early builds of Firefox 3. If this is the case, consider updating the browser or using Firefox 2." If I hit OK, the debug panel in IDEA opens up, under "variables" it says "disconnected", and under console it says "Unexpected debugged player communication problem". The browser does not open. I am using the most recent version of Firefox 3, but I also tried it with Firefox 2 and with IE, same result.

0
Comment actions Permalink

Brian, thank you for the details.
As far as I understood you have 2 separate problems:
1. SWF not redeployed after compiling Flex module
2. Flex debugging does not work (as I understood it doesnt' work neither at first time nor after recompilation/redeployment).

I think that the first one is not an issue and happens by design.
- Making Flex module means putting compiled swf file to out/production/flex_module/
- Making Java module means putting compiled classes to out/production/java_module/
- Making Web facet of Java module means copying stuff from out/production/flex_module/ and out/production/java_module/ to out/exploded/ and deploying it to the server.
So when you only compile Flex module it doesn't know that you also have Web facet which depends on Flex module and needs to be redeployed. But when you compile Java module it does know all other modules it depends on and does make Web facet that leads to redeployment. I guess that in case of dependant Java module (instead of Flex) behavior would be the same.

Now about not working Flex debugging. Is there the same issue (popup message and message in console) if you try to debug you swf as local file (not URL) and via local HTML wrapper?
I suppose that the problem may be in the way Flex debugger selects browser to launch for debugging. What is your Flex SDK version and Windows version? Suppose it is Flex SDK 3.x. Please try from command line:
cmd /c ftype http
Flex debugger uses returned value to launch the browser (unfortunately it ignores your Windows default browser settings). So to change the browser you should change the value returned by the command above.
Just FYI: fdb uses following command to select Flash player if you launch swf as a file:
cmd /c ftype "ShockwaveFlash.ShockwaveFlash"

I hope that changing the browser and/or version of Debugging Flash Player plugin of the browser would help.

0
Comment actions Permalink

Hi Alexander,

I can see why the normal deployment of a modified swf isn't pushed to JBoss, but maybe it should be? Since the Flex project is a dependency on the web facet of the Java project, I would think that having it detect updates and deploy them to the running instance of JBoss would be a good feature to have. If you agree, I can open a ticket for that.

On the debugging side, it doesn't matter if I open the file as a local file or as a URL, and the same thing happens in the EAP of IDEA 9 (latest update) as well as on IDEA 8 (latest update). I am using the latest version of the Flex 3.3 SDK.

At the command line, using the commands you mention, I get:

C:\Users\Administrator>cmd /c ftype http
http="C:\Program Files (x86)\Internet Explorer\iexplore.exe" -nohome

C:\Users\Administrator>cmd /c ftype "ShockwaveFlash.ShockwaveFlash"
ShockwaveFlash.ShockwaveFlash="C:\Program Files (x86)\Adobe\Adobe Flash CS4\Players\FlashPlayer.exe" %1

I see that in my \Players folder there is a \Debug subfolder, with it's own FlashPlayer.exe in it. I modified the registry for ShockwaveFlash.ShockwaveFlash so that now when I run the command I get:

C:\Users\Administrator>cmd /c ftype "ShockwaveFlash.ShockwaveFlash"
ShockwaveFlash.ShockwaveFlash="C:\Program Files (x86)\Adobe\Adobe Flash CS4\Players\Debug\FlashPlayer.exe" %1

But that doesn't seem to change anything. On the IE side, I noticed that when I run it in IE without using debug that IE gives some silly security error about active content. I went into the settings and turned on the box to allow active content from My Computer, so that the security message no longer appears, but again, the error persists.

I will try to change the registry so that http maps to Firefox instead of IE, but since there are many more registry entries for IE than for Flash, finding the right place to change it may be harder. I'll post back after I try that, and if you or anyone else has any other ideas please let me know. Thanks. I also wonder if it would make sense to make these commands part of IDEA rather than relying on the OS, so that we can control what is being run?

0
Comment actions Permalink

Just a quick update that changing the OS association for http also had no effect. So now running the commands you mentioned I see this:

C:\Users\Administrator>cmd /c ftype "ShockwaveFlash.ShockwaveFlash"
ShockwaveFlash.ShockwaveFlash="C:\Program Files (x86)\Adobe\Adobe Flash CS4\Players\Debug\FlashPlayer.exe" %1

C:\Users\Administrator>cmd /c ftype http
http="C:\Program Files (x86)\Mozilla Firefox\firefox.exe"

But still getting the debug error. Also just for a sanity check, I ran Flex Builder 3 and was able to debug fine, so it seems to be specific to IDEA as far as I can tell. Let me know what you think, and again, I'm happy to talk directly with an engineer via email, phone, or something like Adobe Connect (I have an account) to help resolve this. Thanks.

0
Comment actions Permalink

All right folks, thanks for all of your help. I have been able to track down the problem: The Flex SDK will now allow you to debug an application if you are using a 64-bit JVM. I've reverted to a 32-bit JVM and it works correctly now. There are actually already tickets in the Flex issue system about this, and they are actually quite old, but they don't seem to have dealt with the issue yet. To the IDEA team: thanks again for your help, and you may want to update the error message the IDE shows to state something about not using a 64-bit JVM instead of the current message about Firefox 3 (which actually will work fine).

Regards,

Brian

0
Comment actions Permalink

The Titanium case will complement any skin tone. Titanium is a classic color case that will never go out of style.. The elegant Black* dial, will make your http://www.tastewatch.com/ look sophisticated and timeless. The bracelet on the http://www.tastewatch.com/ is Rubber - Black so it will match everything you wear. The bezel is also made of Titanium, a very stylish material. The Fixed bezel adds to the sophistication of this http://www.tastewatch.com/hamilton-s.html. The Platinum case will complement any skin tone. Platinum is a classic color case that will never go out of style. The elegant Black* dial, will make your http://www.tastewatch.com/Bell-Ross-s.html look sophisticated and timeless. The http://www.tastewatch.com/Replica-Movado-watch-s.html clasp, will make sure you won't lose your http://www.tastewatch.com/corum-admirals-cup-s.html, but is still easy to remove when you want to take it off. This classic http://www.tastewatch.com/michele-urban-mini-s.html has 30m / 100ft (suitable for splashing, light rain; unsuitable for swimming or diving) resistance, so you can feel comfortable using your http://www.tastewatch.com/gucci-watches-s.html in some wet locations. This http://www.tastewatch.com/category-134-b0-Bertolucci.html comes standard with http://www.tastewatch.com/Hermes-s.html (28,800vph, 40 jewels) engine, so you can count on your http://www.tastewatch.com/glashutte-original-s.html working when you need it the most. The 18k Rose Gold case will complement any skin tone. 18k Rose Gold is a classic color case that will never go out of style. The elegant Silver* dial, will make your http://www.tastewatch.com/patek-philippe-sky-moon-s.html look sophisticated and timeless. The http://www.tastewatch.com/category-131-b0-Armain.html clasp, will make sure you won't lose your http://www.tastewatch.com/category-145-b0-Corum.html, but is still easy to remove when you want to take it off. The Stainless Steel case will complement any skin tone. Stainless Steel is a classic color case that will never go out of style. The elegant Silver* dial, will make your http://www.tastewatch.com/cartier-watches-s.html look sophisticated and timeless. The bracelet on the http://www.tastewatch.com/Ferraris.html is Stainless Steel so it will match everything you wear. The bezel is also made of Stainless Steel, a very stylish material.Fashion-Replica.com is a professional company specializing in exporting worldwide all brand Replica watches like http://www.tastewatch.com/glashutte-senator-s.html, http://www.tastewatch.com/gucci-watches-s.html http://www.tastewatch.com/reitling-aerospace-s.html, http://www.tastewatch.com/christian-dior-s.html etc. All of the http://www.tastewatch.com/bvlgari-watches-s.html are crafted to meet the exact specifications of the original designs. This http://www.tastewatch.com/category-185-b0-Philip-Stein.html comes standard with http://www.tastewatch.com/oris-frank-s.html (28,800 vph, 28 jewels, Pellaton winding system) engine, so you can count on your http://www.tastewatch.com/patek-philippe-s.html working when you need it the most. This http://www.tastewatch.com/oris-divers-s.html has a 44-hour power reserve power reserve, so you will always know the date and time. The http://www.tastewatch.com/panerai-s.html with ceramic ring case back blends in perfectly with the style of this elegant http://www.tastewatch.com/Gerald-Genta-s.html. The Screw-down, Screw-down crown makes this high end watch look stylish and classic. This http://www.tastewatch.com/category-80-b0-Rolex.html has a 44-hour power reserve power reserve, so you will always know the date and time. The Stainless Steel case back blends in perfectly with the style of this elegant http://www.tastewatch.com/replica-blancpain-s.html. The Titanium case will complement any skin tone. Titanium is a classic color case that will never go out of style. The elegant Black* dial, will make your http://www.tastewatch.com/category-145-b0-Corum.html look sophisticated and timeless. If you are looking for http://www.tastewatch.com/Replica-Movado-watch-s.html that has more then just a time function, this http://www.tastewatch.com/replica-jaeger-lecoultre-s.html also has a Automatic Date at 3 o'clock. Rapid calendar advance via crown. calendar function.Fashion-Replica.com is a professional company specializing in exporting worldwide all brand http://www.tastewatch.com/panerai-s.html like rolex, breitling, cartier, Louis Vuitton replica watch etc. All of the watches are crafted to meet the exact specifications of the original designs.
3

---
Original message URL: http://devnet.jetbrains.net/message/5278891#5278891

0

Please sign in to leave a comment.