Expand my Community achievements bar.

Question about model driven dev and RDS configuring

Avatar

Level 2

I am testing the model driven development that is brought up by Flash Builder4 and LCDS3 recently, and it went pretty well. However i've noticed that the configuration of the RDS for development mode is not recommanded for a production environment.

My first quetion is can I simply disable the RDS on the server when I want to deploy my app to a production environment and still be able to use all of the features such as data management service and remote service etc.? I've tried to do so but it gave me a 404 page. I felt it was a little bit confusing when you know you DO have a html template located in the right location. If RDS can be disabled without interfering the functionality of the app, where can I find a doc to follow?

My second question is if the RDS is a must, then how to configure the security setting? I knew some of the requirements by visiting this url:http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WS6822bf3ec1c7b2e9-30fb9b22126b9c...,

however, when I followed the steps and test it, I got a 400 error in FB4 RDS configuration page.

Since I am testing this under Tomcat 5.5, I am not sure where should I put the flex-tomcat-common.jar and flex-tomcat-server.jar file in, cause the dir structure of Tomcat 5.5 is a little bit different than that of Tomcat 6.0. Then I put these files under both of the tomcat 5.5\common\lib folder and the tomcat 5.5\server\lib folder. I've doubled checked the the catalina.properties file which is located under tomcat5.5\conf folder and I see the following environment param has been there : ${catalina.home}/common/lib/*.jar.

The other configuration I made that differs from the doc was: I put <valve classname="flex.messaging.security.TomcatValve"></valve> into the context.xml, which is under the folder Tomcat 5.5/conf. Since I put the Resource definition in the same file, I guess this should not be the problem.

Does anyone has any successful experience on setting this up?

Any hint will be appreciated.

8 Replies

Avatar

Employee

Yes.  If you disable RDS in the web.xml either by commenting it out (the way it ships) or removing it, then RDS will not be on when the web application is deployed.  This means that normal data services functionality is all there, you just will not be able to deploy a model or look at your databases when within flash builder.  But regular remoting and data management stuff is completely unaffected.

Essentially your web.xml will look very similar to this (this is the default lcds web.xml with the RDS and Websphere stuff removed):


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

    <display-name>LiveCycle Data Services</display-name>

    <description>LiveCycle Data Services Application</description>

    <!-- Http Flex Session attribute and binding listener support -->
    <listener>
        <listener-class>flex.messaging.HttpFlexSession</listener-class>
    </listener>

    <!-- MessageBroker Servlet -->
    <servlet>
        <servlet-name>MessageBrokerServlet</servlet-name>
        <display-name>MessageBrokerServlet</display-name>
        <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
        <init-param>
            <param-name>services.configuration.file</param-name>
            <param-value>/WEB-INF/flex/services-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>


    <servlet-mapping>
        <servlet-name>MessageBrokerServlet</servlet-name>
        <url-pattern>/messagebroker/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>

</web-app>

Configuring valve for tomcat can be tricky.  Here is the original documentation of how to configure valve for tomcat: http://help.adobe.com/en_US/livecycle/es.original/lcds_installation.html#tomcat.  Hopefully that will help you get it set up correctly.

Avatar

Level 2

Thanks for the quick reply.

I solved my first problem, it was because I accidentally commented out part of the RDS configuration and left the servlet-mapping part un-commented. After I generate all the client and server codes and re-deploy them to the environment, I finally got my running demo with RDS disabled.

For the second problem, I am still stucking in. I've tried to switch to the Tomcat 6.0 and follow both of the LCDS installation doc and the LCDS3.1_using doc. None could work me out. I constantly get the error message said that "The RDS server was successfully contacted, but your security credentials were invalid". So after struggling a whole day, I found the following statement, which is appeared in the ColdFusion configuraton doc:"Note: If you are using ColdFusion MX 7 or earlier, the message "The RDS server was successfully contacted, but your security credentials were invalid," appears. The message indicates that the password was not validated, even if it is correct. Click OK to close the message. ". That's interesting cause it seems it was exact the situation I was encountered. However, in my case, ignoring the error message does not give me a successful RDS connection.

For your information, I am pasting the configurations I had on my machine and maybe some ppl could give me a correction.

service-config.xml:

......

<security>
  <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>       
        <!-- Uncomment the correct app server
        <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
        <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
        <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
        -->
        <security-constraint id="basic-read-access">
            <auth-method>Custom</auth-method>
            <roles>
                <role>guests</role>
                <role>accountants</role>
                <role>employees</role>
                <role>managers</role>
                <role>rds</role>
            </roles>
        </security-constraint>
    </security>

......

tomcat-user.xml:

.....

<tomcat-users>
  <role rolename="rds"/>
  <user username="rdsuser" password="rdspassword" roles="rds"/>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>

......

web.xml:

......

