java.lang.NoClassDefFoundError

Discussion in 'Java' started by g-factor, Mar 30, 2007.

  1. g-factor

    g-factor Guest

    Hi everybody,

    I am developing a web application in JSF, usign application server 9.0
    update 1.
    It works fine till I add 2 libraries, 2 .jar files in the project
    properties.
    I go on properties of the project Add JAR/Folder, and I add these
    2 .jar files:

    1) tomahawk-1.1.3.jar
    2) tomahawk-sandbox-1.1.5-SNAPSHOT.jar

    Then I build my application, it works fine, then I deploy it on the
    server and as I launch it it gives me this error

    HTTP Status 404 -
    description The requested resource () is not available.

    When I go in the log file of the server this is the error message I
    get:

    Log Entry Detail

    Details
    Timestamp:

    Mar 30, 2007 13:47:50.609
    Log Level:

    SEVERE
    Logger:

    javax.enterprise.system.container.web
    Name-Value Pairs:

    _ThreadID=41;_ThreadName=Thread-88;_RequestID=4eb5ac27-
    f59b-44d8-8433-2fa2a19bc1c6;
    Record Number:

    1701
    Message ID:

    WebModule[/PMA]Exception sending context initialized event to listener
    instance of class com.sun.faces.config.ConfigureListener
    java.lang.NoClassDefFoundError
    Complete Message

    org/apache/commons/logging/LogFactory
    at
    org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.<clinit>(ExtensionsPhaseListener.java:
    45)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
    39)
    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
    27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355-
    -
    -
    -
    -
    -
    -

    then it keeps going.

    Anybody has an idea why when I add the two libraries at the project I
    get this error message?
    If I remove them it works fine...but I need them...

    Anybody has ideas?

    Thanks.

    Gabriele
     
    g-factor, Mar 30, 2007
    #1
    1. Advertising

  2. On Mar 30, 11:11 pm, "g-factor" <> wrote:
    ...
    > I am developing a web application ..

    ....
    > It works fine till I add 2 libraries, 2 .jar files ..


    Archives might go in WEB-INF/lib.

    Andrew T.
     
    Andrew Thompson, Mar 30, 2007
    #2
    1. Advertising

  3. g-factor

    g-factor Guest

    Hi Andrew,

    thanks for your reply, I really appreciate it :)
    Actually when I deploy the application in the server the "lib" folder
    exists inside the WEB-INF folder, and both the .jar files are
    there.....so I don't really know why I still get the message :"The
    requested resource () is not available. ".

    I saw around the net that somebody suggested to add the .jar files
    also in some other lib folder of the server. But since I am using
    application server 9.0 I really don't know what other folder to copy
    them into.

    Any other suggestion?
     
    g-factor, Mar 30, 2007
    #3
  4. g-factor

    Leion Guest

    Hi Gabriele
    I don't know much about JSF or tomahawk, but whenever I see a
    java.lang.NoClassDefFoundError I first check that I'm compiling and
    running my code with the same version of java.

    /Henrik
     
    Leion, Mar 30, 2007
    #4
  5. g-factor

    g-factor Guest

    Hi Henrik,

    locally I have J2SE 5.0 Update 10, on the server I have J2SE 5.0
    Update 10 and Update 11.

    Could this be an issue?
     
    g-factor, Mar 30, 2007
    #5
  6. On Mar 31, 12:27 am, "g-factor" <> wrote:
    ...
    > Any other suggestion?


    Refresh the server. This might be done by
    stopping and restarting it, but Tomcat* can
    be refreshed while still running.

    * The only server I have any experience with.

    Andrew T.
     
    Andrew Thompson, Mar 30, 2007
    #6
  7. g-factor

    g-factor Guest

    On Mar 30, 5:06 pm, "Andrew Thompson" <> wrote:
    > On Mar 31, 12:27 am, "g-factor" <> wrote:
    > ..
    >
    > > Any other suggestion?

    >
    > Refresh the server. This might be done by
    > stopping and restarting it, but Tomcat* can
    > be refreshed while still running.
    >
    > * The only server I have any experience with.
    >
    > Andrew T.


    Do you mean the application server or the physical server itself?

    Because the app. server i've already restarted it several times...but
    still it has problems with these libraries that I import.

    If I run the web app without importing these 2 libraries it works
    fine..
     
    g-factor, Mar 30, 2007
    #7
  8. Re: java.lang.NoClassDefFoundError in web-app

    On Mar 31, 1:15 am, "g-factor" <> wrote:
    > On Mar 30, 5:06 pm, "Andrew Thompson" <> wrote:
    >
    > > On Mar 31, 12:27 am, "g-factor" <> wrote:
    > > ..

    >
    > > > Any other suggestion?

    >
    > > Refresh the server. This might be done by
    > > stopping and restarting it, but Tomcat* can
    > > be refreshed while still running.

    ....
    > Do you mean the application server or the physical server itself?


    Pfft.. dunno. What's the difference?

    As an aside, I noticed when first replying,
    that the 'subject' of this post might better
    have been listed as I changed it above.

    The NCDFE is a common problem for people just
    starting in Java, and the web-app. gurus generally
    leave those questions for a small group of people
    who enjoy helping noobs. Perhaps one of them will
    notice this subject, and be able to advise further.

    Andrew T.
     
    Andrew Thompson, Mar 31, 2007
    #8
  9. g-factor

    Rts Guest

    I have the same problem with tomahawk-1.1.5.jar

    Did not found solution yet :(
     
    Rts, Apr 26, 2007
    #9
  10. Hi!

    Thus spake g-factor on 03/30/2007 03:11 PM:
    > WebModule[/PMA]Exception sending context initialized event to listener
    > instance of class com.sun.faces.config.ConfigureListener
    > java.lang.NoClassDefFoundError


    Hmm... there seems to be a ServletContextListener defined in your
    web.xml...? The error seems to pop up in that listeners
    contextInitialized() method...
    Could we see the web.xml and perhaps the Listener code...?

    Regards,

    Phil
     
    Philipp Taprogge, Apr 27, 2007
    #10
  11. g-factor

    Guillermode

    Joined:
    Aug 10, 2007
    Messages:
    1
    the problem, my solution

    I have that problem when I add tomahawk jar to the classpath

    classnotfound
    org/apache/commons/logging/LogFactory

    I solve it adding common-loggins.jar to the classpath
    :deal: :deal:
     
    Guillermode, Aug 10, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page