5 Replies Latest reply on Jun 23, 2006 9:59 AM by Dave_in_Maine

    Flex / J2EE Integration Project

    Dave_in_Maine
      Greetings;

      I am a developer at the University of Southern Maine and I am (excitingly) evaluting Flex 2.0 for use in developing RIA's here. Currently we develop using Eclipse 3.12 and JoNAS J2EE server. I am by no means fluent in J2EE technology, so please be patient and speak in normal speak!

      We start off most of our applications with one of our canned webapplications (in Subversion), change a few properties in the XML files and we are good to go..

      My problem lies in trying to integrate the files etc from Flex into our J2EE framework.

      Let me be more specific. Here is our GenericWebapp structure

      /GenericWebappROOT
      ----/src (location of our Java DAO's and other Java Code)
      ----/dist (destination of our compiled EAR's, WAR's, JAR's, RAR's)
      ----/ear
      --------/META-INF
      ------------application.xml
      ----/rar
      --------/META-INF
      ------------jonas-ra.xml
      ------------ra.xml
      ----/web (repository of our JSP/WEB pages)
      --------/WEB-INF
      ------------jonas-web.xml
      ------------web.xml
      ------------/lib
      ----------------files.jar
      --------index.jsp


      My problem is, is how to I (physically) integrate a Flex application into this framework? There are .project, .configuration, web.xml files to deal with and not to mention the bin directories that flex uses etc. I can't (in Eclipse) do NEW - FLEX APPLICATION etc and then copy/past the files into the new structure.

      Your insight is GREATLY appreciated,

      --Dave
      University of Southern Maine


      UPDATE: I am taking the flex.war file and trying to integrate that into my J2EE application

      UPDATE 2: Ookay.. I am offically stuck!! I am able to embed the flex.war files into my J2EE application, but I can't develop in Flex.. It wants me to create a new application. I guess I just don't understand!! How can one develop in Flex and then switch the same project over and develop som Java?

        • 1. Re: Flex / J2EE Integration Project
          mike.montagna
          Hi Dave,

          Not sure I understand the question. If you want to integrate FDS into your project structure, there's a few steps you'll need to take. Namely, move the flex jars and config files into WEB-INF and add the flex web.xml entries to your own web.xml. Compiled Java and mxml source would be deployed just like the rest of your Java and jsps. If this is what you're looking for, I can go into more details.

          The second part seems to be a Flex Buider question, running a dual flex/java project in Eclipse. Is that the issue you're having?

          Thanks,

          -Michael
          Flex Framework
          • 2. Flex / J2EE Integration Project
            Dave_in_Maine Level 1
            quote:

            Originally posted by: mike.montagna

            The second part seems to be a Flex Buider question, running a dual flex/java project in Eclipse. Is that the issue you're having?



            Michael;

            Yes I believe this to be the real problem. I can't go in and create NEW - FLEX PROJECT within a J2EE project. It wants to create .project file for both. (or vice versa).

            If I have a J2EE application already started, I can't do NEW - MXML application cause it wants me to create a new Flex Project.

            Help is appreciated,

            --Dave
            • 3. Re: Flex / J2EE Integration Project
              mike.montagna Level 1
              This might be of some help in setting up your projects:

              http://labs.adobe.com/wiki/index.php/Flex_Enterprise_Services then click "Debugging with Flex Data Services"

              I'll also forward your question on to the Flex Builder team.

              Thanks,

              -Michael
              • 4. Re: Flex / J2EE Integration Project
                Level 7
                Dave in Maine wrote:
                > Yes I believe this to be the real problem. I can't go in and create NEW -
                > FLEX PROJECT within a J2EE project. It wants to create .project file for both.
                > (or vice versa).

                Hi Dave,

                Try right-clicking on the J2EE project in the Navigator and choosing
                "Flex Project Nature > Add Flex Project Nature". (If you're using FDS
                and want to compile your MXML files on the server instead of locally,
                you can choose "Add Flex Project Nature (Compile on Server)".)

                By default, this will make the root of your project be the Flex source
                folder. If you want to create a specific folder to contain the Flex
                source (e.g. "flexsrc"):

                -- switch to the Flex Development Perspective (due to the way Eclipse
                works, the Flex project properties are only available in this perspective)
                -- right-click on the project and choose "Properties..."
                -- select "Flex Build Path" and enter the name of the source folder
                under "Main source folder:"

                You'll need to manually move the MXML app file we generated into the
                source folder you create.

                Hope this helps. Let us know if this doesn't work for you.

                Thanks.

                --
                nj
                Flex Builder team
                • 5. Re: Flex / J2EE Integration Project
                  Dave_in_Maine Level 1
                  Sorry for the delay in response.

                  I have tried the above but still can't deploy a WAR.

                  When I try to add a Flex Project Nature, it adds a FlexProjectName.mxml file in my root. Unfortunately all of my webapps run from my WEB folder. If I manually move the file, the project goes blank. (when I go to localhost:9000/MyFlexProject/

                  How can I change the FlexProjectName.mxml file to go to the WEB folder?

                  Advice much appreciated,

                  --Dave