14 Replies Latest reply on Jan 8, 2013 11:00 PM by porchezhiyan

    BlazeDS and Flex Intergration Problems

    djh88ukwb Level 1

      Hello All.

       

      I have  downloaded BlazeDS4 and installed it onto a windows server using  tomcat.  I have then been able to log into this server and use the  examples provided using this address - http://localhost:8080/   I should note, that this link also works on remote computers by giving  the correct IP address instead of localhost.

       

      So i know  that Blaze is working fine.

       

      But now i want to configure this with Flash  Builder 4, so that i can try and create my own apps.

       

      I go "File  > New > Flex Project "

       

      Then i select J2EE from Server Technology, and  then select "BlazeDS"

       

      Now this is where i get stuck, I don't know what  settings to put for

       

      "Root Folder"  "Root URL" "Context Root"

       

      If for  example my server IP is - 10.1.2.12:8400

       

      Could somebody talk thru me what  settings i need to use ? I keep getting a message

       

      Invalid root. The WEB-INF/flex folder  must contain either flex-config.xml or services-config.xml.

       

      If anyone  could help I would be thankful ! !

        • 1. Re: BlazeDS and Flex Intergration Problems
          VRPDeveloper Level 3

          You need to set configurations in this way....

           

          1. Set the Root folder to the root folder of your web application with      BlazeDS configured. Its /tomcatworkspace/flexstrutssample in this sample
          2. Set the Root URL to root URL of your BlazeDS enabled web application.      Its http://localhost:8080/flexstrutssample in this sample.
          3. Set the Context root to context root of your BlazeDS enabled web      application. Its /flexstrutssample in this sample.
          4. Leave the output folder to      default value
          5. Click on validate configuration button to check if the values are properly configured. You should see a message at the top saying web root folder and root URL are valid.
          6. Click finish to continue

           

          Hope it will solve the problem

          • 2. Re: BlazeDS and Flex Intergration Problems
            saisri2k2 Level 4

            on the server where you are pointing you flex. do you have the WEB-INF folder as well as the flex folder inside the WEB-INF? if not then first put them b4 u create a flex project using the file>new flex project. ( the java project hs to be at the place where you are pointing.

            • 3. Re: BlazeDS and Flex Intergration Problems
              djh88ukwb Level 1

              Thanks both for your answers, but im still not getting anywhere . . .

               

              Here is my set up

               

              On my remote server, i have tomcat installed, the directory is

               

              C:\Program Files\Apache Software Foundation\Tomcat 6.0

               

              I then have my webapps which contains

               

              blazeds , ds-console , samples

               

              In the blazeds folder i have this structure

               

              WEB-INF, META-INF

               

              Inside WEB-INF i have these folders

               

              classes, flex, lib, src, web.xml

               

              Inside the flex folder i have all the xml files that are needed

               

              So the full direcroty path to the blazeds flex folder is

               

              C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\blazeds\WEB-INF\flex

               

              Now for example if the ip for my remote server was 10.1.1.13

               

              What settings do i use ?  Becuase i keep getting the same error!

               

              Invalid root. The WEB-INF/flex  folder  must contain either flex-config.xml or services-config.xml.

               

               

              I assume i can create and complie flex applications on my machine while connecting to the remote blazeds server cant I ?

               

              It dosent have to be on the same machine does it ?  If so this seems silly . .

               

              Any help would be great

              • 4. Re: BlazeDS and Flex Intergration Problems
                David_F57 Level 5

                hi,

                 

                 

                Did you use the adobe turnkey install with blazeds or did you have your own install ?

                 

                 

                David

                • 5. Re: BlazeDS and Flex Intergration Problems
                  djh88ukwb Level 1

                  I did my own install.

                   

                  Apache Tomcat.  I then installed the sample on it

                   

                  and have run them and they work fine

                   

                  I would provide a link so you can see them work, but its all an internal network

                  • 6. Re: BlazeDS and Flex Intergration Problems
                    David_F57 Level 5

                    hi,

                     

                    If you have 'standard' windows tomcat server running blazeds then your flex config dialog should look something like this

                     

                    blaze.jpg

                     

                    David.

                    • 7. Re: BlazeDS and Flex Intergration Problems
                      djh88ukwb Level 1

                      Hello,  Yea, but the only snag is my tomcat instalation is on a remote server, not the local machine that i am creating the app on using flex,

                        can i point to a remote server when creating a project?


                      • 8. Re: BlazeDS and Flex Intergration Problems
                        David_F57 Level 5

                        hi,

                         

                        You need to develop locally then move the app to your remote server.

                         

                        David.

                        • 9. Re: BlazeDS and Flex Intergration Problems
                          djh88ukwb Level 1

                          Right ok,

                           

                          But this is where I don't quite get it, if I develop locally, wont my Root Folder value need to be changed when i upload ?

                           

                          If I create it with a directory on my local machine, and then upload it, the paths wont match ?  Will it still work ?

                           

                          Or am i misunderstanding the Root Folder meaning  ?  Is that purely there for local machine development, and then the Root URL is used when it gets uploaded?

                           

                           

                          I cant seem to find much information about these values, apart form a lot of people getting stuck on them (Google searches)  if you could elaborate a bit I would be thankful

                          • 10. Re: BlazeDS and Flex Intergration Problems
                            David_F57 Level 5

                            hi,

                             

                            When you build your app it is normally hardcoded to your services, to get around this you set the channel dynamically in the application, for instance when I did that video thing for you I was lazy so instead of having the config in an xml file that was read from the server the app runs from I just but 2 values into the app and compiled one for local and one that was remote.

                             

                            protected function application1_creationCompleteHandler(event:FlexEvent):void

                            {

                            channelSet = new ChannelSet();

                            var channel:AMFChannel = new AMFChannel("my-polling-amf","http://localhost:8080/blazeds/messagebroker/amfpolling");

                            //var channel:AMFChannel = new AMFChannel("my-polling-amf","http://ezflex.net:8080/blazeds/messagebroker/amfpolling");

                            channelSet.addChannel(channel);

                            myProducer.channelSet=channelSet;

                            myConsumer.channelSet=channelSet;

                            cueXML.send();

                            myConsumer.subscribe();

                            }

                            so basically you could read an xml file that had the url in it and use it as the url parameter in the channel.
                            David.

                            • 11. Re: BlazeDS and Flex Intergration Problems
                              djh88ukwb Level 1

                              So by using a function like this i dont have to add the J2EE server when i create a new project?  I can simply put this function in ?

                               

                              Could you explain the function in a bit more detail thou please ?

                               

                              I am trying to create the chat example in the book you advised me to get, and in that you have to connect to the following Settings

                               

                              Root Folder - "C:\blazeds\tomcat\webapps\blazeds

                              Root URL - http://locahost:8400/blazeds

                              Context root - /blazeds

                               

                              But i am going to need to use

                               

                              Root Folder - "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\blazeds

                              Root URL -  http://10.1.1.12:8400/blazeds

                              Context root - /blazeds

                               

                               

                              So how would i implement this into a function like yours?

                               

                              Also is there any blazeds server side configurations that  i need to make in order for them to talk to each other?

                              • 12. Re: BlazeDS and Flex Intergration Problems
                                David_F57 Level 5

                                hi,

                                 

                                 

                                You still need to set up your project the normal way for local development, the difference is that rather than using the values read in from the build it overwrites them with your values after the program initialises (basically it pretty much ignores the services-config).  You still need to make sure your message-services etc on the server match your local ones.

                                 

                                I will email you the complete code from the video project so you can see how to modify your project to do the channel setup and change for the producer and consumer services.

                                 

                                 

                                David.

                                • 13. Re: BlazeDS and Flex Intergration Problems
                                  djh88ukwb Level 1

                                  Yes please, if you could email me the code, and any Blaze side changes i

                                  need to make i can get stuck into it and try to figure it all out, that

                                  would be a great help

                                  • 14. Re: BlazeDS and Flex Intergration Problems
                                    porchezhiyan

                                    Hi David,

                                     

                                           I need your complete code from the video project.  My mailId is porchezhiyan.t@riadigitalsolutions.com

                                     

                                    Thanks,