1 Reply Latest reply on Feb 2, 2011 4:14 AM by Bjorn_1

    Custom Tomcat


      I've been looking at this for a couple of days now and it's driving me nuts tbh.  I've created a Java backend, which is used by a Flex frontend to execute some actions.  For some reasons, it's impossible to do this on Tomcat 7+.  I've reverted to Tomcat 5.5 and it's possible to get my data from the server (hurray ).  Is it possible to give some directions on how to enable data services on a Tomcat 7.  Simply adding the libraries to the classpath isn't enough apparently, but I can't find anything in the configuration files that points to something specific from Data Services.


      My second problem is that it's impossible to send updates to the other clients.  I already discovered that ActiveMQ has to be added to the classpath, otherwise it doesn't work.  My fill-method is executed with the updated data, so I don't think the problem lies within the backend.  I've created an application in Flex, that uses an Assembler from the lcds-samples (inventory).  It's possible to load all the products from the database and all updates are sent to other clients.  So I have no idea what the problem is.


      The code simply adds or updates User-objects in a HashMap.  There's no database, but that shouldn't be a problem imo.  The Assembler calls a DAO to do the CRUD-operations.  I've added some logging to the fill-method and it always contains the updated data.  So there's a problem with the connection between server and client.


      <destination id="dest-user">
          <adapter ref="java-dao" />
                  <identity property="username" />
                  <paging enabled="false" pageSize="10" />



      <mx:DataService id="ds" destination="dest-user" autoCommit="true" autoSyncEnabled="true" autoMerge="true" />
      <mx:ArrayCollection id="userList" />


      <mx:DataGrid id="dg" dataProvider="{userList}" editable="true" x="15" y="10">
              <mx:DataGridColumn dataField="username" headerText="Username" />
              <mx:DataGridColumn dataField="firstName" headerText="First Name" />
              <mx:DataGridColumn dataField="name" headerText="Name" />
              <mx:DataGridColumn dataField="email" headerText="E-mail" resizable="true" />


      Thanks for pointing me in the right direction .

        • 1. Re: Custom Tomcat
          Bjorn_1 Level 1

          So, I've been able to implement a "fix".  What I did was deploy my backend (War-file) on a Tomcat server (v5.5) and added RTMP to my configuration:


              <channel ref="my-rtmp" />


          Channel configuration:


          <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
              <endpoint url="rtmp://localhost:2307" class="flex.messaging.endpoints.RTMPEndpoint" />


          When I update data, another client receives the updated data immediately.  I don't know yet why it works, but I'll figure that out :-).  However, when I try the same on a Tomcat v7 server, I don't receive the updates.  I'll get into that, when I find a solution I'll post it here.