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 Fri, 02 Nov 2007 18:39:27 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ivan,

(Not sure if this ever got sent; I found it in my drafts folder today)

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

> 
> The jar file is built from the same directory using this command:
> 	
> 	jar cvf schedule.jar applet/schedule/*.class
> 
> The message is 
> 
> 	Exception in thread "AWT-EventQueue-7"
> java.lang.NoClassDefFoundError: applet/schedule/BuildSchedule
> 	<stack trace>
> 
> 
> Ivan Mann
> 
> ---------------------------------------------------------------------
> 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
> 



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHK27f9CaO5/Lv0PARAmTxAJsFa2+UCgzSSq7RJJh/g+Pn1F3eMgCgnzaH
QiN82KmRMStbEIWP2TION7Y=
=FZWB
-----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