File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Failed to load or instantiate TagLibraryValidator

 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to create a sample web application using JSTL. I'm using Tomcat 5.5, J2EE 1.4.

On running the app, I'm getting the exception


I copied both jstl.jar and standard.jar into WEB-INF/lib folder and all tlds to WEB-INF folder. In fact org.apache.taglibs.standard.tlv.JstlCoreTLV is present in the lib folder.

In one of the FAQS for JSP, it is told that keeping jstl.jar and standard.jar in classpath does not make any difference.

Please let me know, what could be the reason for the exception inspite of the availability of the class. Do I need to make any entry in web.xml?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Schandha Ravi:
and all tlds to WEB-INF folder
What tlds? You shouldn't need to copy any tlds anywhere. Where did you get these tld files?

In one of the FAQS for JSP, it is told that keeping jstl.jar and standard.jar in classpath does not make any difference.
That is correct. The container ignores the system classpath. That's why you place the jar files in WEB-INF/lib.

Do I need to make any entry in web.xml?
No.

What URIs are you using? Is your web.xml correctly declared for servlets 2.4?
[ March 10, 2008: Message edited by: Bear Bibeault ]
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

I downloaded a jar from Jstl Download and copied the tlds into WEB-INF folder.

I'm using the uri

in my jsp code. and my web.xml is based on following schema
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and copied the tlds


Again, what TLDs? There should be no TLDs copied.
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

this time I removed all tlds , just copied the jstl.jar and standard.jar in to WEB-INF/lib folder. But still I'm getting the exception

 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can some one please clarify me on this exception.

Thanks
Ravi
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that you grabbed the JSTL 1.1 jar files?
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

I downloaded jakarta-taglibs-standard-1.1.2 from the JSP FAQS link provided in javaranch, and copied jstl.jar and standard.jar into lib folder of WEB-INF. I have also included these jar files classpath. But no use
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you restarted the container ?
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I did.

Let me put my code below, so that it would be easy for you to let me know where am I making mistake

My Servlet


My Results.jsp


web.xml


apart from these, I'm using tomcat 5.5 and copied jstl.jar, standard.jar into WEB-INF/lib folder

and my url is http://localhost:8080/ExampleWeb/*.do
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is working now.

I redesigned my application. This time as bear suggested, I just copied the jstl.jar and standard.jar into WEB-INF/lib folder and neither added any tlds nor added any taglib in my web.xml. It worked fine for me. Not sure what went wrong previously..

Thanks for all the information shared
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank goodness! I was running out of ideas!
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Not sure if my question is related to struts or general JSP. In this post, I understood that we neither need to copy any tlds nor editing web.xml to include taglib element is needed. However when we use struts framework, in many books I referred they copied the tlds to WEB-INF folder and also added taglib element in web.xml.

My first question is, for struts framework, do we need to copy tlds as this is separate from JSP specification.
Secondly, my web.xml is based on web-app_2_4.xsd, in which taglib element is not allowed. But all the examples I referred as based on previous versions, where in taglib is allowed. So how do I accomplish my task with web.xml based on 2.4 xsd. How do I map say


to the actual location of tld for struts-logic.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Schandha Ravi:
in many books I referred they copied the tlds to WEB-INF folder and also added taglib element in web.xml.
This is only necessary if the TLD does not contain a proper URI declaration.

My first question is, for struts framework, do we need to copy tlds as this is separate from JSP specification.
It has nothing to do with whether the taglibs are "official JSP" or not, but rather with how the TLD is constructed.

What you have to do for Struts is a better question for the Struts forum. I won't use it.
[ March 18, 2008: Message edited by: Bear Bibeault ]
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear.

I shall go through struts forum.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic