Deploying a Logi Info Application on WAS Updated 30 April 2015 These instructions apply to WAS 7.x and WAS 8.x, for use with Logi Info and JDK 1.6 or 7.x. WAS versions earlier than 7.0 cannot be used with Logi Info. Interfaces shown in the included screen shots may vary slightly depending on version. Logi applications which run on WAS are deployed to the application server as WAR files. Use the following steps to deploy your Logi application: 1. Create a new application (the application stub) in Logi Studio using File New Application... Select the Java application type, then enter Name and Folder information (determines where the application is placed - for example C:\Logi Applications). When the Studio wizard deploys the application, it is simply creating the application structure in the location specified and is NOT deploying the application to WAS. 2. A context root helps distinguish multiple applications deployed on the same Application Server. For example, if an application's context root is app1 and you deployed the application on a Server whose domain address is websphere and it is listening on port 9080, the application s URL would be: http://websphere:9080/app1 in order to access it from a web browser. If another application is deployed on the same server with context root app2, then you would use the URL http://websphere:9080/app2 to access it from a web browser. In Logi Studio, in the _Settings definition, add an Application element Caption value (the app name that appears in browser tabs) and a Path element Application Path value. The App Path value is the URL to the application, for example: http://websphere:9080/<app name>. It s highly recommended that you use the <app name> as the context root in the deployment process described in the following steps. 3. Delete the cookie-config section, highlighted below, in the Logi application s WEB-INF/web.xml file: <session-config> <cookie-config> <http-only>true</http-only> </cookie-config> <session-timeout>20</session-timeout> </session-config> www.logianalytics.com Page 1
4. Package the Logi application into a WAR file, using one of these two methods: Using The Java Development Kit JAR Utility: From the command line, locate the JAR utility. This is included with the Java Development Kit (JDK) and will be found in the bin folder. From within the Logi application folder (Step 1 above) execute the JAR utility using the -cvf command line options. For example: {JAVA_HOME}\jdk1.6.0_17\bin\jar.exe cvf LogiApp.war. The JDK folder name will vary depending on the JKD version you re using. Make sure the final. is included in the command, as this tells the utility to get all files from this location. When the utility finishes, the WAR file will have been created. Using a ZIP Program: Before the application folder can be zipped up, you need to create a folder and a manifest file. In the Logi application folder, create a new folder named META-INF. In it, create a text file named MANIFEST.MF and add the following lines of text to it: Manifest-Version: 1.0 Created-By: 1.6.0_17 (Sun Microsystems Inc.) The JDK version number in the second line will vary depending on the JDK version your using. Use a ZIP utility, such as WinZIP or RAR, to compress the contents of the Logi application, in ZIP format. Important! Compress the contents of the application folder, NOT the application folder itself. Once the ZIP file is created, change its file extension from.zip to.war. www.logianalytics.com Page 2
5. Once the application is packaged as a WAR file, with the base application structure, it can be deployed to WAS. Login to the WAS Administration Console and click the Applications Application Type WebSphere enterprise applications link, as shown above. 6. On the Enterprise Application Screen, click Install to deploy the WAR file. Select the location of the WAR file on the local file system (assuming that s where it is), then click Next. 7. Once the file has been uploaded and examined by WAS, select the Fast method for preparing the application for deployment, and click Next. 8. In the first preparation step, modify the Context Root of the application to be the <app name> (from Step 2 above). Note that Context Roots need to be unique inside the same Application Server. 9. In the remaining four preparation steps, use the default values. Once completed, be sure to save all changes directly to the master configuration. Configuring the Deployed Logi Application At this point the application is deployed but now some configuration changes need to be made. The following are the recommended Java Option settings. Please note that not all options apply to all definitions. In particular, the heap options Xms and Xmx depends on your deployment and the usage expected based on your environment - see the note on the next page. www.logianalytics.com Page 3
Typical Performance Settings (required) "-server (JDK) -Xmx1280m (JDK, JRockit) -XX:MaxPermSize=256m (JDK) -XX:-DisableExplicitGC (JDK) -XX:CompileThreshold=8000 (JDK) -Djava.awt.headless=true (JDK, JRockit) JConsole Settings (optional, for monitoring) -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=<your host ip addr> -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false Tracing Settings (optional, for testing) -verbose:gc -Xprof -XX:-CITime -XX:-PrintCompilation -Xloggc:$CATALINA_HOME/logs/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps" The Java heap space setting, -Xmx1280m, shown above is sufficient only for a minimal 32-bit development system, not for a production system. A setting more appropriate for a 64-bit production server would be something like -Xmx8192m. Consult your production server administrator. For 64-bit JVMs that require it, you need to add a -d64 flag to force the JVM to use 64-bit addressing. Create a JSF Shared Library Each Logi application will need its own JSF Shared Library for its special files. For example, WAS 8 ships with Java Server Faces (JSF 1.2) enabled but Logi applications use (and ship with) JSF 1.1, so a shared library for JSF 1.1 needs to be created and used. To set up a shared library, follow these instructions: 1. Create a physical shared library folder named, for example, C:\Program Files\IBM\WebSphere8\LogiSharedLib Then move the following files from the Logi application s WEB-INF\lib directory into the shared library: commons-beanutils-1.7.0.jar www.logianalytics.com Page 4
commons-digester-1.6.jar myfaces-api-1.1.5.jar myfaces-impl-1.1.5.jar 2. In the WAS Administration Console, click the Environment Shared Libraries link to display the current environment settings, as shown above. 3. Under Scope, select appropriate Cell, Node and Server identifiers and click New. www.logianalytics.com Page 5
4. Give the new shared library the name, JSF Shared Library - <LogiApp>, and set the Classpath to the shared library from Step 1, for example, C:\Program Files\IBM\WebSphere8\LogiSharedLib 5. Check the Use an isolated class loader for this shared library checkbox, as shown above. 6. Click OK to create the shared library. The new library will become available to the application. Don t forget to save the changes directly to the master configuration. www.logianalytics.com Page 6
Map the Shared Library to the Logi Application Next, the new JSF Shared Library needs to be mapped to the Logi application: 1. In the WAS Administration Console. Click the WebSphere enterprise applications link to see a list of applications, then click the name of the Logi application. 2. In the Configuration panel, click the JSP and JSF options link, as shown above. www.logianalytics.com Page 7
3. In the options panel, ensure that the JSF Implementation is set to SunRI 1.2, as shown above, and click OK. 4. Add the JSF shared library to the application by clicking the Shared library references link, as shown above. www.logianalytics.com Page 8
5. In the References panel, select the application by checking its checkbox and clicking the Reference shared libraries button to add the library, as shown above. www.logianalytics.com Page 9
6. In the Mapping panel, select the new shared library in the Available list and click the Right Arrow button to move it to the Selected List, as shown above. Then click OK. 7. You ll be returned to the list and will see the library added to the application. On the listing screen, click OK to complete. Once complete don t forget to save the changes directly to the master configuration. Configure the Class Loader Finally, configure the Class loader: 1. In the Configuration panel, click the Class loading and update detection link, as shown above. www.logianalytics.com Page 10
2. Set the Class loader order policy so the parent class loader is loaded first, as shown above. Do not attempt to set this policy at the WebSphere server level or the Admin console will be disabled, along with other things undesirable results. Click OK. We re ready to start the application. Navigate to the Enterprise Application panel using Applications Application Types WebSphere enterprise applications. Check the Logi application s checkbox and click Start. The application will be started and available at its URL, for example: http://websphere:9080/<logiapp> Continuing Development of the Deployed Logi Application Once the application stub has been deployed, development of the Logi app can occur on WAS. Open Logi Studio and select File Open Application. Browse to the deployment folder on WAS (when the application is deployed WAS explodes the WAR files into a specific location), which will have a path like: www.logianalytics.com Page 11
<WAS Install Folder>\profiles\<Profile Name>\installedApps\<Cell Name>\<App Name> for example: C:\Program Files\IBM\WebSphere8\AppServer\profiles\AppSrv01\installedApps\ webspherenode01cell\logiapp.ear\logiapp.war Using this path in Logi Studio eliminates the need to package the application as a WAR file and deploy to WAS repeatedly while in development. It allows you to build reports and test them from within Logi Studio quickly, without the need to deploy WAR files. Once application development is completed and the application is ready to be deployed on a production WAS the deployment process outlined at the beginning of this document will be used. www.logianalytics.com Page 12