tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: CLASSPATH, .jar files, packages, and so forth
Date Thu, 01 Nov 2007 17:17:41 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ivan,

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.

Probably.

> 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKgkv9CaO5/Lv0PARAhz8AKCDi6WbYGHmWSMOwexrqivaOybKtgCgjtul
LjWnGhknf160oyRsjh8G4X4=
=LMdJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message