openMDX/Example 2.0 for Tomcat/LWC Step-by-Step Guide

This guide explains how to install, setup and deploy the examples of openMDX/Example 2.0 on Tomcat/LWC.

Tomcat/LWC is Apache Tomcat 6 extended by the openMDX Lightweight Container for EJBs. The extended engine deploys web modules on Tomcat 6 and the EJB modules on the openMDX Lightweight Container. Compared to a fully-fledged J2EE Application Server, Tomcat/LWC offers very simple setup, high performance and very low resource consumption. On the other hand Tomcat/LWC does not implement all features which are required for a J2EE compliant application server. We use Tomcat/LWC in this guide. However, if you prefer you can deploy the applications also on any other J2EE Application Server.

IMPORTANT: This guide assumes that the openMDX/Example 2.0 projects are successfully setup as described in openMDX/Example 2.0 for Ant Step-by-Step.

Download

First, download the installer executables from here:

  • openmdxTomcatLwc-2.0.0-windows-installer.exe for Windows
  • openmdxTomcatLwc-2.0.0-linux-installer.bin for Linux
Before starting the installer make sure that you have installed JDK 1.5, Apache Ant 1.7 and 7-Zip (required for Windows platforms only).

The installer first takes you to the welcome screen.

pic010.gif

On the next screen specify the installation directory. In this guide we will use the directory c:\temp\SF\openmdxTomcatLwc-2.0.0.

pic020.gif

Specify the JDK 1.5 home directory. You MUST specify the home directory of a full JDK 1.5 installation. A JRE installation is NOT sufficient!

pic030.gif

On the next screen specify the port of the Tomcat HTTP transport. 9080 should do it for most situations. Specify a different port if you already have a service running on this port.

pic040.gif

At the end of the installation the installer executes a post-installation script. If everything goes well the log should look as shown below:

pic050.gif

The installer creates shortcuts to start and stop Tomcat/LWC and an URL shortcut which launches the Tomcat/LWC welcome page. Start Tomcat/LWC now.

pic060.gif

The console output should look as shown below. Verify your console output with this sample output.

HINT: on Linux systems it might be necessary to modify the shortcut so that it launches the application in a terminal window.

pic070.gif

Next try to launch the Tomcat/LWC welcome page.

pic075.gif

The welcome page looks as shown below.

pic076.gif

Finally stop Tomcat/LWC. We will need it again in a minute, but first we have to build and deploy the example applications.

pic080.gif

Next, open a shell and go to the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\helloworld. Run the command ant assemble. This builds the EARs which we will deploy on Tomcat/LWC. The console output looks as shown below. You can also compare the output with this sample output.

pic090.gif

The generated EAR is located in the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\jre-1.5\helloworld\deployment-unit. Copy the file openmdx-helloworld.ear to the directory .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\deployment-units as shown below:

pic100.gif

Next copy the Tomcat context configuration file openmdx-helloworld.xml located in the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\helloworld\src\connector\tomcat-6 to the directory .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\conf\Catalina\localhost.

pic110.gif

In a last step we have to add the user guest to the tomcat-user.xml which allows us to login to the helloworld application. Open the file .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\conf\tomcat-users.xml. Add a new entry for the user guest (if does not already exist) and add the role openMDXUser as shown below.

pic120.gif

Finally start Tomcat/LWC by clicking the Start Tomcat LWC shortcut. This starts Tomcat/LWC and deploys the application helloworld. The console output should look as shown below. Compare your output with this sample output.

pic130.gif

Next click in the Login Tomcat LWC shortcut. This launches a browser with the Tomcat/LWC main URL. Complete the URL by adding openmdx-helloworld/. This opens the helloworld login page. Enter the user guest and the password which you have defined in the tomcat-users.xml.

pic140.gif

The main page of the helloworld application is shown after successful login. The GUI of the helloworld application uses the generic openMDX/Portal GUI. The GUI is not customized, that's why labels and icons do not look very user-friendly. However, the GUI is fully workable.

pic150.gif

In order to test the sayHello() operation, go to the menu Pane:Op:90000 and select the menu entry Pane:Op:Tab:sayHello as shown below:

pic160.gif

The sayHello() operation takes as parameter the language which makes helloworld to return a language-specific Say Hello text. Enter one of the languages de, en or fr and click OK.

pic170.gif

The GUI invokes the operation sayHello() which returns the Say Hello message as result which is shown below:

pic180.gif

Stop Tomcat by clicking on the Stop Tomcat LWC shortcut.

In a next step we will build and deploy the workshop application. Go back to the shell and change to the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\workshop. Run the command ant assemble. Compare your output with this sample output.

pic190.gif

Next copy the two EARs openmdx-example-workshop-App.ear and openmdx-example-workshop-Web.ear from the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\jre-1.5\workshop\deployment-unit to the directory .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\deployment-units as shown below:

pic200.gif

Next copy the Tomcat context configuration file openmdx-example-workshop.xml located in the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\workshop\src\connector\tomcat-6 to the directory .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\conf\Catalina\localhost.

pic210.gif

Because the workshop example accesses a database we have to deploy a resource adapter configuration which defines the workshop JDBC database connection. You can do this by copying the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\workshop\src\connector\openmdx-2\postgresql-8.rar to the directory .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\deployment-units as shown below.

pic220.gif

Compare the contents of your deployment-units directory with the directory structure shown below:

pic230.gif

Before restarting Tomcat/LWC clean the contents of the directory work and temp. This makes sure that we do not deploy old files.

pic240.gif

Start Tomcat/LWC by clicking on the Start Tomcat LWC shortcut and compare your output with this sample output.

pic250.gif

