Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException

    Hi,


    I am trying to invoke the Web service methods using HttpClient.

    So i have added the below required jar files to my project.

    commons-httpclient-3.1
    commons-codec-1.4
    commons-logging-1.1.1

    And i am using IBM RAD 7.5 as my IDE. I am getting the below exception if try to instantiate PostMethod of HttpClient.


    [3/6/12 17:53:20:749 IST] 0000002c servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet Test in application WebServiceEAR. Exception created : java.lang.NoClassDefFoundError: org.apache.commons.codec.DecoderException
    at java.lang.J9VMInternals.verifyImpl(Native Method)
    at java.lang.J9VMInternals.verify(J9VMInternals.java: 72)
    at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:134)
    at org.apache.commons.httpclient.HttpMethodBase.<init >(HttpMethodBase.java:217)
    at org.apache.commons.httpclient.methods.EntityEnclos ingMethod.<init>(EntityEnclosingMethod.java:118)
    at org.apache.commons.httpclient.methods.PostMethod.< init>(PostMethod.java:105)
    at Test.doGet(Test.java:44)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:718)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:831)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1455)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:793)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:444)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl .handleRequest(ServletWrapperImpl.java:175)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3622)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:276)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:927)
    at com.ibm.ws.webcontainer.WSWebContainer.handleReque st(WSWebContainer.java:1566)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:175)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:455)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:384)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.ready(HttpInboundLink.java:272)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.sendToDiscriminators(NewConnectionIniti alReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.complete(NewConnectionInitialReadCallba ck.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletion Actions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1527)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:419)
    at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtC lassLoader.java:150)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:6 43)
    at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtC lassLoader.java:90)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:6 09)


    Could someone please help me to resolve this?


    Thanks,
    Rajesh.B

  2. #2
    Member
    Join Date
    Feb 2012
    Posts
    58
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException

    Hi, from the stack trace you provided, the following class was not found:

    org.apache.commons.codec.DecoderException

    Check again to make sure you have a correct version of common-codec library.

  3. #3
    Junior Member
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException

    Hi,


    I have checked by adding all the versions 1.2, 1.3 and 1.4 of commons-codec jar file. But still got the same error.

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException

    Can you provide the full code and all the ingredients you are using here? You might be missing something...

Similar Threads

  1. need help with 'org.apache.commons.net.ftp.FTPClient'
    By rtumatt in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: May 22nd, 2013, 07:02 PM
  2. Uploading File to server ( Apache.commons.net)
    By quirell in forum Java Networking
    Replies: 5
    Last Post: November 11th, 2012, 11:06 PM
  3. OSGI - missing imported package=org.apache.commons.collections
    By rcbandit in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 17th, 2012, 11:36 AM
  4. Scanning large FTP directories with apache.commons.net.ftp
    By daniel_el in forum Java Theory & Questions
    Replies: 3
    Last Post: February 10th, 2012, 06:40 AM
  5. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    By i4ba1 in forum JDBC & Databases
    Replies: 2
    Last Post: August 23rd, 2011, 12:41 PM