Applet "archive" attribute giving NoClassDefFoundError

Discussion in 'Java' started by andrew@andrewsears.com, Jan 12, 2006.

  1. Guest

    Hi:

    I'm having an issue loading an applet via a webpage/browser. The HTML
    code section looks like this:
    <applet
    code="com.company.package.ThisApplet"
    codebase="http://localhost:82/bin/"
    archive="jdom.jar"
    height="400" width="300"
    >


    where in my Apache httpd.conf I have set up a VirtualHost for port 82:
    <VirtualHost *:82>
    DocumentRoot C:/webroot
    </VirtualHost>

    The Java Console spits out the following error:
    Loading CustomizerApplet
    java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
    at com.company.package.ThisApplet.init(ThisApplet.java:91)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    Line "91" in "ThisApplet.java" is the following line:
    SAXBuilder builder = new SAXBuilder();

    The file structure that is reference looks like the following:
    C:\webroot\bin\jdom.jar
    C:\webroot\bin\com\company\package\ThisApplet.class

    For some additional info, this is from Apache's error.log:
    File does not exist: C:/webroot/bin/org
    and this is from the access.log:
    "GET /bin/jdom.jar HTTP/1.1" 200
    ...
    "GET /bin/org/jdom/input/SAXBuilder.class HTTP/1.1" 404


    My assumption is that for some reason the .jar file is not being read
    as part of the classpath. Is this correct? Does anyone have any
    suggestions for this and/or have seen this before?

    Thanks a ton, Andy
     
    , Jan 12, 2006
    #1
    1. Advertising

  2. Roedy Green Guest

    On 11 Jan 2006 18:11:59 -0800, wrote, quoted or
    indirectly quoted someone who said :

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


    When did this class start getting bundled with the JRE? 1.5? What
    version is your Client Java?
    See http://mindprod.com/applets/wassup.html
    to find out.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Jan 12, 2006
    #2
    1. Advertising

  3. wrote:
    >
    > "GET /bin/jdom.jar HTTP/1.1" 200
    > ...
    > "GET /bin/org/jdom/input/SAXBuilder.class HTTP/1.1" 404


    Perhaps your server isn't configured to return the jar with the
    appropriate MIME type. You could try

    telnet localhost 82
    HEAD /bin/jdom.jar HTTP/1.0
    Host: localhost


    (Finnish with two returns.)

    It might be worth renaming the jar as jdom.zip (and also in the applet
    tag), as that is much more likely to be configured correctly.

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
     
    Thomas Hawtin, Jan 12, 2006
    #3
  4. Roedy Green Guest

    On Thu, 12 Jan 2006 15:28:45 +0000, Thomas Hawtin
    <> wrote, quoted or indirectly quoted someone
    who said :

    >Perhaps your server isn't configured to return the jar with the
    >appropriate MIME type. You could try


    you can check if it is with http://mindprod.com/applet/mimecheck.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Jan 12, 2006
    #4
    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.
Similar Threads
  1. Tor Iver Wilhelmsen

    Re: applet ignores archive

    Tor Iver Wilhelmsen, Aug 21, 2003, in forum: Java
    Replies:
    2
    Views:
    455
  2. Sajjad Lateef
    Replies:
    3
    Views:
    3,481
    frére Ane
    Jun 19, 2012
  3. Roedy Green

    <applet archive= tag

    Roedy Green, Jan 30, 2006, in forum: Java
    Replies:
    2
    Views:
    489
    Roedy Green
    Feb 2, 2006
  4. Replies:
    1
    Views:
    2,224
    Irmen de Jong
    Jun 22, 2004
  5. sixteenmillion

    The giving that keeps on giving

    sixteenmillion, Nov 19, 2007, in forum: C Programming
    Replies:
    0
    Views:
    460
    sixteenmillion
    Nov 19, 2007
Loading...

Share This Page