facebook

Jar is there but java.lang.NoClassDefFoundError [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #212585 Reply

    Ok…this might need to be moved to the Random folder, but the bug arose after I added hibernate to my project.

    I’ve created an xml editor, automatically off a schema, and it was working. With no code change, it no longer works. Instead I get an error

    java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder

    Now, jdom is in the project, and it compiles fine. I’m suspecting that something got hosed with the libraries when I added hibernate and it’s 100 jar’s 🙂

    Lee

    #212589 Reply

    Riyad Kalla
    Member

    Lee,
    Its possible that Hibernate added a conflicting JAR… where was that class comming from (which JAR) before you added Hibernate support?

    #212592 Reply

    @support-rkalla wrote:

    Lee,
    Its possible that Hibernate added a conflicting JAR… where was that class comming from (which JAR) before you added Hibernate support?

    jdom.jar

    Lee

    #212594 Reply

    Riyad Kalla
    Member

    Can you navigate to your Java Build Path and remove jdom.jar, try and rebuild, then go and add it back and try and rebuild again?

    #212614 Reply

    @support-rkalla wrote:

    Can you navigate to your Java Build Path and remove jdom.jar, try and rebuild, then go and add it back and try and rebuild again?

    Ok…I did the following (to no avial)

    1. Opened project properties
    2. Removed jdom.jar
    3. Did a Clean build
    4. Stopped tomcat
    5. Started tomcat
    6. Ran app, saw same error (as would be expected)

    Then I reran steps 1-6 only adding jdom.jar instead of removing….got same error.

    Lee

    #212783 Reply

    Update — problem solved.

    After much travail I solved the problem by copying the jdom.jar directly into my tomcat\webapps\appname\web-info\lib directory.

    Lee

    #212785 Reply

    Riyad Kalla
    Member

    Lee,
    Was this *always* a Tomcat exception? I was under the impression it was an error you were getting during compile time that the file could not be found.

    It seems now that this was a deployment problem on the Tomcat side? Was jdom.jar an externally linked resource for this project?

    #212851 Reply

    @support-rkalla wrote:

    Lee,
    Was this *always* a Tomcat exception?

    Yes…the program compiled successfully…there was never any complaint of the missing jar during development.

    @support-rkalla wrote:

    It seems now that this was a deployment problem on the Tomcat side? Was jdom.jar an externally linked resource for this project?

    Yes, it was externally linked….is that the wrong thing to do? The wierd thing to me was that it had been working, even in the deployed environment, and then stopped working.

    The only think I could think of that chanted was adding hibernate. I’m not SURE that’s the culprit as I didn’t discover the problem until many days later.

    Another wierdness…I built my jdom.jar from beta 10 with ant…compiled fine. When I try to “java samplecode” the samples…I received the same error I was receiving under tomcat for my previously working code.

    Lee

    #212856 Reply

    Riyad Kalla
    Member

    Yes, it was externally linked….is that the wrong thing to do?

    No that is totally fine, we just had a bug where externally linked resources weren’t getting deployed, which would explain whats going on. The fix will be out very soon (any day now, maybe today).

    #212870 Reply

    @support-rkalla wrote:

    No that is totally fine, we just had a bug where externally linked resources weren’t getting deployed, which would explain whats going on. The fix will be out very soon (any day now, maybe today).

    Interesting. I kept thinking that “hibernate” was my “thing that changed” — but come to think of it, I upgraded to the latest MyEclipse to get that hibernate functionality.

    Lee

    #213004 Reply

    Scott Anderson
    Participant

    The issue mentioned in this thread was addressed in MyEclipse 3.8.1

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: Jar is there but java.lang.NoClassDefFoundError [Closed]

You must be logged in to post in the forum log in