Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Applet "archive" attribute giving NoClassDefFoundError

Thread view: 
andrew@andrewsears.com - 12 Jan 2006 02:11 GMT
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
Roedy Green - 12 Jan 2006 02:52 GMT
>   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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Thomas Hawtin - 12 Jan 2006 15:15 GMT
>    "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
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Roedy Green - 12 Jan 2006 22:57 GMT
On Thu, 12 Jan 2006 15:28:45 +0000, Thomas Hawtin
<usenet@tackline.plus.com> 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
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.