Skip to main content
Participant
December 22, 2006
Answered

NoClassDefFoundError though the jar is in classpath

  • December 22, 2006
  • 1 reply
  • 568 views
One of my java classes uses a class that's present in oc4j.jar. The jar file is present in the classpath for sure. But whenever I access the class file, a NoClassDefFoundError is thrown. Any pointers on what I could do to debug/fix the issue would be great. Am using ColdFusion MX 6.1.

FWIW, The stack trace is as below:
    This topic has been closed for replies.
    Correct answer calvinkrishy
    I have solved this problem though the solution is definately weird. All I did was

    1. Copy the jar file to different folder in the class path and restart the CF server
    2. The application started working fine. Stop the CF server.
    3. Copy the jar file back to the original location, restart the CF server.
    4. Application still working fine!

    So essentially the jar is still in the same location as before and things have started working again mysteriously!

    1 reply

    December 22, 2006
    This looks like a classpath issue based on the error. Where is the jar that is in your classplath - cfusionmx\lib or somewhere else? Is it under WEB-INF? Have you rebooted since adding the jar? Is your FilePostParser actually in package com.evermind.io and is the 'path' in your in the jar actually /com/evermind/io? Are there multiple FilePostParser classes in different jars?
    Participant
    December 23, 2006
    Thanks for the assistance...

    quote:

    Where is the jar that is in your classplath - cfusionmx\lib or somewhere else? Is it under WEB-INF?

    The jar file is in different directory but that directory has been added to the classpath and in the 'Settings Summary'
    page I can the jar file being listed - as expected.

    quote:

    Have you rebooted since adding the jar? Is your FilePostParser actually in package com.evermind.io and is the 'path' in your in the jar actually /com/evermind/io?

    yes I have rebooted the server and the directory structure is as mentioned - com/evermind/io/.

    quote:

    Are there multiple FilePostParser classes in different jars?

    Though am fairly certain that this class is present in only one jar (oc4j.jar) am not sure how I can ascertain that! Any clues
    on figuring that?
    calvinkrishyAuthorCorrect answer
    Participant
    December 29, 2006
    I have solved this problem though the solution is definately weird. All I did was

    1. Copy the jar file to different folder in the class path and restart the CF server
    2. The application started working fine. Stop the CF server.
    3. Copy the jar file back to the original location, restart the CF server.
    4. Application still working fine!

    So essentially the jar is still in the same location as before and things have started working again mysteriously!