tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: CLASSPATH, .jar files, packages, and so forth
Date Thu, 01 Nov 2007 17:13:19 GMT
Hash: SHA1


Mann, Ivan H wrote:
> Not being able to find the class may mean that it can't find the jar
> file and it may mean that it can find the jar file but the package and
> or directory is not done right.


> The applet specified here appears in the web browser just fine.

> <applet codebase="." code="applet/DDSMenu.class"
>                   archive="schedule.jar"
> 		      width=600
>                     height=300>
> </applet>

Okay: that means that the JAR file itself is being loaded properly
(unless you happen to have class files laying around in the webapp's
deployment directory, outside of WEB-INF: make sure you aren't doing
that; I'm pretty sure that archive="...." indicates that all code should
come from the specified JAR and classes will not be requested from the
server directly).

> The
> applet tries to access the BuildSchedule class in response to a menu
> item and the exception is not thrown until then.
> java.lang.NoClassDefFoundError: applet/schedule/BuildSchedule

What do you get when you run:

$ unzip -v webapps/schedule.jar

> The jar file is located in .../webapps/schedule.jar, which is where the
> applet directory in the cod parameter is.

Unless you have written this incorrectly, scheduler.jar shouldn't be in
"webapps/scheduler.jar"... it should be in
webapps/[yourappname]/scheduler.jar. And your applet tag should look
like this:

<applet archive="<%= request.getContextPath() %>/scheduler.jar"

...since your JAR file is in the web root. If you relocate the page, you
want your URLs to work properly. Fully-qualified URLs always work better.

- -chris
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message