Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Reply
Thread Tools

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

 
 
greg.knaddison@gmail.com
Guest
Posts: n/a
 
      06-22-2004
Hi,

I'm trying to use the httpclient within Jython (see
http://jakarta.apache.org/commons/httpclient/ for more information on
the httpclient).

My Jython version is:
Jython 2.1 on java1.4.2_04 (JIT: null)

My Java version is:
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

My CLASSPATH includes:
jdom.jar
xerces.jar
jython.jar
jt400.jar
log4j-1.2.8.jar
commons-httpclient-2.0.jar

When I just try to perform the import statements from example code I
get the error pasted below.

import org.apache.commons.httpclient.Cookie
import org.apache.commons.httpclient.HttpClient
import org.apache.commons.httpclient.HttpState
import org.apache.commons.httpclient.cookie.CookiePolicy
import org.apache.commons.httpclient.methods.GetMethod

>>> import org.apache.commons.httpclient.HttpClient

Traceback (innermost last):
File "<console>", line 1, in ?
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at
org.apache.commons.httpclient.HttpClient.<clinit>( HttpClient.java:101)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.python.core.SyspathJavaLoader.loadClass(Syspat hJavaLoader.java)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.python.core.Py.findClassEx(Py.java)
at
org.python.core.SysPackageManager.findClass(SysPac kageManager.java)
at
org.python.core.PackageManager.findClass(PackageMa nager.java)
at
org.python.core.SysPackageManager.findClass(SysPac kageManager.java)
at
org.python.core.PyJavaPackage.__findattr__(PyJavaP ackage.java)
at org.python.core.PyObject.impAttr(PyObject.java)
at org.python.core.imp.import_next(imp.java)
at org.python.core.imp.import_logic(imp.java)
at org.python.core.imp.import_name(imp.java)
at org.python.core.imp.importName(imp.java)
at org.python.core.ImportFunction.load(__builtin__.ja va)
at org.python.core.ImportFunction.__call__(__builtin_ _.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.__builtin__.__import__(__builtin__ .java)
at org.python.core.imp.importOne(imp.java)
at org.python.pycode._pyx2.f$0(<console>:1)
at org.python.pycode._pyx2.call_function(<console>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at
org.python.util.PythonInterpreter.exec(PythonInter preter.java)
at
org.python.util.InteractiveInterpreter.runcode(Int eractiveInterpreter.java)
at
org.python.util.InteractiveInterpreter.runsource(I nteractiveInterpreter.java)
at
org.python.util.InteractiveInterpreter.runsource(I nteractiveInterpreter.java)
at
org.python.util.InteractiveConsole.push(Interactiv eConsole.java)
at
org.python.util.InteractiveConsole.interact(Intera ctiveConsole.java)
at org.python.util.jython.main(jython.java)

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory

Thanks for any help you can provide. If this is the wrong
forum...point me the right way.

Greg

 
Reply With Quote
 
 
 
 
Irmen de Jong
Guest
Posts: n/a
 
      06-22-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> My CLASSPATH includes:
> jdom.jar
> xerces.jar
> jython.jar
> jt400.jar
> log4j-1.2.8.jar
> commons-httpclient-2.0.jar


[...]

> java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError:
> org/apache/commons/logging/LogFactory
>
> Thanks for any help you can provide. If this is the wrong
> forum...point me the right way.


This has nothing to do with Python or Jython.

You're missing Jakarta's commons LOGGING package.
(commons httpclient requires that jar).
Get it from the same place as commons-httpclient.

--Irmen
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments