Hi, I am using eclipse 3.2 to add the external jars which i have in c:/libfolder/*.jar my project builds perfectly but at runtime i am getting Classnotfounderror . I am running my project using tomcat 5.5 can any one say where am i going wrong.
I didnt get it you.. I am not getting the ClassNotFound error when i put the jar in my projects web-inf lib or tomcats shared lib.. I get it only when i add a jar which is out my project or out of the tomcat container.. Is there is any thing which i have to do to make use of a jar which is outside the project or tomcats's lib.. is there is any security issue.. I get a similar kind of problem when i give path of a html page which is in c:/common/html/some.html as the href for a anchor tag in my jsp page which is in my project. while clicking on the Link i didnt get a page not found and also no action takes place the page stays still.. what could be the issue [ February 08, 2007: Message edited by: prem shakthi ]
prem I am not getting your probelm exactly. However let me clear out that "NoClassDefFound" error occurs only when the perticular class file needed is not present in the classpath. Normally the web-servers & app-servers ignores the system environment varaibles. So make sure that the Tomcat is getting the class files ( jar file) at runtime. If you put the jar file in web-inf, it will be automatically get copied in the war file, so in such case there will not be any problem.
Joined: Nov 07, 2006
i have a sample.jar which is in c:/common/sample.jar . i have included it in my class path.. but at runtime its not available..
the second issue is that i could access my local files from my Jsp. eg: assuming c:/common/ has a file sample.html and in my jsp file i give the the href value as c:/common/sample.html(<a href="c:/common/sample.html">show</a>) when i click on the Hyper link nothing happens why
Author and all-around good cowpoke
Joined: Mar 22, 2000
i have included it in my class path.. but at runtime its not available.
Guess I will have to repeat myself.
1. Tomcat IGNORES your system classpath 2. Tomcat has its own convention for finding jar and class files. You MUST locate the sample.jar where the Tomcat convention calls for.
With regard to your second problem - the servlet API very strictly regulates where a servlet is allowed to look to serve a resource such as your sample.html. Just think about it - if a servlet was allowed to return any resource from anywhere in your file system it would be a huge security hole.
Joined: Nov 07, 2006
i got the first open thanks.. regarding the second one,from your reply i understand that its the security provided but is there is any way by which i can access the html pages outside my project by giving some permission..