aspose file tools*
The moose likes JSP and the fly likes Changes in Taglibs when tomcat is migrated from 3.22 to 4.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Changes in Taglibs when tomcat is migrated from 3.22 to 4.1" Watch "Changes in Taglibs when tomcat is migrated from 3.22 to 4.1" New topic
Author

Changes in Taglibs when tomcat is migrated from 3.22 to 4.1

Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Hi ,
iam running a web application running on tomcat3.22 with jdk1.3.1. This has some custom taglibs too..
i migrated it to tomcat4.1 with jdk 1.4.

i am facing errors which seems to be b/c of the custom tags.

Are there any changes that need to be done in Taglibs,when tomcat is migrated from 3.22 to tomcat4.1 ?

i compared the web.xml used by tomcat4.1 and also the api for taglibs supported by tomcat4.1 . i didnt see any major changes or may be i missed out something .

Could any one pls respond?

Thanks,
Rajendar
Kunaal A Trehan
Ranch Hand

Joined: Feb 04, 2004
Posts: 63
Hi

I donot feel that because of taglib u re facing problem
Can u put the error that u re getting and the web.xml

Rgds
Kunal
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Kunal,
looking at the error, i too dont think its taglib problem . but some how i think its related to it.

the error is ArrayIndexOutOfBoundsException only.exception looks as follows

java.lang.ArrayIndexOutOfBoundsException: 10 >= 10
at java.util.Vector.elementAt(Vector.java:432)
at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:622)
at com.db.ta.services.taglib.table.CellTag.setVariables(CellTag.java:47)
at com.db.ta.services.taglib.table.CellTag.doStartTag(CellTag.java:37)
at org.apache.jsp.ETListContent_jsp._jspService(ETListContent_jsp.java:238)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
101781 [http-8080-Processor5] ERROR D1D1EC9BA674705C421C0C95681041F4 - ErrorToUser:
java.lang.ArrayIndexOutOfBoundsException: 10 >= 10
at java.util.Vector.elementAt(Vector.java:432)
at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:622)
at com.db.ta.services.taglib.table.CellTag.setVariables(CellTag.java:47)
at com.db.ta.services.taglib.table.CellTag.doStartTag(CellTag.java:37)
at org.apache.jsp.ETListContent_jsp._jspService(ETListContent_jsp.java:238)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)



<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Giselle Larcombe (Deutsche Bank) -->
<!--XML file for NT-Integration-->
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<display-name>
Display
</display-name>
<description>
some desc
</description>
<!-- Servlet to activate Log4J -->
<servlet>
<servlet-name>com.db.ta.services.log.log4JInit</servlet-name>
<servlet-class>com.db.ta.services.log.Log4JInit</servlet-class>
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>WEB-INF/classes/log4j.lcf</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Servlet to activate Status Handler -->
<servlet>
<servlet-name>some servlet</servlet-name>
<servlet-class>some servlet class</servlet-class>
<init-param>
<param-name>status-file</param-name>
<param-value>WEB-INF/data/StatusDescription.csv</param-value>
</init-param>
<init-param>
<param-name>action-file</param-name>
<param-value>WEB-INF/data/Action.csv</param-value>
</init-param>
<init-param>
<param-name>permission-file</param-name>
<param-value>WEB-INF/data/Permissions.csv</param-value>
</init-param>
<init-param>
<param-name>with-database</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>active</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>6</load-on-startup>
</servlet>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>properties/ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>
public/jsp/index.jsp
</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>
xsl.tld
</taglib-uri>
<taglib-location>
/WEB-INF/tlds/xsl.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
log-taglib.tld
</taglib-uri>
<taglib-location>
/WEB-INF/tlds/log-taglib.tld
</taglib-location>
</taglib>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/tlds/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/tlds/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/tlds/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
</taglib>
</web-app>





Thanks
Rajendar
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
I am currently testing the above thing on JDK1.5 with Tomcat4.1.31 .
Do i need to have the JSTL1.1?tomcat4.1.31 comes along with JSTL i guess!

iam invoking the custom tag libraries as usual and its running fine for few records and then i get the above error..

<%@ taglib uri="xsl.tld" prefix="views" %>

and the code

<views:jspTable model="<%=ETList.getSelectedListView().getModel() %>" >
<views:headingOpen><tr></views:headingOpen>
<views:headingCell>
<% if(column.intValue()==0){%>
<%="<th class=\"tblHide\" height=\"1\" valign=\"top\"> </th>"%>
<% }else{%>
<%="<th class=\"tblHide\" height=\"1\" valign=\"top\">" + heading + "</th>"%><% } %>
</views:headingCell>
<!-- end: the header -->
<!-- begin: the rows -->
<views:rows>
<views:rowOpen><tr></views:rowOpen>
<views:cell>
some logic...
</views:cell>
</views:rows>
<!-- end: the rows -->
</views:jspTable>

i guess theres no problem with the above tags.. why its throwing above exception is not understandable ..

can any one check it out pls?


Thanks,
Raj
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Hi ,
i narrowed down the code and observed that the error is coming from the
cellTag .
here is the code used by CellTag

public CellTag()
{
sbOut = new StringBuffer();
}

public int doStartTag()
throws JspException
{
parent = (RowsTag)TagSupport.findAncestorWithClass(this, some.class);
if(parent == null)
{
throw new JspTagException("CellTag must be enclosed in a RowsTag");
} else
{
sbOut.append(parent.getRowOpen());
setVariables();
return 2;
}
}

private void setVariables()
{
Object valObj = null;
if (parent!=null){
valObj = parent.getModel().getValueAt(parent.getRow(), col);
}
if(valObj == null)
valObj = "NULL";
pageContext.setAttribute("value", valObj);
pageContext.setAttribute("column", new Integer(col));
}

public int doAfterBody()
throws JspException
{
if(bodyContent != null)
{
String bodyTag = bodyContent.getString();
sbOut.append(bodyTag);
bodyContent.clearBody();
if(++col < parent.getModel().getColumnCount())
{
setVariables();
return 2;
} else
{
sbOut.append(parent.getRowClose());
return 0;
}
}
else
return SKIP_BODY;
}

public int doEndTag()
throws JspException
{
try
{
if(bodyContent != null)
bodyContent.getEnclosingWriter().write(sbOut.toString());
}
catch(IOException ex)
{
throw new JspException("IO Error: " + ex.getMessage());
}
return 6;
}

private int col;
private StringBuffer sbOut;
private RowsTag parent;


iam getting the indexoutofbounds exception in the setVariables() method of doStartTag.

whats wrong with that method?

b/c as i remove the cellTag ,then iam getting the jsp page compiled and is run properly.

any help appreciated

Thanks
Raj
not able to unders
 
 
subject: Changes in Taglibs when tomcat is migrated from 3.22 to 4.1