Setting Up JWSDP 2 With Tomcat 6

Aim
To set up the Java Web Services Development Pack 2 (JWSDP2) and configure Tomcat. There are versions of tomcat that come pre-configured with JSWDP support for the container. These can be downloaded from the Sun site - but this means a fresh install. We will be using vanilla tomcat install from Apache. Leave any questions or problems as comments and I will endeavour to answer them. The JWSDP is an alternative to using Axis.

Assumption
This article assumes that you have the JDK 1.5 already installed. Also you have a working and compatible version of tomcat installed and running. Tomcat is using port 8080 for this tutorial.

Versions used in this example
Sofware/ComponentImage
Windows XP SP2N/A
JWSDP 2jwsdp-2_0-windows-i586.exe
tomcat 6apache-tomcat-6.0.18.zip
Java JDK 1.5.0N/A
Links to these files can be found here.

Unzip/install JWSDP
  • You may wish to take a copy of your tomcat's 'bin' directory as files here will get replaced.
  • Download and install the jwsdp 2 (jwsdp-2_0-windows-i586.exe) make a note of the directory. 'C:\Sun\jwsdp-2.0' for this example. During the installation it will ask you whether you wish to download the tomcat conatiner - say no.
  • Go to jwsdp-shared\bin directory in your jwsdp install.
  • Edit the setenv.bat file. make sure all everything is pointing to the right places. This is what my environment looks like.
    set JAVA_HOME=D:\jdk1.5.0
    set ANT_HOME=C:\Sun\jwsdp-2.0\apache-ant
    set ANT_OPTS=-Djava.endorsed.dirs=C:\Sun\jwsdp-2.0\jaxp\lib\endorsed;C:\Sun\jwsdp-2.0\jaxp\lib
    set JWSDP_HOME=C:\Sun\jwsdp-2.0
    set CATALINA_HOME=C:\apache-tomcat-6.0.18

  • If you are using tomcat 6 then edit the jwsdpontomcat.bat file and make the change given below. Should be around line 52. basically get rid of the 'server.'
    original<available property="CATALINA_HOME" value="${catalina.home}"
    file="${catalina.home}/server/lib/catalina.jar" />
    modified<available property="CATALINA_HOME" value="${catalina.home}"
    file="${catalina.home}/lib/catalina.jar" />
    Tomcat six has a slightly altered directory structure from previous versions.
  • If you are using tomcat 6, edit jwsdpontomcat.xml and make the changes below. Should be round about line 43. Remove the 'server' from this line.
    original<available property="CATALINA_HOME" value="${catalina.home}"
    file="${catalina.home}/server/lib/catalina.jar" />
    modified<available property="CATALINA_HOME" value="${catalina.home}"
    file="${catalina.home}/lib/catalina.jar" />

  • Open a command prompt and 'cd' to the jwsdp-shared\bin directory in your jwsdp install.
  • Run setenv.bat.
  • Run jwsdpontomcat.bat. This will basically run ant on the jwsdpontomcat.xml file. It will copy everyting required over to your tomcat directory. At the end you should get the usual 'BUILD SUCCESSFUL' message.
  • Use a command prompt and cd into your tomcat bin directory. Your catalina.bat will now have been replaced with a new jwsdp version of if, have a look.
  • Run startup.bat. This should fire up your bootloader. You should see a small window open up in the right bottom hand side of your screen. The LauncheBootstrap will read the launcher.xml from your jswdb-shared\bin directory under your tomcat directory.
  • Go to your ./log directory under tomcat home and have a look at your 'launcher.server.log.' You may see a few ClassNotFound errors. Fix these by copying these files from your tomcat root directory to your tomcat lib directory.
    Tomcat
    _|_lib
    _|_saaj
    _|__|_lib
    _|__.__|_*.jar
    _|_jaxrpc
    _|__|_lib
    _|__.__|_*.jar
    _|_jwsdp-shared
    _|__|_lib
    _|__.__|_activation.jar
    _|_fastinfoset
    _|__|_lib
    _|__.__|_fastinfoset.jar
    _|_sjsxp
    _|__|_lib
    _.__.__|_*.jar
  • Also note that you may need the mail.jar file for MultiPartMime related classes.
  • Check your launcher.server.log again. All the errors should have disappeared and you are now done.

Test installation
  • Go to http://127.0.0.1:8080/jaxrpc-HelloWorld/hello?WSDL. You should see an xml file.
  • http://127.0.0.1:8080/saaj-book/

Back to the tutorial trail | Home

11 comments:

NODE said...

Hi, when i run jwsdpontomcat.bat, a message is shown: Missing arguments
Build Failed

My setenv.bat runs smoothly without any errors . I am using windows vista , is it something to do with that?

Z said...

Hard to make a call without more information. I suggest you put some 'echo' statments in the jwsdpontomcat.bat to find out exactly where it's failing.

Anonymous said...

Thank you... it helped me.
missing arguments: pass tomcat home directory as parameter to jwsdpontomcat.bat

praveena Reddy said...

I am using tomcat 6 on the jdk 1.6.when i am running jwsdpontomcat.bat file with tomcat 6 home directory as a argument I am getting

Directory does not contain a Aache Jakarta Tomcat 5 installation.
Usage:jwsdpontomcat.bat Tomcat5-installation-directory"


Please help me out regarding this

praveena Reddy said...

I solved the problem by passing the parameter

C:\progra~1\apache-tomcat-6.0.24 to the bat file jwsdpontomcat.bat.

progra~1 refers to the program files.

the ms dos batch file wont takes the file names with space the solution for this is ~1

Anonymous said...

how to pass the parameter

Jerson J said...

Hi,
Please help me out.I have Struts2 Application which works fine when I run in localhost…Somehow I am failed to run using Virtual host name…It comes to stating login page after then it cannot execute my action classes….I am try to google for the solution but nothing works out…Please help me on this issue…..

If My application can work in localhost I assume it will works for virtual host also…Please advice me on what can be the possible cause…

Many Thanks and Regards,

Jerson

S. Murugan said...

thankx
it worked really fine.

Harry Potter said...

Thank you all. I was able to use this article to deploy JWSDP2.0 in my system. I did re-install tomcat and JWSDP from C:\ to D:\ and all the problems got solved.

Anonymous said...

Nice post - Additional info to make it work with Tomcat6

Make sure you install tomcat into a directory without a space

Also modify the build file jwsdpontomcat.xml to replace the server as done with the bat file.

eventually the full-setup would run.

oracle fusion procurement training said...

hello,
Please assist me out.i've Struts2 utility which works great once I run in localhost…someway i am failed to run the use of digital host name…It comes to stating login page after then it cannot execute my motion lessons….I'm trying and google for the solution however not anything works out…Please assist me in this difficult…..

If My software can work in localhost I count on it will works for digital host also…Please advise me on what can be the feasible purpose…

Many thanks and Regards
for more information please visit the site
Oracle Fusion procurement Online Training
Oracle Fusion cloud procurement Online Training