Launch a browser, complete the URL with the suffix openmdx-example-workshop/ and login as guest:

pic260.gif

Next you should see the main page of the workshop application. Instead, it could also happen that you get an exception stack trace as output:

pic270.gif

In this case open the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\workshop\src\data\org.openmdx.example\WEB-INF\config\layout\en_US and remove the file show-org.openmdx.example.workshop1.Segment.jsp.

pic280.gif

Now we have to build and deploy the EARs again:

  • Stop Tomcat/LWC
  • Go back to the shell and run the command ant clean
  • ant deliverables
  • ant assemble
  • Copy the EARs to the directory .\openmdxTomcatLwc-2.0.0\apache-tomcat-6\deployment-units
  • Clean the content of the directories temp and work
  • Start Tomcat/LWC
  • Login again
You should now be able to launch the workshop application successfully:

pic290.gif

The project comes with some basic customizing. E.g. it comes with a wizard which can be launched from the menu item Wizards > Create New Project.... A wizard is a user-defined GUI extension. Wizards are a powerful and flexbile way to extend the standard openMDX/Portal GUI. Wizards are implemented as standard JSPs and as such have access to the full functionality of the application's API. The source code of the wizard is located in the directory .\openmdxExampleSdk-2.0.0\openmdx-example-2.0.0\workshop\src\data\org.openmdx.example\wizards\en_US.

pic300.gif

Try out the wizard. Enter values for project name, project manager and project tasks and click OK. After successful completion the wizards returns to the standard GUI which displays the newly created objects.

pic310.gif

Congratulations

Congratulations! You have successfully built and deployed the openMDX/Example 2.0 projects on Tomcat/LWC.

Version 90.1 last modified by superadmin on 08/07/2008 at 23:01

Comments 0

No comments for this document
Add Comment...

Attachments 38

Image
pic130.gif 1.1
PostedBy: superadmin on 25/04/2008 (32kb )
Image
pic080.gif 1.1
PostedBy: superadmin on 25/04/2008 (6kb )
Image
pic090.gif 1.1
PostedBy: superadmin on 25/04/2008 (29kb )
Image
pic100.gif 1.1
PostedBy: superadmin on 25/04/2008 (44kb )
Image
pic110.gif 1.1
PostedBy: superadmin on 25/04/2008 (80kb )
Image
pic120.gif 1.1
PostedBy: superadmin on 25/04/2008 (92kb )
Image
pic010.gif 1.1
PostedBy: superadmin on 25/04/2008 (26kb )
Image
pic020.gif 1.1
PostedBy: superadmin on 25/04/2008 (17kb )
Image
pic030.gif 1.1
PostedBy: superadmin on 25/04/2008 (18kb )
Image
pic040.gif 1.1
PostedBy: superadmin on 25/04/2008 (18kb )
Image
pic050.gif 1.1
PostedBy: superadmin on 25/04/2008 (13kb )
Image
pic060.gif 1.1
PostedBy: superadmin on 25/04/2008 (6kb )
Image
pic070.gif 1.1
PostedBy: superadmin on 25/04/2008 (38kb )
Image
pic075.gif 1.1
PostedBy: superadmin on 25/04/2008 (6kb )
Image
pic076.gif 1.1
PostedBy: superadmin on 25/04/2008 (93kb )
Image
pic140.gif 1.1
PostedBy: superadmin on 25/04/2008 (40kb )
Image
pic150.gif 1.1
PostedBy: superadmin on 25/04/2008 (57kb )
Image
pic160.gif 1.1
PostedBy: superadmin on 25/04/2008 (74kb )
Image
pic170.gif 1.1
PostedBy: superadmin on 25/04/2008 (90kb )
Image
pic180.gif 1.1
PostedBy: superadmin on 25/04/2008 (63kb )
Image
pic190.gif 1.1
PostedBy: superadmin on 25/04/2008 (30kb )
Image
pic200.gif 1.1
PostedBy: superadmin on 25/04/2008 (48kb )
Image
pic210.gif 1.1
PostedBy: superadmin on 25/04/2008 (63kb )
Image
pic220.gif 1.1
PostedBy: superadmin on 25/04/2008 (87kb )
Image
pic230.gif 1.1
PostedBy: superadmin on 25/04/2008 (88kb )
Image
pic240.gif 1.1
PostedBy: superadmin on 25/04/2008 (6kb )
Image
pic250.gif 1.1
PostedBy: superadmin on 25/04/2008 (33kb )
Image
pic260.gif 1.1
PostedBy: superadmin on 25/04/2008 (43kb )
Image
pic270.gif 1.1
PostedBy: superadmin on 25/04/2008 (68kb )
Image
pic280.gif 1.1
PostedBy: superadmin on 25/04/2008 (65kb )
Image
pic290.gif 1.1
PostedBy: superadmin on 25/04/2008 (94kb )
Image
pic300.gif 1.1
PostedBy: superadmin on 25/04/2008 (97kb )
Image
pic310.gif 1.1
PostedBy: superadmin on 25/04/2008 (74kb )
BIN
workshop-ant-assemble.log 1.1
PostedBy: superadmin on 25/04/2008 (1kb )
BIN
workshop-launch-tomcat.log 1.1
PostedBy: superadmin on 25/04/2008 (22kb )
BIN
helloworld-ant-assemble.log 1.1
PostedBy: superadmin on 25/04/2008 (1kb )
BIN
helloworld-launch-tomcat.log 1.1
PostedBy: superadmin on 25/04/2008 (9kb )
BIN
launch-tomcat-minimal.log 1.1
PostedBy: superadmin on 29/04/2008 (5kb )

Creator: on 2008/07/08 23:01
openMDX is licensed under a BSD license
1.3.8295