java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Problem
Web application is deployed, but hits following error message.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66) at com.mkyong.SimpleHttp.main(SimpleHttp.java:18)
Solution
This is caused by the missing of commons-logging-xxx.jar.
To fix it, download the commons logging library via http://commons.apache.org/downloads/download_logging.cgi, or Maven repository
<dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency>
Then include it into your project classpath.
Tags : java

Thank you! Helped me a lot!
Thanks a lot :) it worked for me now :)
Thank you very much mkyong..i l u…
you have saved me!
Thank you very much!
you are welcome, Pwale
I am working on ejb project in netbeans using jboss server.when i am trying to send connection request to the router i am getting the following error.The error is shown at the line HttpClient client = new HttpClient();
i placed commons-httpclient-3.1.jar,commons-logging-1.1.jar,commons-codec.jar in my project.
12:43:48,854 ERROR [LogInterceptor] Unexpected Error in method: public abstract
void org.openacs.HostsLocal.RequestConnection(long) throws java.lang.Exception
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.commons.httpclient.HttpClient.(HttpClient.java:66)
at org.openacs.HostsBean.RequestConnectionHttp(HostsBean.java:251)
at org.openacs.HostsBean.RequestConnection(HostsBean.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityConta
iner.java:1187)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRel
ationInterceptor.java:87)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntityS
ynchronizationInterceptor.java:338)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
ke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentr
anceInterceptor.java:126)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstance
Interceptor.java:278)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
tor.java:104)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
Interceptor.java:76)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
Interceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
81)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
ryFinderInterceptor.java:138)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:527
)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalPro
xyFactory.java:430)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:65)
at $Proxy97.RequestConnection(Unknown Source)
at org.openacs.web.HostsBean$ConnectionRequestWorker.run(HostsBean.java:
162)
12:43:48,854 INFO [STDOUT] Conreq exception javax.ejb.EJBException:Unexpected E
rror
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.commons.httpclient.HttpClient.(HttpClient.java:66)
at org.openacs.HostsBean.RequestConnectionHttp(HostsBean.java:251)
at org.openacs.HostsBean.RequestConnection(HostsBean.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityConta
iner.java:1187)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRel
ationInterceptor.java:87)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntityS
ynchronizationInterceptor.java:338)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
ke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentr
anceInterceptor.java:126)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstance
Interceptor.java:278)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
tor.java:104)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
Interceptor.java:76)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
Interceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
81)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
ryFinderInterceptor.java:138)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:527
)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalPro
xyFactory.java:430)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:65)
at $Proxy97.RequestConnection(Unknown Source)
can someone help me to solve this problem please…………..
hi sir,
I am working on a project in IBM WorkLight, Following Error occured Plz Help me
com.worklight.studio.plugin.classpath.server container(unbounded)
add following jars
1. commons-logging 1.x
2.log4j 1.x
Thanks alot. Its really helpful
Thanks…