BlazeDS Installation Guide
BlazeDS runs in a J2EE web application and is available in ZIP files for the following configurations:
- BlazeDS with integrated Apache Tomcat application server
- BlazeDS web applications
BlazeDS runs on the following platforms:
These installation instructions refer to root directory where you unzip the BlazeDS ZIP file as install_root.
BlazeDS includes the following Web Application Archive (WAR) files:
- blazeds.war - The primary BlazeDS WAR file: use this as a starting point for building your BlazeDS application.
- samples.war - Sample BlazeDS applications.
- ds-console.war - Simple monitoring application for BlazeDS deployments.
Each WAR file is a separate, stand-alone web application. If you are using the J2EE web application option, you must have an existing J2EE application server or servlet container available and understand web application deployment. If you do not have an existing J2EE server or are not familiar with WAR file deployment, use the integrated Tomcat configuration to get started.
BlazeDS with integrated Tomcat
The BlazeDS with integrated Tomcat ZIP file contains the following files and directories under the installation root:
- readme.htm - Contains an overview of important information.
- blazeds.war - BlazeDS web application, used as a starting point for new applications.
- samples.war - BlazeDS sample applications.
- ds-console.war - Simple monitoring application for BlazeDS deployments.
- license.txt - Contains license information.
- /tomcat - Contains an installation of Apache Tomcat that includes blazeds, samples, and ds-console web applications expanded and deployed in the default server.
- /resources - Contains Flex SDK source code, fully commented configuration files, as well as directories and files used for security, clustering, Flex Ajax Bridge and manually creating HTML wrappers. Flash Player installers are in the Flex SDK ZIP file.
To install BlazeDS in the integrated Tomcat configuration:
- Read the BlazeDS release notes for known issues and any late-breaking information.
- Unzip the ZIP file to a local directory on your file system.
- Make sure that the machine you are installing on has a Java Development Kit (JDK) installed and a JAVA_HOME environment variable.
- To start BlazeDS, open a command window, navigate to install_root/tomcat/bin, and enter the catalina start command. On UNIX and Linux, enter ./catalina start. Optionally, on Windows you can navigate to the install_root/tomcat/bin in Windows Explorer and double-click the catalina.bat icon.
- The BlazeDS sample applications use an HSQLDB database that is installed in the install_root/sampledb directory. To start the sample database:
- Open a command prompt and go to the install_root/sampledb directory.
- Run startdb.bat (Windows) or startdb.sh (Unix-based systems).
Running the Test Drive with the integrated Tomcat install
In addition to the BlazeDS WAR file, the BlazeDS download includes a version of Tomcat (6.0.14) with a series of web applications fully configured with BlazeDS (including blazeds-sample). To run the test drive after downloading and expanding the integrated Tomcat install:
- Start Tomcat (startup.bat or startup.sh in /blazeds/tomcat/bin).
- Open a browser and access the samples home page:
http://localhost:8400/samples/
- Take the test drive!
BlazeDS J2EE web applications
The BlazeDS J2EE web application option installs the following files and directories under the installation root:
- readme.htm - Contains an overview of important information.
- blazeds.war - BlazeDS web application, used as a starting point for new applications.
- samples.war - BlazeDS sample applications.
- ds-console.war - Simple monitoring application for BlazeDS deployments.
- license.txt - Contains license information.
- /resources - Contains Flex SDK source code, fully commented configuration files, as well as directories and files used for security, clustering, Flex-Ajax Bridge and manually creating HTML wrappers. Flash Player installers are in the Flex SDK ZIP file.
To install BlazeDS as a J2EE web application:
- Read the BlazeDS Release Notes for known issues and any late-breaking information.
- Unzip the BlazeDS ZIP file.
- Deploy the blazeds, samples, and ds-console web applications by using your application-server-specific deployment method. For example, for Tomcat, copy the WAR files to the webapps directory and restart the server.
- The BlazeDS sample applications use an HSQLDB database that is installed in the install_root/sampledb directory. To start the sample database:
- Open a command prompt and go to the install_root/sampledb directory.
- Run startdb.bat (Windows) or startdb.sh (Unix-based systems).
- Perform additional application-server specific configuration, as described in Additional server-specific configuration.
Additional server-specific configuration
You may need to perform additional configuration steps for the following application servers:
- Tomcat 6
- WebSphere 6
- JBoss
- Running from a compressed WAR
- Integrating BlazeDS with a ColdFusion 8 installation
Tomcat
To use BlazeDS with Tomcat, follow these steps after deploying the BlazeDS WAR files. These steps are not necessary for the integrated Tomcat installation.
- Increase the maximum memory to at least 512MB. This is achieved by specifying the maximum heap size for the JVM in the JAVA_OPTS variable: -Xmx512m
- (Optional) To enable custom authentication, locate the Tomcat security resource libraries under install_root/resources/security/tomcat.
- Put flex-tomcat-common.jar in tomcat/lib/blazeds.
- Place flex-tomcat-server.jar in tomcat/lib/blazeds.
- Edit the catalina.properties file which can be found in the tomcat/conf directory. Find the common.loader property and add the following path to the end of the list: ${catalina.home}/lib/blazeds/*.jar
- Add <Valve className="flex.messaging.security.TomcatValve"/> tag to the Context descriptors. For example, for the BlazeDS samples WAR:
<Context path="/samples" docBase="${catalina.home}/webapps/samples" debug="0">
<Valve className="flex.messaging.security.TomcatValve"/>
</Context>
You will now be authenticated against the current Tomcat realm. Usually, the default for this authentication stores user information in conf/tomcat-users.xml. See the Tomcat documentation for more information on realms. See the documentation for more information on BlazeDS custom authentication.
- You may also need to update the active <login-command> in /WEB-INF/flex/services-config.xml
in each deployment of a BlazeDS WAR file. For Tomcat, ensure that the TomcatLoginCommand is active in the <security> section:
<security>
<login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat" />
...
- (Optional) To use the JMSAdapter with the Message Service, you must install and configure a JMS provider (such as activeMQ or openJMS) for use with Tomcat.
- Restart Tomcat.
Configuring ActiveMQ 4.1.1 with Tomcat 6.0.x
These instructions create a configuration that matches what is distributed with BlazeDS. You should be able to integrate Apache ActiveMQ 4.1.1 with earlier versions of Tomcat and you should also be able to integrate newer versions of ActiveMQ with Tomcat 6.0.x, but none of these configurations have been tested. These instructions require that you have a valid Apache Ant installation.
Complete the following steps to integrate ActiveMQ with your own installation of Tomcat 6.0.x:
- Download ActiveMQ 4.1.1 from http://activemq.apache.org.
- Download and install the ActiveMQ distribution following the instructions provided on the ActiveMQ website.
- ActiveMQ ships with an example that contains the JAR files and configuration settings that work with a web application deployment. Build the example by opening a command prompt, changing to the activemq_root/example directory and running the following command to build the example:
ant war
- In the tomcat_root/lib directory, create a new directory called activemq4.1.1. Copy the contents of the activemq_root/example/target/activemq-web/WEB-INF/lib directory to this new directory.
- Open the catalina.properties file from the tomcat_install/conf directory in a text editor. Modify the common.loader property by adding the following to the list of comma-seperated paths:
${catalina.home}/lib/activemq4.1.1/*.jar
- Modify your BlazeDS web application to start an ActiveMQ message broker when the web application starts. To do this, open the WEB-INF/web.xml file for your web application in a text editor. Add the following context-param and listener elements. Make sure you put them in the correct location within the web.xml. The order of these must match the web-app dtd.
- In the WEB-INF directory of your web application create a new file called activemq.xml. Open the file in a text editor and add the following text:
This starts an ActiveMQ message broker with a broker name of myBroker listening for requests on the localhost network interface at port 61716.
- Add the ActiveMQ connection factories and any JMS Topics and Queues you want to use to JNDI. The easiest way to do this in Tomcat 6.0.x is to create a context file for your web application and put the settings in there. To do this, create a new file in the tomcat_install/conf/Catalina/localhost directory. If the Catalina/localhost directory does not exit already create it now. The new file that you create should have the same name as the web application with a .xml extension. For example, if your BlazeDS web application is named samples the Tomcat context file should be named samples.xml. For more information on context files, refer to your Tomcat documentation. Once you have created the file, open it in a text editor. Add the following contents to the file, replacing the example topic and queue shown here with your own topics and queues:
- Start your Tomcat server. The ActiveMQ message broker should start listening for messages on port 61716 and you should be able to send messages to and receive message from the JMS topics and queues you have configured. For more information about configuring and using ActiveMQ, please refer to the ActiveMQ documentation which is available on http://activemq.apache.org.
WebSphere
(Optional) To enable custom authentication, open the WebSphere Administrator and configure a custom user registry using the files under install_root/resources/security/websphere/ as usersFile and groupsFile custom properties.
JBoss
(Optional) To enable custom authentication, you must perform the following configuration steps:
- Put install_root/resources/security/tomcat/flex-tomcat-common.jar and install_root/resources/security/tomcat/flex-tomcat-server.jar in the jboss_root/server/default/lib folder.
- Add <Valve className="flex.messaging.security.TomcatValve"/> tag to the Context descriptors.
- Restart JBoss.
This configuration provides authentication against the current JBoss realm. Usually, the default for this authentication stores user information in jboss_root/server/default/conf/users.properties and roles information in jboss_root/server/default/conf/roles.properties. For more information on realms, see the JBoss documentation. For more information on BlazeDS custom authentication, see the BlazeDS documentation and information in the install_root/resources/security directory.
Running from a compressed WAR
To run BlazeDS from a compressed WAR file, perform the following steps:
- Expand the flex.war file using winzip or the JAR utility.
- Create your application, including SWF files, ActionScript files, configuration settings and HTML wrappers.
Note: For more information on compiling SWF files and creating HTML wrappers, see the BlazeDS documentation.
- Create a compressed WAR file from the expanded web application structure.
- Deploy the compressed WAR file.
Note that many samples applications in samples.war use HSQLDB which will not function within a compressed web application. It is therefore advised to deploy samples as an uncompressed war.
Note that when running BlazeDS from a compressed WAR file some features, such as clustering are not available.
Integrating BlazeDS with a ColdFusion 8 installation
To integrate BlazeDS with ColdFusion 8 with integrated LiveCycle Data Services ES installation, perform these steps:
- Shut down ColdFusion.
- Move aside the ColdFusion8/wwwroot/WEB-INF/flex directory.
- Edit ColdFusion8/WEB-INF/web.xml:
- Comment out/remove the definitions of FlexMxmlServlet and FlexInternalServlet servlets.
- Comment out/remove the servlet mapping for FlexMxmlServlet and FlexInternalServlet.
- Comment out/remove the taglig definition for the FlexTagLib tag library.
- Complete the following instructions for ColdFusion without Integrated LiveCycle Data Services ES.
To integrate BlazeDS with ColdFusion 8 without integrated LiveCycle Data Services ES installation, perform these steps:
- Shut down ColdFusion.
- Unzip blazeds.war in to a temporary directory (In this example c:\temp\BlazeDS).
- Move aside the following jar files from ColdFusion8/lib:
- flex-messaging.jar
- flex-messaging-common.jar
- flex-messaging-opt.jar
- flex-messaging-req.jar
- Copy the following jar files from c:\temp\BlazeDS\WEB-INF\lib to ColdFusion8/lib:
- flex-messaging-common.jar
- flex-messaging-core.jar
- flex-messaging-opt.jar
- flex-messaging-proxy.jar
- flex-messaging-remoting.jar
- Create a new directory (create the WEB-INF/flex directory if needed):
ColdFusion8/wwwroot/WEB-INF/flex/jars
- Copy the following jar files from c:\temp\BlazeDS\WEB-INF\lib to ColdFusion8/wwwroot/WEB-INF/flex/jars:
- concurrent.jar
- cfgatewayadapter
- Set up the configuration files for BlazeDS. You can copy the set of configuration files from the BlazeDS ZIP file (not the WAR file). Copy the following files in resources/ColdFusion to ColdFusion8/wwwroot/WEB-INF/flex:
- services-config.xml
- messaging-config.xml
- proxy-config.xml
- remoting-config.xml
(Optional)
You can continue to use the configuration files from your integrated LiveCycle Data Services ES installation by doing the following:
- Copy services-config.xml, messaging-config.xml, proxy-config.xml, and remoting-config.xml from the WEB-INF/flex directory you moved aside earlier back to ColdFusion8/wwwroot/WEB-INF/flex.
- Remove from the following line from the services-config.xml file:
<service-include file-path="data-management-config.xml" />
- Remove the <channel-definition> for the ColdFusion-specific RTMP channel (if not commented out) and remove the java-http and java-secure-http channel definitions.
- Uncomment the java-amf, java-secure-amf and java-polling-amf channels. Do not include the java-rtmp channel definition.
- Edit the proxy-config.xml file and change the lines:
<channel ref="java-http"/>
<!-- <channel ref="java-amf"/> -->
to the following text:
<channel ref="java-amf"/>
|
|
The documentation says that you should go to http://localhost:8400/blazeds-samples/ to view the samples. The sample deployed war file is http://localhost:8400/samples/ and on your own installation of tomcat it should be http://localhost:8080/samples/ by default.
Wade Arnold