File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes taglibs Working in tomcat3.22 but failing in tomcat4.1.31 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "taglibs Working in tomcat3.22 but failing in tomcat4.1.31" Watch "taglibs Working in tomcat3.22 but failing in tomcat4.1.31" New topic
Author

taglibs Working in tomcat3.22 but failing in tomcat4.1.31

Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Hi
i am using taglibs which are working fine in tomcat3.22 with jdk1.3. i migrated them to tomcat4.1.31 with jdk1.4.2_06.i face the below exception.
The taglib code is as follows

public class CellTag extends BodyTagSupport
{
private int col ;
private StringBuffer sbOut;
private RowsTag parent;

private static Category cat = WebServerCategory.getInstance(" CellTag Startup ");
public CellTag()
{
sbOut = new StringBuffer();
}

public int doStartTag()
throws JspException
{
parent = (RowsTag)TagSupport.findAncestorWithClass(this, com.db.ta.services.taglib.table.RowsTag.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;
}
}


java.lang.ArrayIndexOutOfBoundsException: 10 >= 10
at java.util.Vector.elementAt(Vector.java:431)
at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:618)
at com.db.ta.services.taglib.table.CellTag.setVariables(CellTag.java:45)
at com.db.ta.services.taglib.table.CellTag.doStartTag(CellTag.java:35)
at org.apache.jsp.ETListContent_jsp._jspService(ETListContent_jsp.java:227)
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:534)



java.lang.ArrayIndexOutOfBoundsException: 10 >= 10
at java.util.Vector.elementAt(Vector.java:431)
at javax.swing.table.DefaultTableModel.getValueAt(DefaultTableModel.java:618)
at com.db.ta.services.taglib.table.CellTag.setVariables(CellTag.java:45)
at com.db.ta.services.taglib.table.CellTag.doStartTag(CellTag.java:35)
at org.apache.jsp.ETListContent_jsp._jspService(ETListContent_jsp.java:227)
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:534)


Any help is highly appreciated

Thanks,
Raj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: taglibs Working in tomcat3.22 but failing in tomcat4.1.31