Changes for page Servlet Deployment Setup

Last modified by Pascal Robert on 2012/07/21 20:28

From version 25.1
edited by Pascal Robert
on 2012/07/21 20:25
Change comment: There is no comment for this version
To version 29.1
edited by Pascal Robert
on 2023/11/13 11:56
Change comment: Renamed from xwiki:documentation.Servlet Deployment Setup

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +Deployment
Content
... ... @@ -1,32 +1,30 @@
1 1  {{note title="Bug Warning"}}
2 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.
3 -
4 4  {{/note}}
5 5  
6 6  == Introduction ==
7 7  
8 -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>>http://tomcat.apache.org/]].
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"]].
9 9  
10 10  == Prerequisites ==
11 11  
12 -1. Eclipse 3.4 & WOLips 5640 or later [[installed>>http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips]].
11 +1. Eclipse 3.4 & WOLips 5640 or later [[installed>>url:http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips||shape="rect"]].
13 13  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.
14 -1. An existing WebObjects project.
13 +1. An existing WebObjects project.
15 15  
16 16  == Step 1 - Project Properties ==
17 17  
18 18  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.
19 -[[image:Picture 4.png]]
18 +[[image:attach:Picture 4.png]]
20 20  1. Select "WOLips Deployment" from the left-hand side and check the "Servlet Deployment" checkbox and the "Autogenerate web.xml" checkbox.
21 -[[image:Picture 8.png]]
20 +[[image:attach:Picture 8.png]]
22 22  
23 23  == Step 2 - Install ==
24 24  
25 25  1. Right-Click on your project and select "WOLips Ant Tools" and then "Instal"
26 -[[image:Picture 9.png]]
25 +[[image:attach:Picture 9.png]]
27 27  1. Look in the Finder at your /Library/WebObjects/Application/ directory and you should find 3 files for your project
28 -[[image:Picture 10.png]]
29 -11. YourApp.woa
27 + [[image:attach:Picture 10.png]]~#~# YourApp.woa
30 30  11. YourApp directory - this is a Single Servlet Directory Deployment (SSDD) it contains all of the Frameworks on the build path embedded in it.
31 31  11. YourApp.war - this is your webapp archive. It contains all the same files as the SSDD, but zipped up.
32 32  
... ... @@ -33,3 +33,23 @@
33 33  == Step 3 - Deploy ==
34 34  
35 35  Copy the MyApp.war file to your servlet container's webapps directory.
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 +
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.
40 +
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.
42 +
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.
44 +
45 +Make sure your deployment license gets built into the WAR file for deployment by setting the SERVLET_DEPLOY_LICENSE item.
46 +
47 +Make sure the servlet project settings are correct:
48 +
49 +* SERVLET_SINGLE_DIR_DEPLOY = NO
50 +* SERVLET_TRUE_WAR = YES
51 +* SERVLET_WEBAPPS_DIR = /Library/JBoss/3.2/deploy
52 +
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.
Picture 10.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +16.4 KB
Content
Picture 4.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +60.9 KB
Content
Picture 7.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +122.4 KB
Content
Picture 8.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +124.8 KB
Content
Picture 9.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +80.7 KB
Content
XWiki.XWikiComments[0]
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.ronx
Comment
... ... @@ -1,0 +1,31 @@
1 +On step 2
2 +
3 +from eclipse/wolips i have:
4 +
5 +Buildfile: /Users/esuser/Documents/workspace571/JBossHelloWorld/build.xml
6 + init.properties:
7 + init.install:
8 + compile:
9 +
10 +BUILD FAILED
11 + /Users/esuser/Documents/workspace571/JBossHelloWorld/build.xml:206: The framework name 'ERExtensions' does not exist.
12 +
13 +Total time: 1 second
14 +
15 +from console i have:
16 +
17 +vm-mlion-01:workspace571 esuser$ cd JBossHelloWorld/
18 + vm-mlion-01:JBossHelloWorld esuser$ ant install
19 + Buildfile: /Users/esuser/Documents/workspace571/JBossHelloWorld/build.xml
20 +
21 +init.properties:
22 +
23 +init.install:
24 +
25 +compile:
26 +
27 +BUILD FAILED
28 + /Users/esuser/Documents/workspace571/JBossHelloWorld/build.xml:203: taskdef class org.objectstyle.woproject.ant.WOCompile cannot be found
29 + using the classloader AntClassLoader[]
30 +
31 +how can i fix this?
Date
... ... @@ -1,0 +1,1 @@
1 +2012-10-12 07:05:59.714
XWiki.XWikiComments[1]
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.rblazek
Comment
... ... @@ -1,0 +1,11 @@
1 +On HelloWorld.woa and Step 3
2 +
3 +Would it be possible to add a few more details for the last step of deployment? E.g. using the HelloWorld.woa example? I have a fresh install of WO/WOLips and Tomcat 7, but the HelloWorld app does not start up. Did you actually try this with a fresh install of WOLips? The error messages are related to the Servlet class included in the WO's javaxml.jar. So it feels like some options are needed for compilation, or some trick afterwards. It does not feel like a Tomcat config problem. According to some posts I read this was supposedly fixed in 2009, but maybe the problem is back?
4 +
5 +This is a great tutorial, I appreciate it a lot. The problem is that it does not seem to go all the way to deployment with a fresh clean install.
6 +
7 +Thanks, Rudy
8 +
9 +Error Message:
10 +
11 +INFO: validateJarFile(/var/lib/tomcat7/webapps/HelloWorld/WEB-INF/lib/javaxml.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Date
... ... @@ -1,0 +1,1 @@
1 +2013-01-08 12:09:25.929