<servlet>
        <servlet-name>RDSDispatchServlet</servlet-name>
    <display-name>RDSDispatchServlet</display-name>
        <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
        <init-param>
      <param-name>useAppserverSecurity</param-name>
      <param-value>true</param-value>
    </init-param>
        <load-on-startup>10</load-on-startup>
    </servlet>

    <servlet-mapping id="RDS_DISPATCH_MAPPING">
        <servlet-name>RDSDispatchServlet</servlet-name>
        <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
    </servlet-mapping>

......

lcds.xml:

......

<Valve className="flex.messaging.security.TomcatValve"/>
<Transaction factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>

<Resource name="jdbc/codedata" auth="Container"
   type="javax.sql.DataSource"
   username="root"
   password="******"
   driverClassName="com.mysql.jdbc.Driver"
   url="jdbc:mysql://localhost:3306/codedata?autoReconnect=true"/>
   <Resource name="jdbc/atlantis" auth="Container"
   type="javax.sql.DataSource"
   username="root"
   password="******"
   driverClassName="com.mysql.jdbc.Driver"
   url="jdbc:mysql://localhost:3306/atlantis?autoReconnect=true"/> 

......

Note that both of the flex-tomcat-common.jar and flex-tomcat-server.jar were already under Tomcat 6.0/lib folder.

Avatar

Level 3

Looks like there are a couple of things that could be causing the problem:

1.  Are you using the turnkey version of LiveCycle Data Services that includes Tomcat?

If so, it is preconfigured with the common.loader property in tomcat/conf/catalina.properties to include:

${catalina.home}/lib/lcds/*.jar

It includes the flex-tomcat-common.jar and flex-tomcat-server.jar in the tomcat/lib/lcds directory.

The Using LCDS documentation on configuring RDS says to put those files into tomcat/lib, but you only want to do that if you ARE NOT using the integrated (turnkey) version of LCDS that includes Tomcat.  I'll make sure that gets updated. The install doc does say "non-integrated" only in the "Additional server configuration" section for Tomcat.

If you did put those jars in tomcat/lib and you are using the integrated version, take them out and make sure they already exist in tomcat/lib/lcds and that the common.loader property in tomcat/conf/catalina.properties includes them.

BTW: If you do have the non-turnkey Tomcat, when you put those JARS directly in tomcat/lib, you wouldn't not need to reference them in catalina.properties.

2. Are you using the lcds web application (as opposed to lcds-samples, for example)? Just want to make sure, since you added your valve configuration to lcds.xml.

Hopefully, you will be up and running after checking through these things.

Avatar

Level 2

Hi Mike, thanks for your reply.

I am useing non-integrated Tomcat 6.0 and I have my application under webapp/lcds folder. One of my colleague has a integrated Tomcat environment though, I'll ask her to test the configuration on her machine and see if she can succefully connect to the RDS with security. I'll get back to you later today.

Here is the latest status:

My colleague who used a  turnkey version of LCDS3.1 could connected to the RDS with security turned on. However, I still could not.

The Tomcat on my machine was installed a couple of months ago and was used to be the testing app server for our previous project, which was based on Flex3+LCDS2.6. I still kept this project on the server and modified the port number for channels in LCDS3.1 so that they dont conflict. My Tomcat used a Http NIO connector on 8080 port and other settings were pretty much the default settings, I did add some JVM params to customize the memory and GC stuff.

Does any of the above settings could possibly affect the RDS configuration?

Message was edited by: mayaning

Avatar

Level 3

Just as a quick check, search for the UserDatabase configuration in your tomcat/conf/server.xml file and check what the pathname attribute is set to. Is it set to use conf/tomcat-users.xml?  Here's what mine looks like:

<Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />

Just want to make sure you are using the UserDatabase and that it is pointing to the right pathname.

Avatar

Level 2

yes, I did checked this actually, also the Realm setting in the server.xml looks fine, besides, I tested the /manager/html url just to make sure those settings works and they do.

the settings are as follows.

<Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

I guess I could hold this problem back for now, cause even if I can not figure out the security settings on my Tomcat, I can still disable the RDS server when I want to deploy my app to the product environment in the future. I'll check this later, and probably test it on another machine with a new Tomcat installed just in case it is my tomcat problem.

Thanks for all of your help!

Avatar

Level 3

I think the issue is that the doc shows the <Valve> element as lowercase. That doesn't work. It is case sensitive and should be replaced with:

<Valve classname="flex.messaging.security.TomcatValve"/>

Avatar

Level 2

I just checked the <Value...> tage in my lcds.xml file, and it begins with a upper-case V.

I've also installed Tomcat 6.0(with lcds.war deployed) on another machine and configured the RDS with the same setting as I motioned in above posts. It also shows the same error message when I tried to test the connection in my Flash Builder.