Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Alexander Doroshko
Subsystem
Flex Support
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Slawek Garwol
    2 years ago (06 Mar 2009 15:42)
  • Updated by   root
    2 years ago (17 Jan 2010 21:12)
  • Jira: IDEADEV-38595
    (history, comments)
 
IDEA-48087 Flex facet compilation error
3
Issue is visible to: All Users
  The issue is visible to the selected user group only
I have maven project with some flex facets. When I try to compile it in Idea I get error message:

Information:c:\java\jdk1.6\jre/bin/java.exe -Dapplication.home=C:/flex/FlexBuilderPlugin/sdks/3.2.0 -Xmx384m -Dsun.io.useCanonCaches=false -classpath C:\java\Idea8/plugins/flex/lib/idea-fcsh-fix.jar;C:/flex/FlexBuilderPlugin/sdks/3.2.0/lib/fcsh.jar flex2.tools.SimpleShell
Information:Adobe Flex Compiler SHell (fcsh)
Information:Version 3.2.0 build 3958
Information:Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
Information:compc -load-config+=AirewsGuiLib_temp_flex_config.xml +configname=air
Information:Loading configuration file C:\flex\FlexBuilderPlugin\sdks\3.2.0\frameworks\air-config.xml
Information:Loading configuration file E:\NextGen\trunk\Idea\Maven\AirewsGuiLib_temp_flex_config.xml
Information:mxmlc -load-config+=AircrewsGuiLauncher_temp_flex_config.xml +configname=air
Information:Loading configuration file E:\NextGen\trunk\Idea\Maven\AircrewsGuiLauncher_temp_flex_config.xml
Information:mxmlc -load-config+=TestRunner_temp_flex_config.xml +configname=air
Information:Loading configuration file E:\NextGen\trunk\Idea\Maven\TestRunner_temp_flex_config.xml
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:unable to load SWC airframework-3.2.0.3958.rb.swc: could not find catalog.xml within the SWC.

Issue was resolved
Comments (14)
 
History
 
Linked Issues (?)
 
Alexander Doroshko
  Alexander Doroshko
06 Mar 2009 17:30
2 years ago
What is airframework-3.2.0.3958.rb.swc file? Who has created it, where's it located and is it really needed for compilation? I guess that it is directly added to module dependencies, right?

Any ideas why doesn't airframework-3.2.0.3958.rb.swc file contain catalog.xml? Every correct SWC file has ZIP-file format and contains catalog.xml file in the archive root.
Alexander Doroshko
  Alexander Doroshko
06 Mar 2009 18:31
2 years ago
Ok, let's keep maven aside and think why IDE builder fails to compile Flex facet.
When we use IDE Flex compilation then there's nothing maven specific (So maybe you shouldn't use IDE compilation at all? - then switch off "USE IDE builder" checkbox).

Well, if we want IDE builder to compile successfully there following thoughts:
1. Why is airframework-3.2.0.3958.rb.swc included to compilation? Check <facet_name>_temp_flex.config.xml file, I guess it contains entry like
<library-path append="true"><path-element>path/to/airframework-3.2.0.3958.rb.swc</path-element></library-path>
Most probable answer is that you've configured airframework-3.2.0.3958.rb.swc as Dependency in Module settings.

2.Next question is do we need airframework-3.2.0.3958.rb.swc for compilation? May be just removing it from Dependencies would resolve the problem?

General consideration about the issue is that the error "could not find catalog.xml within the SWC..." is not generated by IDEA. It's what Flex compiler(fcsh) says. IDEA generates parameters for fcsh (in <facet_name>_temp_flex.config.xml file) basing on IDEA Project configuration. So possible compilation failure reasons are:
  • IDEA bug: incorrect <facet_name>_temp_flex.config.xml file generation
  • incorrect IDEA project/module/facet configuration
  • fcsh issue
Slawek Garwol
  Slawek Garwol
06 Mar 2009 19:42
2 years ago
1. It is included because my maven project has it in dependencies. I don't want to modify Idea dependencies each time I re import Maven project.
2. It is maven project - all dependencies - including Flex SDK - should be taken from maven.

I don't know where problem is. All I know, that this project is successfully compiled by maven.

All configurations (project/module) were generated by idea while importing maven project. I only added Flex facet with +configname=air in Additional compiler parameters.

BTW. If i uncheck Use IDE builder only way to compile is to use mvn package?
Logan Allred
  Logan Allred
16 Mar 2009 15:27
2 years ago
The .rb.swc files are "placeholder" swcs generated by flex-mojos to handle localization. At runtime, the flex-mojos plugin replaces the .rb.swc with the appropriate <libraryname>-<locale>.rb.swc, so this particular one would be airframework-3.2.0.3958-en_US.rb.swc for US English.

We should probably file a bug with flex-mojos to make sure their placeholder swcs are at least valid swcs, and then figure out a way to handle setting the localization, or have a more obvious way of switching to a maven-only build instead of using fcsh.
brandon lonac
  brandon lonac
24 Apr 2009 05:02
2 years ago
Using build 9821 and importing my flex-mojos 3.1.0 project, I get the same error on a different swc. Besides the issue that the flex compiler is broken in this build, this bug prevents any maven import of a flex-mojos project working.



