Contents
BlazeDS 4.0 Installation Guide
Installing BlazeDS with integrated Apache Tomcat application server (turnkey)
Installing BlazeDS with J2EE web applications
Additional server-specific configuration
Running BlazeDS from a compressed WAR file
Upgrading BlazeDS 3.2 to version 4.0
BlazeDS runs in a J2EE web application and is available in ZIP files for the following configurations:
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:
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. Note: for more information on the BlazeDS Spring integration see http://www.springsource.org/spring-flex.
The BlazeDS with integrated Tomcat ZIP file contains the following files and directories under the installation root:
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. There are two test drive applications:
Samples
Samples-spring
To run the test drive applications after downloading and expanding the integrated Tomcat install:
The BlazeDS J2EE web application option installs the following files and directories under the installation root:
Run startdb.bat (Windows) or startdb.sh (Unix-based systems).
Perform additional application-server specific configuration, as described in Additional server-specific configuration.
In addition to the BlazeDS WAR file, the BlazeDS download includes a series of web applications fully configured with BlazeDS. There are two test drive applications:
To run the test drive after the install:
Start your application 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). # Open a browser window. # Access one of the sample application home pages by opening the one of the following URLs in a browser (the host name and port number of the deployed war file depends on the configuration of your web application): ** http://hostName:portNumber/samples/ ** http://hostName:portNumber/samples-spring/ # Take the test drive!
You may need to perform additional configuration steps for the following application servers: * Tomcat 6 * WebSphere 6 * JBoss * Running from a compressed WAR
To use BlazeDS with Tomcat, follow these steps after deploying the BlazeDS WAR files. These steps are not necessary for the integrated (turnkey) 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.
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"> </valve></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. </valve>
You may also need to update the active <login-command> in /WEB-INF/flex/services-config.xml </login-command>
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.</login-command></security></security>
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:
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.
<context-param>
<param-name>brokerURI</param-name></context-param>
<param-value>/WEB-INF/activemq.xml</param-value>
<listener>
<listener-class>org.apache.activemq.web.SpringBrokerContextListener</listener-class>
</listener>
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:
<beans>
<broker usejmx="true" persistent="false" xmlns="http://activemq.org/config/1.0" brokername="myBroker"></broker></beans>
<transportConnectors>
<transportconnector name="default" uri="tcp://localhost:61716">
</transportConnectors>
</transportconnector>
This starts an ActiveMQ message broker with a broker name of myBroker listening for requests on the localhost network interface at port 61716.
1. 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:
<context privileged="true" antiresourcelocking="false" antijarlocking="false" reloadable="true"></context>
<resource name="jms/flex/TopicConnectionFactory" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerurl="tcp://localhost:61716" brokername="myBroker">
<resource name="jms/topic/flex/simpletopic" type="org.apache.activemq.command.ActiveMQTopic" description="my Topic" factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalname="FlexTopic">
<resource name="jms/flex/QueueConnectionFactory" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerurl="tcp://localhost:61716" brokername="myBroker">
<resource name="jms/queue/flex/simplequeue" type="org.apache.activemq.command.ActiveMQQueue" description="my Queue" factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalname="FlexQueue">
<valve classname="flex.messaging.security.TomcatValve">
</valve></resource></resource></resource></resource>
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.
h5.Running the monitoring application, ds-console.war, on WebSphere with administrative security
JBoss deployment requires a web application directory structure to follow a specific naming convention. For example, to deploy the samples web application, you must expand the samples.war file to a directory called samples.war and then copy that to the JBoss deployment directory.
(Optional) This configuration provides custom authentication against the current JBoss realm. Usually, the default location 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.
Add the TomcatValve to the context.xml in the jboss_root/server/default\deploy/jboss-web.deployer folder:
<valve classname="flex.messaging.security.TomcatValve"></valve>
Add users and roles to the users.properties and roles.properties files in jboss under jboss_root/server/default/conf folder.
You will now be authenticated against the current JBoss realm.
This configuration provides custom authentication against the current JBoss realm:
Add the TomcatValve to the context.xml under \server\default\deploy\jboss-web.sar:
<valve classname="flex.messaging.security.TomcatValve"></valve>
Create a tomcat-users.xml file in the jboss_root/server/default/conf directory. The following example shows a basic tomcat-users.xml file:
<xml version="1.0" encoding="utf-8" ?=""> <tomcat-users> <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"> </user></user></user></role></role></tomcat-users></xml>
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.
BlazeDS 4.0 ships with an empty web application called blazeds.war. You likely used the blazeds.war from version 3.2 as the basis for the web application that you want to upgrade. You are going to use the blazeds.war from version 4.0 as the basis of your upgraded version 3.2 web application.
Note: BlazeDS 4.0 introduced a new empty web application called blazeds-spring.war. Since this is a new application introduced in this release, your upgrade will use the blazeds.war and not include blazeds-spring.war.
The following procedure describes how to upgrade an existing installation of BlazeDS 3.2 to BlazeDS 4.0:
Copy the assets from your existing version 3.2 web application to the empty BlazeDS 4.0 web application. Copy all image, font, SWF, Java, and JAR and other files required by your application.
Note: Do not copy any configuration files from the WEB-INF/flex directory of your existing version 3 web application.
Merge the configuration files from the WEB-INF/flex directory of your existing version 3.2 web application to the configuration files in the WEB-INF/flex directory of the new BlazeDS 4.0 web application. To perform this merge, copy and paste your destination, channel, endpoint, and other definitions from the version 3.2 configuration files to the version 4.0 configuration files.
Note: Because configuration files can contain new configuration properties, or change the default values of existing properties, do not overwrite the version 4.0 configuration files with the version 3.2 configuration files. Instead, always merge your custom settings into the version 4.0 configuration files.
(Optional) If you deploy a compressed or packaged web application, repackage the web application.
BlazeDSHome |
Related Projects |