views:

137

answers:

2

I have built a Java Web Application and packed it in a .war file and tested it on my local tomcat server and it is running fine.

But when I deployed it on my client's server, it is showing an error. According to the remote server (my client's server), it is not finding a tld file packed in a jar file which I had placed in WEB-INF/lib directory. But when I checked the WEB-INF/lib directory for the jar file, i found that it was there.

The contents of META-INF/MANIFEST.MF is as follows:

Manifest-Version: 1.0
Class-Path:

I think that there is no need to explicitly mention the classpath of WEB-INF/lib directory as it is in the classpath of any web application by default.

Then, why the server can't find the jar file in the lib directory when I deployed it on a remote server and why it is working when I deployed the same application on my local server.

I posted a question for this at http://stackoverflow.com/questions/2441254/struts-1-struts-taglib-jar-is-not-being-found-by-my-web-application but found that the problem is unusual as nobody could answer it.

So my questions are as follows:

Q1. Is WEB-INF/lib still remains on the classpath if I leave the classpath entry blank as shown above in the MANIFEST.MF file or I should delete the classpath entry completely from the file or I should explicitly enter Class-Path: /WEB-INF/lib as the classpath entry?

Q2. I have JSP pages, Servlets and some helper classes in the web application. Jsp pages are located at the root. Servlets and helper classes are located in WEB-INF/classes folder. So Is there any problem if my helper classes are located in the WEB-INF/classes folder?

Note: Please note that this question is not same as my previous question. It is a follow-up question of my previous question.

Both the servers (local and remote) are tomcat servers.

+1  A: 

Do not create an empty Class-Path entry in the manifest, just remove it! Normally you do not need any Class-Path entry in a webapp. This entry is more usual for runnable jars.

There is no problem with you helper classes. WEB-INF/classes is always the first entry of the classpath followed by the jars of WEB-INF/lib. So JSPs compiled by the container should have no prblem using classes included there.

Do you have included your taglib in the web.xml with an appropiate taglib-location?

Arne Burmeister
All of this is correct. I'll add that I believe .tld files belong in WEB-INF, not WEB-INF/lib.
Sean Owen
A: 

This can happen especially in production if the taglib-location points to an internet location (ie, with http) and the production boxes may not be able to access the internet (due to many firewall restrictions)

Calm Storm
Calm Storm
the url value of uri attribute doesn't mean that the server has to access internet to find the tld file. Tld files have their own uri that needs to match with the uri of taglib directive to be included
Yatendra Goel