Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Tomcat 6 +  Axis problem

Thread view: 
juhanay@mbnet.fi - 09 May 2007 00:16 GMT
Hi
I have succesfully installed axis 1.4 + tomcat 6.0.10 and JWS files
seems to be running right.
However when I try to run a basic calculator client example from axis
userguide (page 8)

http://ws.apache.org/axis/java/user-guide.html

I get the folowing error message

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
\axis>java samples
.userguide.example2.CalcClient -p8080 add 2 5

Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons.logging.LogFactory
       at org.apache.axis.components.logger.LogFactory.class$
(LogFactory.java:45)
       at org.apache.axis.components.logger.LogFactory
$1.run(LogFactory.java:45)
       at java.security.AccessController.doPrivileged(Native Method)
       at
org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:
41)
       at
org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:
33)
       at org.apache.axis.utils.Options.<clinit>(Options.java:35)
       at samples.userguide.example2.CalcClient.main(CalcClient.java:
29)

The service works through Tomcat and it can be accesed as the
userguide says(localhost:8080/axis/Calculator.jws), but i cannot get
the client working. I hope that someone can help me out.
Arne Vajhøj - 09 May 2007 01:55 GMT
> I have succesfully installed axis 1.4 + tomcat 6.0.10 and JWS files
> seems to be running right.
[quoted text clipped - 11 lines]
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org.apache.commons.logging.LogFactory

> The service works through Tomcat and it can be accesed as the
> userguide says(localhost:8080/axis/Calculator.jws), but i cannot get
> the client working. I hope that someone can help me out.

It sounds as if jakarta commons logging jar file is missing
in classpath !

Arne
juhanay@mbnet.fi - 09 May 2007 15:57 GMT
Hi again.
No joy with the jakarta commons logging jar file. I will list here the
most important enviromental variables. These are windows XP
enviromental variables.

AXIS_HOME            C:\Program Files\Apache Software Foundation
\Tomcat 6.0\webapps\axis
AXIS_LIB                 %AXIS_HOME%\WEB-INF\lib
AXISCLASSPATH    %AXIS_LIB%\axis.jar;
                             %AXIS_LIB%\jaxrpc.jar;
                             %AXIS_LIB%\saaj.jar;
                             %AXIS_LIB%\commons-logging.jar;
                             %AXIS_LIB%\commons-discovery.jar;
                             %AXIS_LIB%\wsdl4j.jar;
                             %AXIS_HOME%;
                             %AXIS_HOME%\WEB-INF\classes\;
CLASSPATH           %AXISCLASSPATH%
JAVA_HOME          C:\Program Files\Java\jdk1.6.0_01

I still cannot make it work? Any suggestions I am puzzed. Could
someone help me out please.
Arne Vajhøj - 19 May 2007 21:43 GMT
> No joy with the jakarta commons logging jar file. I will list here the
> most important enviromental variables. These are windows XP
[quoted text clipped - 16 lines]
> I still cannot make it work? Any suggestions I am puzzed. Could
> someone help me out please.

The classpath is not rigth.

I don't quite understand what the above is. It does not appear
to be either commands to set env vars or display of env vars.

You could start by moving the stuff to a dir with no spaces in the
name. That has cause many problems over the years.

Arne
Lew - 19 May 2007 22:23 GMT
>> No joy with the jakarta commons logging jar file. I will list here the
>> most important enviromental variables. These are windows XP
[quoted text clipped - 21 lines]
> I don't quite understand what the above is. It does not appear
> to be either commands to set env vars or display of env vars.

Interpreting the list as a representation of Windows envars and their values,
with extraneous whitespace to be eliminated in "real life", I see some issues
aside from the failure to literally quote the relevant values.

The OP has deployed Axis to a web app inside Tomcat 6.  Usually no explicit
classpath is needed for Tomcat beyond having JARs in the webapp's WEB-INF/lib
directory.  Yet they also set up an explicit Java classpath to use the JARs.
Presumably this is to make life easier for Wsdl2Java runs and the like.

However, having a specific deployment of a specific web app as a CLASSPATH
element makes it vulnerable to redeployments and undeployments, which
presumably are done with regard only for reasons relevant to the web-app
environment.

It is better to use an "endorsed" directory of some kind, independent of the
web container, as a classpath element.

As an aside, Axis-enabled web apps don't /have/ to be called "axis".

The envar approach is also a little dicey because the CLASSPATH thus defined
is global.  This makes it hard to understand what's going on with disparate
projects sometimes.  Better to use launch scripts that set their own specific
classpaths for use in the -cp command option.  Best of all to use Ant.

> You could start by moving the stuff to a dir with no spaces in the
> name. That has cause many problems over the years.

You can get around the whitespace problem by putting quotes (") around the
path elements.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.