0 Replies Latest reply on May 30, 2011 1:10 AM by JuanAcciona

    Problem with FlexMojos and Flex3 compatibility mode

    JuanAcciona

      Dear Community

      I have been working with Flex Mojos for a short time.
      First of all i would like to thank you for all the support you offer in the net about Flexmojos, and i have a problem that i think that could be a commom problem in FlexMojos 4.0, so I comment you:
      I need to convert my Flex 3.5 project in a 4.5 project (compile with SDK 4.5) with Flex 3 Compatibility Mode to use the Marshalling plan wicht lets you run Flex applications from other SDK versions (I have my Flex 3.5 application and I want to run with swfLoader applications from SDK 4.5 and SDK 3.x).I have compiled my project with Flash Builder 4.5 in Flex3 compatibility mode and everything is OK.
      The problem appears when i try to use FlexMojos to do the same in Maven. I know that the unic way to do this with Flex Mojos is using Flex 3 compatibility layer for flexmojos.is´nt it true?is there another way to use the Flex 3 compatibility mode instead of Flex3-compatibility-layer???
      Here is my pom:
      <?xml version="1.0" encoding="UTF-8"?>
        <!--

          Copyright 2008 Marvin Herman Froeder
          Licensed under the Apache License, Version 2.0 (the "License");
          you may not use this file except in compliance with the License.
          You may obtain a copy of the License at


          Unless required by applicable law or agreed to in writing, software
          distributed under the License is distributed on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
          See the License for the specific language governing permissions and
          limitations under the License.

      -->
        <modelVersion>4.0.0</modelVersion>


        <groupId>com.prueba.testcompatibility</groupId>
        <artifactId>TestCompatibility5</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>swf</packaging>

        <name>nscprototipo Application</name>
       
        <properties>
          <flex-version>4.5.0.20967</flex-version>
        </properties>

        <build>
       
          <sourceDirectory>src/main/flex</sourceDirectory>

          <plugins>
            <plugin>
            <extensions>true</extensions>
              <groupId>org.sonatype.flexmojos</groupId>
              <artifactId>flexmojos-maven-plugin</artifactId>
              <version>4.0-beta-7</version>
             
              <dependencies>
             
                <dependency>
                  <groupId>org.sonatype.flexmojos</groupId>
                  <artifactId>flexmojos-flex3-compatibility-layer</artifactId>
                  <version>4.0-beta-7</version>
                </dependency>
               
                <dependency>
                  <groupId>com.adobe.flex</groupId>
                  <artifactId>compiler</artifactId>
                  <version>3.5.0.12683</version>
                  <type>pom</type>
                </dependency>
               
              </dependencies>
             
              <configuration>
              <!--
             
              <compatibilityVersion>3.5.12683</compatibilityVersion>
             
              -->
              <ignoreVersionIssues>true</ignoreVersionIssues>
             
              <includes>
              <include>mx.managers.systemClasses.MarshallingSupport</include>
             
              </includes>
             
                <debug>true</debug>
                <!--
        <targetPlayer>10.3</targetPlayer>
        -->
                <locales>
      <locale>es_ES</locale>
      <locale>en_US</locale>
               </locales>
             
              </configuration>
            </plugin>
           
            <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <version>1.5</version>
      <executions>
      <execution>
      <id>add-source</id>
      <phase>generate-sources</phase>
      <goals>
      <goal>add-source</goal>
      </goals>
      <configuration>
      <sources>
      <source>src/main/resources</source>
      </sources>
      </configuration>
      </execution>
      </executions>
        </plugin>
           
          </plugins>
        </build>


        <dependencies>
       
      <dependency>
        <groupId>com.adobe.flex</groupId>
        <artifactId>compiler</artifactId>
        <version>${flex-version}</version>
        <type>pom</type>
      </dependency>

          <dependency>
            <groupId>com.adobe.flex.framework</groupId>
            <artifactId>flex-framework</artifactId>
            <version>${flex-version}</version>
            <type>pom</type>
          </dependency>

         

        </dependencies>

      </project>


      When i execute mvn clean install everything is OK, but when i execute the SWF i do not obtain the result i wish. In the screen in run-time i get these errors:
      Error #1007: Se intent  ear una instancia en un tipo no constructor.
      at mx.preloaders::Preloader/initialize()[E:\dev\hero_private\frameworks\projects\framework\s rc\mx\preloaders\Preloader.as:261]
      at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2103]
      at mx.managers::SystemManager/initHandler()[E:\dev\hero_private\frameworks\projects\framewor k\src\mx\managers\SystemManager.as:2588]
      I would like you help me with this problem, i want to convert my Flex 3 application in a Flex SDK 4.5 with Flex 3 compatibility Mode in wich i can use the marshalling plan wich lets me execute all kind of Flex Applications from a lot of SDKS.
      Thank you for your time,
      Yours faithfully