aspose file tools*
The moose likes JSP and the fly likes Failed to load or instantiate TagLibraryValidator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Failed to load or instantiate TagLibraryValidator " Watch "Failed to load or instantiate TagLibraryValidator " New topic
Author

Failed to load or instantiate TagLibraryValidator

Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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?


Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

and copied the tlds


Again, what TLDs? There should be no TLDs copied.
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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

Joined: Oct 20, 2007
Posts: 167
Hi,

Can some one please clarify me on this exception.

Thanks
Ravi
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Are you sure that you grabbed the JSTL 1.1 jar files?
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

And you restarted the container ?


[My Blog]
All roads lead to JavaRanch
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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

Joined: Oct 20, 2007
Posts: 167
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

Thank goodness! I was running out of ideas!
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

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

Joined: Oct 20, 2007
Posts: 167
Thanks Bear.

I shall go through struts forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Failed to load or instantiate TagLibraryValidator