12 Replies Latest reply on Jun 6, 2013 8:45 AM by Flex harUI

    Flex Application Only Compiles in Flash Builder

    mjmatch2

      Hello,

          I am a newbie trying to become familiar with Flex.  I am starting by building and running some sample applications.  For some reason, the applications will execute inside of FlashBuilder, but I am getting a compile error when I compile them on my linux box. The I used the Flash Builder remote services finder to generate the code for the remote service.  The class that produces the error was generated by Flash Builder.  I have appended the class at the bottom of this post.  Any suggestions?  Thanks in advance.

      --Marco

       

      [mjmatch@mjmatch-linux flexsphi]$ ant
      Buildfile: build.xml

       

      compile-flex:
          [mxmlc] Loading configuration file /opt/tools/flex-sdk/4.1/frameworks/flex-config.xml
          [mxmlc] /opt/tools/blazeds/4.0.0/tomcat/webapps/flexsphi/src/client/services/_Super_Foo.as(20): col: 68 Error: The definition of base class RemoteObjectServiceWrapper was not found.

       

          [mxmlc] internal class _Super_Foo extends com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper
          [mxmlc]                                                                    ^

       


      BUILD FAILED
      /opt/tools/blazeds/4.0.0/tomcat/webapps/flexsphi/build.xml:16: mxmlc task failed

       

       

       

      Environment

      =========

      Flex SDK 4.1

      Flash Builder 4

       

      ant compile tasks

      ============

          <property name="FLEX_HOME" value="/opt/tools/flex-sdk/4.1"/>
          <property name="DEPLOY_DIR" value="/opt/tools/blazeds/4.0.0/tomcat/webapps/flexsphi"/>
          <property name="CONTEXT_ROOT" value="flexsphi"/>

       

          <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"  />

       

          <target name="compile-flex">
              <mxmlc file="src/client/Main.mxml"
                      services="${DEPLOY_DIR}/WEB-INF/flex/services-config.xml"
                      context-root="${CONTEXT_ROOT}"
                      output="${DEPLOY_DIR}/flexsphi.swf"/>
          </target>

       

       

      _Super_Foo

      =========

      /**
      * This is a generated class and is not intended for modification.  To customize behavior
      * of this service wrapper you may modify the generated sub-class of this class - Foo.as.
      */
      package services
      {
      import com.adobe.fiber.core.model_internal;
      import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
      import com.adobe.serializers.utility.TypeUtility;
      import mx.rpc.AbstractOperation;
      import mx.rpc.AsyncToken;
      import mx.rpc.remoting.Operation;
      import mx.rpc.remoting.RemoteObject;
      import valueObjects.Bar;

       

      import mx.collections.ItemResponder;
      import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

       

      [ExcludeClass]
      internal class _Super_Foo extends com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper
      {

       

          // Constructor
          public function _Super_Foo()
          {
              // initialize service control
              _serviceControl = new mx.rpc.remoting.RemoteObject();

       

              // initialize RemoteClass alias for all entities returned by functions of this service
              valueObjects.Bar._initRemoteClassAlias();

       

              var operations:Object = new Object();
              var operation:mx.rpc.remoting.Operation;

       

              operation = new mx.rpc.remoting.Operation(null, "getBars");
               operation.resultElementType = valueObjects.Bar;
              operations["getBars"] = operation;
              operation = new mx.rpc.remoting.Operation(null, "addBar");
              operations["addBar"] = operation;

       

              _serviceControl.operations = operations;
              _serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
              destination = "foo";

       

       

       

               model_internal::initialize();
          }

       

          /**
            * This method is a generated wrapper used to call the 'getBars' operation. It returns an mx.rpc.AsyncToken whose
            * result property will be populated with the result of the operation when the server response is received.
            * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
            * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
            *
            * @see mx.rpc.AsyncToken
            * @see mx.rpc.CallResponder
            *
            * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
            */
          public function getBars() : mx.rpc.AsyncToken
          {
              var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getBars");
              var _internal_token:mx.rpc.AsyncToken = _internal_operation.send() ;

       

              return _internal_token;
          }

       

          /**
            * This method is a generated wrapper used to call the 'addBar' operation. It returns an mx.rpc.AsyncToken whose
            * result property will be populated with the result of the operation when the server response is received.
            * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
            * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
            *
            * @see mx.rpc.AsyncToken
            * @see mx.rpc.CallResponder
            *
            * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
            */
          public function addBar(arg0:String) : mx.rpc.AsyncToken
          {
              var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("addBar");
              var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(arg0) ;

       

              return _internal_token;
          }

       

      }

       

      }