Link to home
Start Free TrialLog in
Avatar of tappelma
tappelma

asked on

servlet problem

I am writing a servlet that uses a package to convert text to pdf. This package uses java.util.Arraylist. When i compile the servlet with the command line everything works fine; when i publish it; i always get a classnotfoundexception : arraylist.
Now in order to find a solution, i wrote it in an application, and compiled it with the command line jdk 1.2.2 on the server and run the application. Everything worked fine then, the result was perfect. Now it did not give an arraylist error.
How can i do this in a servlet; considering everything works fine in an application, why doesn't it work in a servlet ??? The classpath must be correct because i can run the application .. or not ? Eventually they both use the same package; could it be that the classpath in the environment for doesn't work for a servlet ?
I am using Java Webserver 2.0 and JDK 1.2.2; i am using the classes found at : http://allserv.rug.ac.be/~blowagie/java-pdf/; this is my classpath : C:\servlet.jar;.;c:\Software\java\collections.jar;c:\InetPub\wwwroot\lib\rugPdf020.jar;
When I add an extra jar file containing the java.util.arraylist in the classpath; i get some other strange errors (like java.lang.NoClassDefFoundError: be/ac/rug/text/pdf/PdfMediaBox at com.sun.server.security.ServletSecurity11x.inServlet(Compiled Code)); ... plz help me
Avatar of Ravindra76
Ravindra76

Hi tappelma,

 It was the classpath problem.

 add the path of your ibm package in the sebsrver's path.

Best of luck.

PS:Mention environment webserver,jdb etc.
ASKER CERTIFIED SOLUTION
Avatar of vladi21
vladi21

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or you can download Collections package for 1.1 from www.javasoft.com
Avatar of tappelma

ASKER

Edited text of question.
Adjusted points to 200
downloading collections and adapting class_path does not work.
so what's the problem.
give us more information.

I suppose that JWS uses 1.1 JavaVM, you just have to add the collection classes to its classpath - or don't use them at all.
Edited text of question.
Thx a lot dude; i installed JRun and everything works fine nog; so i guess java web server is not jdk 1.2.2 compliant.