< System Information, Benchmarks, Stress Tests | Working With Windows | Web Services with Axis and XMLBeans Example >
The basis for this procedure was found in this 2006-02-05 Anil John blog entry. Additional hints for resolving issues running the stock quote sample were found in this 2004-12-14 Jason Bodnar email and this 2003-11-01 Jacob Kjome email. The rest was just trial and error, accompanied by grousing and banging of head on hard objects.
You need the full installation packages for:
In addition, you will need selected files from several other projects. I have bundled these files into axis_support.zip (2.3Mb). If you prefer to get them directly from their respective projects, here’s the list:
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11If you don’t know how to set environment variables in Windows XP, refer to the Microsoft Knowledge Base article 310519 How To Manage Environment Variables in Windows XP.
%JAVA_HOME%\bin to the end of your existing PATH environment variable.
javac -version dummy.javaIt should report the version number and then complain that it cannot read
dummy.java. If something else happens, you have probably not set your environment variables correctly, or there could be something wrong with your JDK installation.
C:\DevTools\Tomcat5.5 (notice that the space between Tomcat and 5.5 should be removed) and select a FULL installation.
80 (the default is 8080).
C:\Program Files\Java\jdk1.5.0_11), not some JRE folder.
CATALINA_HOME=C:\DevTools\Tomcat5.5
axis-bin-1.4.zip file into the C:\DevTools folder, creating a C:\DevTools\axis-1.4 folder.
AXIS_HOME=C:\DevTools\axis-1_4
AXIS_LIB=%AXIS_HOME%\lib
AXISCLASSPATH=%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery-0.2.jar;
%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;
%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\wsdl4j-1.5.1.jar;%AXIS_LIB%\activation.jar;
%AXIS_LIB%\mail.jar;%AXIS_LIB%
AXIS_WEBINF=%AXIS_HOME%\webapps\axis\WEB-INF
%PATH% contains the folder(s) where you will store the native libaries.
%AXIS_WEBINF%\lib folder. If you have downloaded the packages individually, copy the following files from each indicated project into that folder:
activation.jar from JAF
mail.jar from JavaMail
xercesImpl.jar and xml-apis.jar from Xerces
xmlsec-1.3.0.jar from XML-Security
wss4j-1.5.1.jar from WSS4J
activation.jar and mail.jar into %AXIS_LIB% (make sure those two jars exist in both folders).
axis.xml in your %CATALINA_HOME%\conf\Catalina\localhost folder, and editing that file (e.g. using WordPad). Make sure it contains only the following line:
<Context docBase="C:\DevTools\axis-1_4\webapps\axis" />
axis-support.zip jar files into the wrong folder or otherwise failed to get all six jar files into the correct folder.

%AXIS_HOME% folder.
%AXIS_WEBINF%\lib folder. The one we will be using is in the stock folder there.
%AXIS_HOME%\samples\stock folder and issue the command shown in this screen shot:

@java -cp…” command is all one line, it will just wrap around in your Command Prompt window. For your convenience, if you would like to simply copy and paste the command, here it is (even if it displays on multiple lines, it will copy as one line):
java -cp |

java -cp…” command is all one line, it will just wrap around in your Command Prompt window. For your convenience, if you would like to simply copy and paste the command, here it is (even if it displays on multiple lines, it will copy as one line):
java -cp .; |
xmlbeans-2.2.0.zip file into the C:\DevTools folder, creating a C:\DevTools\xmlbeans-2.2.0 folder.
XMLBEANS_HOME=C:\DevTools\xmlbeans-2.2.0
XMLBEANS_LIB=%XMLBEANS_HOME%\lib
XMLBEANSCLASSPATH=%XMLBEANS_LIB%\xbean.jar;%XMLBEANS_LIB%\jsr173_1.0_api.jar
%XMLBEANS_HOME%\bin to your PATH.
%XMLBEANS_LIB% to %AXIS_WEBINF%\lib.
scomp.cmd (in the %XMLBEANS_HOME%\bin folder) using NotePad or WordPad. Change the line which reads
java -classpath "%cp%" org.apache.xmlbeans.impl.tool.SchemaCompiler %*
to
"%JAVA_HOME%\bin\java" -classpath "%cp%" org.apache.xmlbeans.impl.tool.SchemaCompiler %*
If you are going to be working in Cygwin, edit the scomp file, changing the last line to
"$JAVA_HOME/bin/java" -Xmx256m -classpath "$cp" org.apache.xmlbeans.impl.tool.SchemaCompiler "$@"
scomp -version in a Command Prompt and check that it does report the version and not some error message.
Errors and warnings I encountered along the way when trying to test the stock quote sample, which are avoided if the above procedure is followed, include the following.
wsdl4j jar to the %AXISCLASSPATH%:
Exception in thread "main" java.lang.NoClassDefFoundError Source code of java.lang.NoClassDefFoundError: javax/wsdl/OperationType |
at org.apache.axis.description.OperationDesc Source code of org.apache.axis.description.OperationDesc<clinit>(OperationDesc.java:58) |
at org.apache.axis.client.Call Source code of org.apache.axis.client.Call(Call.java:941) |
at org.apache.axis.client.Call Source code of org.apache.axis.client.Call(Call.java:984) |
at samples.stock.GetQuote Source code of samples.stock.GetQuote(GetQuote.java:70) |
at samples.stock.GetQuote Source code of samples.stock.GetQuote(GetQuote.java:95) |
log4j are eliminated by adding %AXIS_LIB% to %AXISCLASSPATH%:
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle). |
log4j:WARN Please initialize the log4j system properly. |
activation.jar and mail.jar to %AXISCLASSPATH% (which is why you also extract/copy them into %AXIS_LIB% in the procedure above):
Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled. |
wsdl link for the service dependent on XMLBeans gets you to a page about an Axis fault; you forgot to copy the XMLBeans jars into %AXIS_WEBINF%\lib or you failed to fix the permissions on the copied files (see below).
C:\DevTools\axis-1_4\docs\index.html in your favorite browser to access the Axis documentation. Or, you can just go to ws.apache.org/axis/java/index.html for the same set of documents.
Much of this may be second-nature to Java programmers; but I am not a Java programmer. I won’t remember this stuff a week from now if I don’t use it again until then.
-cp %AXISCLASSPATH% when compiling a client. You don’t need it when compiling a simple service.
samples.userguide.example3.Client, which is located in %AXIS_HOME%\samples\userguide\example3, the classpath must contain %AXIS_HOME%.
.class file into the appropriate directory tree in %AXIS_HOME%\webapps\axis\WEB-INF\classes. Then you must “Stop” then “Start” axis from the Tomcat /manager.
If you use Cygwin to deal with any of the files used by Tomcat or Axis, pay special attention that you don’t mess up the alternate access methods? for any of those files. In other words, if the “+” disappears from the permissions of the file (e.g. when you do ls -l), then things may mysteriously stop working. Hopefully, you have not removed the alternate access methods from all files in the Tomcat or Axis directory tree. Simply find one with the “+” intact and use that getfacl|setfacl trick I mentioned on the referenced page.
Alternately, doing chmod +rx will fix the problem (but may leave the file more accessible to others).
If you deploy a service incorrectly (for example, you have the wrong value for the className property in your WSDD), it may be difficult to undeploy via the AdminService. Simply shut down Axis and edit %AXIS_WEBINF%\server-config.wsdd, removing the entry for your incorrectly deployed service.
For a fairly detailed example web service which uses XMLBeans to support XML-based service request and response, see Web Services with Axis and XMLBeans Example.
< System Information, Benchmarks, Stress Tests | Working With Windows | Web Services with Axis and XMLBeans Example >