Reginald Braithwaite-Lee wrote:
> Hello!
>
> I am trying to build a servlet bean which uses classes in a package.
> The simplest example would be a one class servlet derived from
> HttpServlet, but which is in my own package (com.yell-it-out.servlets).
>
> e.g. the servlet itself is class com.yell-it-out.servlets.MyServlet.
>
> When I build a .jar file and drop the .jar in the servletbeans
> subdirectory, I cannot install the bean using the administration tool:
> JWS complains that it cannot find the class in the .jar.
>
I don't know anything about JWS in particular, but are you building your
JAR file correctly? Inside the JAR, you have to reflect the same directory
structure (matching the package structure) that would be there if the classes
were not packed into a JAR file.
For example, let's say your unpacked class hierarchy looks like this (using
Unix style paths, but the principles are the same for Windows):
/home/reg/ (Your home directory)
com/
yell-it-out/
servlets/
MyServlet.class
If you were using this structure unpacked, you'd have your home directory
("/home/reg") on your class path. To correctly build a JAR containing only
this servlet, you need to do this:
cd /home/reg
jar cvf MyJar.jar com/yell-it-out/servlets/MyServlet.class
This way, the package structure is still reflected inside the JAR file, and
your class can be found.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html