You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Juan Cervera <Ju...@nomadsoft.com> on 2005/08/08 17:59:32 UTC

RE: Exception in thread "main" java.lang.NoClassDefFoundError: or g.apache.commons???

If you want to get rid of those log4j warnings, just put a
log4j.properties file on the same directory from where you are running
the java command (it maybe that you need "." in your CLASSPATH for this
to work).

My default properties file is as follows:

# Set root category priority to INFO and its only appender to CONSOLE.
log4j.rootCategory=DEBUG, CONSOLE
#log4j.rootCategory=INFO, CONSOLE, LOGFILE

# Set the enterprise logger category to FATAL and its only appender to
CONSOLE.
log4j.logger.org.apache.axis.enterprise=DEBUG, CONSOLE
log4j.logger.org.apache.axis.i18n.ProjectResourceBundle=DEBUG, CONSOLE

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x -
%m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=axis.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x -
%m%n

Hope it helps

-----Original Message-----
From: Bish, Tim [mailto:Tim.Bish@Sensis.com] 
Sent: 08 August 2005 16:10
To: 'axis-user@ws.apache.org'
Subject: RE: Exception in thread "main" java.lang.NoClassDefFoundError:
or g.apache.commons???

I think I remember getting that warning, I just ignored it for now,
everything still seemed to work ok.

-----------------------------------------
Timothy A. Bish
Sensis Corperation
-----------------------------------------

-----Original Message-----
From: Chen, Donald [mailto:dchen@nrgn.com] 
Sent: Monday, August 08, 2005 11:08 AM
To: axis-user@ws.apache.org
Subject: RE: Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons???

Tim and Meghan, 

You guys are correct.  I changed names as you suggested.  And It works!

But still, I got some warnings:

D:\axis121\AXIS-1~1\samples\stock>java -cp %AXISCLASSPATH%
org.apache.axis.client.AdminClient
-lhttp://localhost:8080/axis/services/AdminService deploy.wsdd
log4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
Processing file deploy.wsdd
<Admin>Done processing</Admin>


Do those warnings matter?

Thanks again,

Don



-----Original Message-----
From: Bish, Tim [mailto:Tim.Bish@Sensis.com] 
Sent: Monday, August 08, 2005 10:45 AM
To: 'axis-user@ws.apache.org'
Subject: RE: Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons???

Don is correct you JARs are not the correct names, here's my path

C:\Documents and Settings\tbish>echo %AXISCP%
.;C:\Program Files\Java\jaf-1.0.2\activation.jar;C:\Program
Files\Axis\lib\axis-
ant.jar;C:\Program Files\Axis\lib\axis.jar;C:\Program
Files\Axis\lib\commons-dis
covery-0.2.jar;C:\Program Files\Axis\lib\commons-logging-1.0.4.jar
;C:\Program F
iles\Axis\lib\jaxrpc.jar;C:\Program Files\Axis\lib\saaj.jar;C:\Program
Files\Axi
s\lib\wsdl4j-1.5.1.jar;C:\Program Files\Java\javamail-1.3.2\mail.jar;

That should get you going, that WIKI page is also good to take a look
at.

The whole spaces thing can really be annoying...

-----------------------------------------
Timothy A. Bish
-----------------------------------------

-----Original Message-----
From: pietila.meghan@comcast.net [mailto:pietila.meghan@comcast.net] 
Sent: Monday, August 08, 2005 10:40 AM
To: axis-user@ws.apache.org
Subject: RE: Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons???

Don,

The JAR file names in your classpath don't match up to the names in my
1.2.1
download of Axis; I had the same problem when I copied a classpath setup
script from the wiki (but had forgotten until Tim mentioned it).

You'll want to go through and compare each JAR name against the real JAR
in
your /lib directory; for example, commons-discovery.jar is actually
commons-discovery-0.2.jar on my system.

That might be all you need to do... we'll see if Tim comes up with
something
additional.

If you haven't discovered this page on the wiki yet, it might be useful:
http://wiki.apache.org/ws/FrontPage/Axis/UsingCommandLineTools

BTW, thanks for the reminder about quotation marks for
spaced-classpaths,
Tim, I remember reading that once but had never needed to use it.  :)


Meghan




Tim,

This is what the AXISCLASSPATH look like,

D:\axis121\AXIS-1~1\samples\stock>echo %AXISCLASSPATH%
D:\axis121\axis-1_2_1\lib\axis.jar;D:\axis121\axis-1_2_1\lib\commons-dis
covery.jar;D:\axis121\axis-1_2_1\lib\commons-logging.jar;D:\axis121\axis
-1_2_1\lib\jaxrpc.jar;D:\axis121\axis-1_2_1\lib\saaj.jar;D:\axis121\axis
-1_2_1\lib\log4j-1.2.8.jar;D:\axis121\axis-1_2_1\lib\xml-apis.jar;D:\axi
s121\axis-1_2_1\lib\xercesImpl.jar


Thanks,

Don

-----Original Message-----
From: Bish, Tim [mailto:Tim.Bish@Sensis.com] 
Sent: Monday, August 08, 2005 10:15 AM
To: 'axis-user@ws.apache.org'
Subject: RE: Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons???

What does you AXISCLASSPATH look like?  Can you dump it out and attach
paste
it into an email?


-----Original Message-----
From: Chen, Donald [mailto:dchen@nrgn.com] 
Sent: Monday, August 08, 2005 10:05 AM
To: axis-user@ws.apache.org
Subject: RE: Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons???

Meghan,

Thanks for the advice.  I reran the commend and I got the same response:

D:\axis121\AXIS-1~1\samples\stock>java -cp %AXISCLASSPATH%
org.apache.axis.client.AdminClient -lhttp://localhost:8080/a
is/services/AdminService deploy.wsdd
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.ja
va:41)
        at
org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33
)
        at
org.apache.axis.client.AdminClient.<clinit>(AdminClient.java:48)

Any idea?

Don


-----Original Message-----
From: pietila.meghan@comcast.net [mailto:pietila.meghan@comcast.net] 
Sent: Friday, August 05, 2005 5:19 PM
To: axis-user@ws.apache.org
Subject: Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons???

Don,

>From your copy and paste below, it appears that you put the
AXISCLASSPATH variable in quotation marks.  Don't do that; you want the
shell to fill in the actual value--that's what the percent signs are
for.

Meghan Pietila
Granite Consulting




On a Win box, I followed the Axis 1.2 "Installation Guide" and tried the
"Run the admin client"

java -cp %AXISCLASSPATH% org.apache.axis.client.AdminClient
-lhttp://localhost:8080/axis/services/AdminService deploy.wsdd

I am pretty sure the path %AXISCLASSPATH% was set right, but I still got
this errors:

D:\axis121\AXIS-1~1\samples\stock>java -cp "%AXISCLASSPATH%"
org.apache.axis.
axis/services/AdminService deploy.wsdd
Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.commons
        at
org.apache.axis.components.logger.LogFactory.class$(LogFactory.jav
        at
org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.axis.components.logger.LogFactory.getLogFactory(LogFact
        at
org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.j
        at
org.apache.axis.client.AdminClient.<clinit>(AdminClient.java:48)
 
Is this related to the JCL classloader issue or something else?  How can
I go around it?
 
This is my configure:  Axis 1.2 Tomcat5.5.9, WinXPPro, JRE1.5.
 
Thanks,
 
Don