Tag Library Error
I am using Jdeveloper and BEA Weblogic 8.1 application server environment.
I have custom tag and tld file for the tag. When I try to compile it , I am getting this error which just points to the begininng of the jsp file which uses the tag.
Error: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
I've tried searching online and found that it may be caused by the the wrong jar reference in classpath. I've tried adding whole bunch of different versions of servlet.jar to my classpath in the project properties but I am still getting the same error.
Please advice
Mikhail
Weblogic 8.1 is a J2EE1.3 server correct?
It currently supports Servlet2.3/JSP1.2
The method it is trying to call there was added with JSP2.0.
You should have no servlet.jar files in your web-inf/lib directory of any web apps. It should be supplied by the container automatically (I think in weblogic.jar)
Try including weblogic.jar instead of servlet.jar
I've tried putting weblogic.jar into the web-inf/lib folder and also added library reference in the project properties but that did not fixed it.
I still receive this error in all jsp files where I have a tag:
Error: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
Here's the content of my simple tld file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<!-- a tag library descriptor -->
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.1</jsp-version>
<short-name>Bima Tags</short-name>
<description>Application tag library for the BIMA Application</description>
<tag>
<name>navbar</name>
<tag-class>com.arrownacp.bima.tags.NavBarTag</tag-class>
<body-content>empty</body-content>
<description>Display the Navigation Bar</description>
<attribute>
<name>pageName</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
</tag>
</taglib>
This is how I refer to it in my jsp file:
<%@ taglib uri="WEB-INF/BimaTags.tld" prefix="es" %>
and in the page body:
<es:navbar pageName="addUser" />
Need an urgent help, thanks
Mikhail
You should not have any weblogic.jar or servlet-api.jar files in WEB-INF/lib. They are provided by the server, not the web application.
(ie they should be in something like /server/lib already)
The method you mentioned only exists in JSP2.0
Code generated by Weblogic should never attempt to call it.
Make sure you compile your taglib with the appropriate libraries for the runtime environment.
I've deleted any servlet related api from the web-info folder but it did not help.
Here's what's really strange.
If I build the project using ant build script and run it in the browser referencing the war file in bea , it works fine.
If I try to compile it in Jdeveloper, it generates those error messages.
I'd like to be able to make it to work in Jdeveloper because I love the debug feature of the the IDE.
Please help
Mikhail
Ok, thats a step in the right direction.
Check what libraries are imported into the project (project properties)
Are they different from the ones used by the ant script?
Also is JDeveloper running the server directly? What server is it using?
How is it configured? Unfortunately I can't claim much knowledge of JDeveloper