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:\Softwa re\java\co llections. jar;c:\Ine tPub\wwwro ot\lib\rug Pdf020.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.NoClassDefFoundE rror: be/ac/rug/text/pdf/PdfMedi aBox at com.sun.server.security.Se rvletSecur ity11x.inS ervlet(Com piled Code)); ... plz help me
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:\Softwa
When I add an extra jar file containing the java.util.arraylist in the classpath; i get some other strange errors (like java.lang.NoClassDefFoundE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or you can download Collections package for 1.1 from www.javasoft.com
ASKER
Edited text of question.
ASKER
Adjusted points to 200
ASKER
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.
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.
ASKER
Edited text of question.
ASKER
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.
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.