Failed to load or instantiate TagExtraInfo class

C

Christine Mayer

I am using struts-1.3.8 tiles together with Spring, now I wanted to
implement my own custom tag. Following a book example, I wrote a
TagHandler that extends "SimpleTagSupport". Eclipse told me I needed
to import the jsp-api.2.0.jar from tomcat, so I did.

However, this always results in the error:

org.apache.jasper.JasperException: /WEB-INF/jsp/myjsp.jsp(1,1) Unable
to read TLD "META-INF/tld/struts-tiles.tld" from JAR file
"file:myFileLocation": org.apache.jasper.JasperException: Failed to
load or instantiate TagExtraInfo class:
org.apache.struts.tiles.taglib.UseAttributeTei

I did some research on the web, there it's said not to include the jsp-
api.2.0.jar (but not why not to), and yes, this solves the problem -
but how can I implement my Tag handler without using this jar file?
Eclipse doesn't find the required classes otherwise...

Thanks in advance,

Christine
 
O

Owen Jacobson

I am using struts-1.3.8 tiles together with Spring, now I wanted to
implement my own custom tag. Following a book example, I wrote a
TagHandler that extends "SimpleTagSupport". Eclipse told me I needed
to import the jsp-api.2.0.jar from tomcat, so I did.

However, this always results in the error:

org.apache.jasper.JasperException: /WEB-INF/jsp/myjsp.jsp(1,1) Unable
to read TLD "META-INF/tld/struts-tiles.tld" from JAR file
"file:myFileLocation": org.apache.jasper.JasperException: Failed to
load or instantiate TagExtraInfo class:
org.apache.struts.tiles.taglib.UseAttributeTei

I did some research on the web, there it's said not to include the jsp-
api.2.0.jar (but not why not to), and yes, this solves the problem -
but how can I implement my Tag handler without using this jar file?
Eclipse doesn't find the required classes otherwise...

There are actually two classpaths relevant to a program, not one.

To compile your taglib, you do need to have jsp-api.2.0.jar on the
compiler classpath. However, you must not package that JAR with your
application; Tomcat makes it part of the run-time classpath for you.
 
C

Christine Mayer

I use Maven 1.x for deploying my application. When I add jsp-api.
2.0.jar to my Eclipse classPath, but don't add jsp-api.2.0.jar to the
projects project.xml as a dependency, Maven throws this exception:

java:compile:
[echo] Compiling to C:\myFolder/classes
[javac] Compiling 61 source files to C:\myFolder\classes
C:\myFoldert\otherFolder\MyClass.java:8: package
javax.servlet.jsp.tagext does not exist
import javax.servlet.jsp.tagext.SimpleTagSupport;

SimpleTagSupport requires jsp-api.2.0.jar.

However, when I add jsp-api.2.0.jar as a Maven dependency, compiling
and deploying works, but then Tomcat throws the error
org.apache.jasper.JasperException: /WEB-INF/jsp/myjsp.jsp(1,1) Unable
to read TLD "META-INF/tld/struts-tiles.tld" from JAR file
"file:myFileLocation": org.apache.jasper.JasperException: Failed to
load or instantiate TagExtraInfo class:
org.apache.struts.tiles.taglib.UseAttributeTei

As described above...

What can I do???


Thanks in advance,

Christine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top