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

    Custom Tomcat

    Bjorn_1

      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" />
          <properties>
              <source>be.ordina.almcloud.webapp.assembler.UserAssembler</source>
              <scope>application</scope>   
              <item-class>domain.user.User</item-class>
                 
              <metadata>
                  <identity property="username" />
              </metadata>
                 
              <network>
                  <paging enabled="false" pageSize="10" />
              </network>
          </properties>
      </destination>

       

       

      <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:columns>
              <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" />
          </mx:columns>
      </mx:DataGrid>  

       

      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:

           

          <default-channels>
              <channel ref="my-rtmp" />
          </default-channels>

           

          Channel configuration:

           

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

           

          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.