Information:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -Dapplication.home=/Applications/Adobe Flex Builder 3/sdks/3.3.0 -Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=en -classpath /Applications/Diana-9821.app/plugins/flex/lib/idea-fcsh-fix.jar:/Applications/Adobe Flex Builder 3/sdks/3.3.0/lib/fcsh.jar com.intellij.flex.FcshLauncher
Information:Adobe Flex Compiler SHell (fcsh)
Information:Version 3.3.0 build 4852
Information:Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
Information:compc -load-config+=pl-console-flex-shell-core_Flex_temp_flex_config.xml
Information:Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.3.0/frameworks/flex-config.xml
Information:Loading configuration file /Users/blonac/Source/depot/Service/ui/java/projects/Tsunami/main/pl-console-flex-shell-core_Flex_temp_flex_config.xml
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:unable to load SWC rpc-3.2.0.3958.rb.swc: could not find catalog.xml within the SWC.
brandon lonac
  brandon lonac
24 Apr 2009 21:31
2 years ago
I was able to work around this issue by manually deleting all the rpc-3.2.0.3958.rb.swc and framework-3.2.0.3958.rb.swc references. Then I created to global library references to the actual rpc-3.2.0.3958.en_US.rb.swc and framework-3.2.0.3958.en_US.rb.swc files.
Randy Wilson
  Randy Wilson
05 Jun 2009 04:15
2 years ago
I am having the same problem, and the workaround mentioned by brandon did not work for me. Has JetBrains been testing the use of Flex with Maven? The only tutorial I saw used Ant, and our organization is moving away from that. I am working on a project that has a Flex module. It compiles fine under Maven, and others are using it with FlexBuilder 3 and perhaps NetBeans. But I can't even run it from IntelliJ because it won't compile, due to the "Error:unable to load SWC rpc-3.2.0.3958.rb.swc: could not find catalog.xml within the SWC". As it is, I'm completely stuck. Maybe I'll write a swing app instead. :(
Alexander Doroshko
  Alexander Doroshko
05 Jun 2009 14:18
2 years ago
Randy, I suppose workaround should always work. Please look at 'Flex Compiler Settings' tab of your Flex modules/facets. If you have 'Use custom compiler configuration file' enabled then workaround should be applied to that file itself (remove/replace invalid maven placeholder SWCs in <library-path/> and <external-library-path/>).
If you don't use custom config file then you should make sure that neither Flex SDK nor libraries ('Dependencies' tab of the module) contain invalid maven swc placeholders.
SWC files have zip format and valid SWC must have catalog.xml file in its root.
Vladimir Krivosheev
  Vladimir Krivosheev
07 Jun 2009 12:43
2 years ago
Randy Wilson : Has JetBrains been testing the use of Flex with Maven?

see http://www.jetbrains.net/jira/browse/IDEADEV-32647#action_355257, flexmojos supports IDEA — https://issues.sonatype.org/browse/FLEXMOJOS-41.
Mark Vedder
  Mark Vedder
15 Jul 2009 02:20
2 years ago
I hope that this one can get solved. I ran into this issue with the file rpc-3.3.0.4852.rb.swc in IDEA build 10558.

My use case is one that I think would be pretty standard. We have a flex project that uses maven (and the flexmojos) for its primary build. We use a custom compiler configuration file. I ran into this issue when I tried to run a FlexUnit test via the IDEA unit test runner (which uses Make). I want to use IDEA to quickly run a selected test or two during the development process. Using IDEA's make has several advantages in this scenario. I would think this is a pretty standard usage pattern.
Irmo Manie
  Irmo Manie
17 Jul 2009 17:25
2 years ago
I had the same problem here. After some short investigation I found out I was just using the wrong maven dependency.

I was using:
<dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>air-framework</artifactId>
    <version>3.3.0.4852</version>
    <type>pom</type>
</dependency>


Then looked into my local maven repository and found out that that dependency doesn't have a .swc at all.

Switch to :
<dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>airframework</artifactId>
    <version>3.3.0.4852</version>
    <type>pom</type>
</dependency>


Spotted the difference? air-framework -> airframework ;)

Then to be sure you can remove all the libraries from the project settings, remove the generated compiler settings, re-import the maven libraries and do a project rebuild. All should work then. :)
Mark Vedder
  Mark Vedder
17 Jul 2009 19:10
2 years ago
@Irmo

Thanks for the input. The reason the air-framework dependency does not have a .swc file is because its type (i.e. its packaging) is 'pom'. It is simply a POM file that lists other dependencies. This is a way of aggregating a number of dependencies into a single "entry" so you only have to list one dependency in your project. If you look at the air-framework POM, you will see that one of those dependencies is the airframework artifact with a type of 'swc'. In theory, you should also have had to change the type to swc in your maven settings. It's interesting that this works OK for you since you would not be getting the other 7 or 8 dependencies listed in the air-framework POM.

Also, some of us are using the Flex framework and not Air, so we need to use the flex-framework dependency.
Alexander Doroshko
  Alexander Doroshko
17 Jul 2009 21:05
2 years ago
Fixed. Now IDEA does not add resource bundle placeholders like airframework-3.2.0.3958.rb.swc to module dependencies (i.e. to automatically created project libraries) when importing flexmojos projects. Now IDEA looks at <compiledLocales/> configuration setting (or uses default en_US if none specified) and adds correct SWCs to module dependencies (like airframework-3.2.0.3958-en_US.rb.swc)
Irmo Manie
  Irmo Manie
22 Jul 2009 14:10
2 years ago
@Mark

Now I see it too :) My bad, must have been a 'glitch in the matrix' that it worked. Now I had the same problems again and indeed saw in the underlying pom that the classifiers are missing for the rb.swc's and therefore results in empty maven dependencies.

For the time being I just copy the dependencies from the pom and fill in the classifier myself.