Wiki source code of Servlet Deployment Setup

Version 27.1 by Pascal Robert on 2012/07/21 20:28

Hide last authors
David Avendasora 24.1 1 {{note title="Bug Warning"}}
Pascal Robert 25.1 2 There is a bug in Tomcat, WO or Project Wonder that causes problems if you have more than one webapp deployed in a single instance of Tomcat if they don't all have identical classpaths. This bug will not impact most developers. If you are deploying a single application, or all your applications share the same classpath, then you will not run into this bug.
David Avendasora 24.1 3 {{/note}}
4
David Avendasora 8.1 5 == Introduction ==
6
Pascal Robert 27.1 7 WO developers have been able to deploy their applications as a WAR bundle in a J2EE container since WO 5.1, and as an independent SSDD (Servlet Single Directory Deployment) bundles and WAR files since WO 5.2. This article guides you through the simple setup in WOLips to allow you to deploy you application to a servlet container such as [[Apache Tomcat>>url:http://tomcat.apache.org/||shape="rect"]].
David Avendasora 8.1 8
9 == Prerequisites ==
10
Pascal Robert 27.1 11 1. Eclipse 3.4 & WOLips 5640 or later [[installed>>url:http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips||shape="rect"]].
David Avendasora 8.1 12 1. Servlet Container of your choice installed. For this article I'll be setting it up using a completely stock install of Tomcat 6.0.18.
Pascal Robert 26.1 13 1. An existing WebObjects project.
David Avendasora 8.1 14
15 == Step 1 - Project Properties ==
16
17 1. Right-Click on your project in the WO Explorer tab of the WOLips perspective in Eclipse and select "Properties" or select "Properties" from the "Project" menu.
Pascal Robert 27.1 18 [[image:attach:Picture 4.png]]
David Avendasora 14.1 19 1. Select "WOLips Deployment" from the left-hand side and check the "Servlet Deployment" checkbox and the "Autogenerate web.xml" checkbox.
Pascal Robert 27.1 20 [[image:attach:Picture 8.png]]
David Avendasora 18.1 21
22 == Step 2 - Install ==
23
24 1. Right-Click on your project and select "WOLips Ant Tools" and then "Instal"
Pascal Robert 27.1 25 [[image:attach:Picture 9.png]]
David Avendasora 20.1 26 1. Look in the Finder at your /Library/WebObjects/Application/ directory and you should find 3 files for your project
Pascal Robert 27.1 27 [[image:attach:Picture 10.png]]~#~# YourApp.woa
David Avendasora 20.1 28 11. YourApp directory - this is a Single Servlet Directory Deployment (SSDD) it contains all of the Frameworks on the build path embedded in it.
29 11. YourApp.war - this is your webapp archive. It contains all the same files as the SSDD, but zipped up.
David Avendasora 22.1 30
31 == Step 3 - Deploy ==
32
33 Copy the MyApp.war file to your servlet container's webapps directory.
Pascal Robert 26.1 34
35 === Notes about JBoss ===
36
37 I wouldn't consider myself a WAR expert, but I do deploy my WebObjects application using JBoss and it works very well.
38
Pascal Robert 27.1 39 Have you tried a "Hello World" type example application? If you can get a simple application running under JBoss then you should be okay with a more complicated one. I suggest starting with "Hello World" and then adding a simple EOF and that should cover everything.
Pascal Robert 26.1 40
Pascal Robert 27.1 41 There were a few tricky configurations in the initial setup. To be clear, I am using XCode, but it probably doesn't matter. Here are a few things to check.
Pascal Robert 26.1 42
Pascal Robert 27.1 43 Check you jboss-web.xml file. You definitely need to configure this file properly if you are using EOF. The application will never get started properly without this file configured correctly.
Pascal Robert 26.1 44
Pascal Robert 27.1 45 Make sure your deployment license gets built into the WAR file for deployment by setting the SERVLET_DEPLOY_LICENSE item.
Pascal Robert 26.1 46
47 Make sure the servlet project settings are correct:
48
Pascal Robert 27.1 49 * SERVLET_SINGLE_DIR_DEPLOY = NO
50 * SERVLET_TRUE_WAR = YES
51 * SERVLET_WEBAPPS_DIR = /Library/JBoss/3.2/deploy
Pascal Robert 26.1 52
Pascal Robert 27.1 53 Also, I explicitly defined a package for all of my classes. This prevents JBoss from complaining upon startup, however, JBoss still ran the application just fine anyway.