  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Subject: Re: CLASSPATH, .jar files, packages, and so forth | Subject: Re: CLASSPATH, .jar files, packages, and so forth 2007-11-01 - By Christopher Schultz
Back -- --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@(protected) To unsubscribe, e-mail: users-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
|
|
 |