Title: Message
HI,
 
We are getting the following error through a JSP.
 
We received the same error for both 7.3.1 through 7.3.4 and several JDBC driver changes (currently running the latest).
 
The strange thing is that this actual page was working fine, then, after we modified a different separate page, this page started producing the following error.
 
Is anyone else receiving Out Of Bound errors?
 
Can anyone suggest how I could get a more descriptive error?
 
I have included full source code for the page (sorry it is so long), as well as the error that is shown in Resin's Standard Error log whenever the page is loaded.
 
Thanks for any help.
 
Regards,
 
Antony 
 
___________________
 
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:444)
        at org.postgresql.jdbc1.AbstractJdbc1ResultSet.toBoolean(AbstractJdbc1ResultSet.java:684)
        at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getBoolean(AbstractJdbc1ResultSet.java:102)
        at _ejb.com.nortelleads.LeadBean__QPersist._caucho_load(LeadBean__QPersist.java:2903)
        at _ejb.com.nortelleads.ManagerBean__QPersist.ejbSelectAllWithManager(ManagerBean__QPersist.java:2713)
        at com.nortelleads.ManagerBean.getAllWithManager(ManagerBean.java:169)
        at _ejb.com.nortelleads.ManagerBean__EJB$Local.getAllWithManager(ManagerBean__EJB.java:921)
        at _lead_0listing__jsp._jspService(_lead_0listing__jsp.java:373)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
        at com.caucho.jsp.Page.subservice(Page.java:506)
        at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
        at com.caucho.server.http.Invocation.service(Invocation.java:315)
        at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
        at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
        at java.lang.Thread.run(Thread.java:534)
___________________
 

<%@ page import="com.nortelleads.*, javax.naming.*, java.util.*, java.net.*, java.text.DateFormat" session="true" errorPage="error.jsp"%>

<%@ taglib uri="ejbtags" prefix="ejb" %>

<%!

private CountryHome countryHome = null;

private LeadHome leadHome = null;

private LanguageHome languageHome = null;

private CampaignHome campaignHome = null;

public void jspInit()

{

try

{

Context ejb = (Context) new InitialContext().lookup("java:comp/env/nortel");

countryHome = (CountryHome)ejb.lookup("Country");

leadHome = (LeadHome)ejb.lookup("Lead");

languageHome = (LanguageHome)ejb.lookup("Language");

campaignHome = (CampaignHome)ejb.lookup("Campaign");

}

catch (NamingException ignore)

{

}

}

private String getDisplayForActions(Integer action)

{

if (action == null)

return null;

switch (action.intValue())

{

case 1: return "<img src='' width='18' height='18' border='0'>";

case 0: return "<img src='' width='18' height='18' border='0'>";

case -1: return "<img src='' width='18' height='18' border='0'>";

case -2: return "<img src='' width='18' height='18' border='0'>";

default: return null;

}

}

%>

<%

response.setHeader("Pragma", "no-cache");

response.setHeader("Cache-Control", "no-cache");

response.setDateHeader("Expires", 0);

Manager currentUser = (Manager)session.getAttribute("currentUser");

if (currentUser == null)

{

// If moving to archive change login.jsp to ../login.jsp

response.sendRedirect("login.jsp");

return;

}

// If moving to archive change false to true

CombinedPrivilege cp = currentUser.getPrivilege(false);

Hashtable pageInfo = (Hashtable)session.getAttribute("pageInfo");

Language language = (Language)pageInfo.get("language");

Campaign campaign = (Campaign)pageInfo.get("campaign");

Country country = (Country)pageInfo.get("country");

Vector managerFilter = (Vector)pageInfo.get("managerFilter");

String managerFocus = (String)pageInfo.get("managerFocus");

String managerFilterStatus = (String)pageInfo.get("managerFilterStatus");

Collection countryManagers = null;

boolean noManagers = true;

if (country == null)

countryManagers = currentUser.getCountryManagerLists();

else

countryManagers = currentUser.getCountryManagerLists(country);

%>

<HTML>

<HEAD>

<TITLE>Lead Listing</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=<%=language.getEncoding()%>">

<META http-equiv="Content-Style-Type" content="text/css">

<LINK rel="stylesheet" type="text/css" href="" src="">

<SCRIPT language="_javascript_">

<!--

var managerFocus = "<%=managerFocus%>";

var mngr;

var mngrRep;

function focusManager()

{

if (managerFocus != "")

window.location.href = "" + managerFocus;

}

function performAction(file)

{

document.lead_listing.action = "">

var chkd = false;

for (var i = 0; i < document.lead_listing.elements.length; i++)

{

if (document.lead_listing.elements[i].type == "checkbox")

if (document.lead_listing.elements[i].checked)

{

chkd = true;

break;

}

}

if (chkd)

document.lead_listing.submit();

else

alert("You must check at least one lead to perform this action");

}

function popWindow(file)

{

var popup = window.open(file, "ManagerFilter","width=700,height=400,scrollbars,resizable");

popup.focus();

}

// -->

</SCRIPT>

</HEAD>

<BODY class="bgNeg" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" >

<%@ include file="menuBar.jsp" %>

<IMG src="" width="1" height="30" border="0">

<TABLE border="0" cellspacing="0" cellpadding="0" width="*">

<TR>

<TD rowspan="2"><IMG src="" width="8" height="1" border="0"></TD>

<TD class="lines" colspan="3"><IMG src="" width="1" height="1" border="0"></TD>

</TR>

<TR>

<TD class="lines"><IMG src="" width="1" height="30" border="0"></TD>

<TD class="bgMain">&nbsp;&nbsp;<B class="medtextNeg">LEAD LISTING</B>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

</TR>

</TABLE>

<TABLE border="0" cellspacing="0" cellpadding="0" width="100%">

<TR>

<TD rowspan="3"><IMG src="" width="8" height="1" border="0"></TD>

<TD class="lines" colspan="10"><IMG src="" width="1" height="1" border="0"></TD>

<TD rowspan="3"><IMG src="" width="8" height="1" border="0"></TD>

</TR>

<TR>

<TD class="bgNeg" rowspan="2" width="100%"><IMG src="" width="1" height="1" border="0"></TD>

<TD class="lines"><IMG src="" width="1" height="24" border="0"></TD>

<TD class="bgNeg" class="text">&nbsp;&nbsp;<A href="">Reassign&nbsp;checked</A>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

<TD class="bgNeg" class="text">&nbsp;&nbsp;<A href="">Delete&nbsp;checked</A>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

<TD class="bgNeg" class="text">&nbsp;&nbsp;<A href="">Archive&nbsp;checked</A>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

<TD class="bgNeg" class="text">&nbsp;&nbsp;<a href="">Manager&nbsp;Filter</a>&nbsp;<a href=""><%=managerFilterStatus%></a>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

</TR>

<TR>

<TD class="lines" colspan="9"><IMG src="" width="1" height="1" border="0"></TD>

</TR>

</TABLE>

<br>

<FORM name="lead_listing" method="post">

<ejb:iterate id="countryManager" type="CountryManagerList" collection="<%=countryManagers%>" empty="<SPAN class='text'>&nbsp;&nbsp;You don't have privileges</SPAN>">

<ejb:iterate id="manager" type="Manager" collection="<%=countryManager%>">

<%

Collection leads = null;

String output = "";

StringBuffer outputStringBuffer = new StringBuffer();

// If moving to archive change false to true

long numberOfLeads = (campaign == null) ? manager.getCountAllWithManager(false).longValue() : manager.getCountAllWithManagerInCampaign(campaign, false).longValue();

if (managerFilterStatus.equals("On"))

{

if (managerFilter.contains(manager.getId()))

noManagers = false;

else

continue;

}

if (numberOfLeads > 0)

{

if (cp.getViewLeadsPerPage())

{

int current = 1;

int fromIndex = 0;

long numberOfLinks = (long)Math.ceil((double)numberOfLeads / 10.0d);

if (numberOfLinks > 1)

{

String sessionKey = manager.getCountry().getName() + manager.getFirstName() + manager.getLastName();

sessionKey = sessionKey.replace(' ', '_');

String currPage = request.getParameter(sessionKey);

Hashtable sessionObj = (Hashtable)pageInfo.get(sessionKey);

if (sessionObj == null)

{

sessionObj = new Hashtable();

pageInfo.put(sessionKey, sessionObj);

}

if (currPage == null)

{

if (sessionObj.get("currpage") == null)

{

sessionObj.put("currpage", new Integer(1));

pageInfo.put(sessionKey, sessionObj);

}

}

else

{

sessionObj.put("currpage", new Integer(currPage));

pageInfo.put(sessionKey, sessionObj);

}

current = ((Integer)sessionObj.get("currpage")).intValue();

for (int i = 0; i < numberOfLinks; i++)

{

if (current == (i+1))

{

fromIndex = i * 10;

outputStringBuffer.append("<A style=\"color:#ff9900; font-weight:700;\" href="">

outputStringBuffer.append(sessionKey);

outputStringBuffer.append("=");

outputStringBuffer.append(i+1);

outputStringBuffer.append("\">");

outputStringBuffer.append(i+1);

outputStringBuffer.append("</A> ");

}

else

{

outputStringBuffer.append("<A style=\"font-weight:700;\" href="">

outputStringBuffer.append(sessionKey);

outputStringBuffer.append("=");

outputStringBuffer.append(i+1);

outputStringBuffer.append("\">");

outputStringBuffer.append(i+1);

outputStringBuffer.append("</A> ");

}

}

// If moving to archive change false to true

leads = (campaign == null) ? manager.getAllWithManagerWithIndex(fromIndex, false) : manager.getAllWithManagerInCampaignWithIndex(campaign, fromIndex, false);

output = outputStringBuffer.toString();

}

else

// If moving to archive change false to true

leads = (campaign == null) ? manager.getAllWithManager(false) : manager.getAllWithManagerInCampaign(campaign, false);

}

else

// If moving to archive change false to true

leads = (campaign == null) ? manager.getAllWithManager(false) : manager.getAllWithManagerInCampaign(campaign, false);

}

else

continue;

%>

<SCRIPT language="_javascript_">

<!--

mngr = "<%=manager.getFirstName()%>" + "<%=manager.getLastName()%>";

mngrRep = mngr.replace(/\s/g, "_");

var HTMLstr ="<TD rowspan='2'><a name='"+mngrRep+"'><IMG src='' width='8' height='1' border='0'></a></TD>"

// -->

</SCRIPT>

<TABLE border="0" cellspacing="0" cellpadding="0" width="*">

<TR>

<SCRIPT language="_javascript_">

<!--

document.write(HTMLstr);

// -->

</SCRIPT>

<TD class="lines" colspan="5"><IMG src="" width="1" height="1" border="0"></TD>

<TD><IMG src="" width="1" height="1" border="0"></TD>

</TR>

<TR>

<TD class="lines"><IMG src="" width="1" height="26" border="0"></TD>

<TD class="bgMain">&nbsp;&nbsp;<B class="textNeg"><%=manager.getFirstName()%>&nbsp;<%=manager.getLastName()%>,&nbsp;<%=manager.getLob()%>,&nbsp;<%=manager.getState()%>,&nbsp;<%=countryManager.getName()%></B>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

<TD class="bgNeg">&nbsp;&nbsp;<A href="">Send reminder (last sent <%=((manager.getLastReminder() != null) ? DateFormat.getDateTimeInstance(DateFormat.MEDIUM , DateFormat.MEDIUM).format(manager.getLastReminder()): "N/A")%>)</A>&nbsp;&nbsp;</TD>

<TD class="lines"><IMG src="" width="1" height="1" border="0"></TD>

<TD class="bgNeg">&nbsp;&nbsp;<%=output%>&nbsp;&nbsp;</TD>

</TR>

</TABLE>

<TABLE border="0" cellspacing="0" cellpadding="0" width="100%">

<TR>

<TD width="8" class="bgNeg"><IMG src="" width="8" height="1" border="0"></TD>

<TD class="lines">

<TABLE border="0" cellspacing="1" cellpadding="4" width="100%">

<TR>

<TD rowspan="2" colspan="5" valign="top" class="bgNeg"><B class="text">Client</B></TD>

<TD colspan="2" align="center" class="bgNeg"><B class="text">Actions</B></TD>

<TD colspan="4" align="center" class="bgNeg"><B class="text">Results</B></TD>

</TR>

<TR>

<TD class="bgNeg" align="center"><SPAN class="smalltextAlt">Called Lead</SPAN></TD>

<TD class="bgNeg" align="center"><SPAN class="smalltextAlt">Sent Info</SPAN></TD>

<TD class="bgNeg" align="center"><SPAN class="smalltextAlt">Closed Lead</SPAN></TD>

<TD class="bgNeg" align="center"><SPAN class="smalltextAlt">In Progress</SPAN></TD>

<TD class="bgNeg" align="center"><SPAN class="smalltextAlt">Made Sale</SPAN></TD>

<TD class="bgNeg" align="center"><SPAN class="smalltextAlt">Deal Size $US</SPAN></TD>

</TR>

<ejb:iterate id="lead" type="Lead" collection="<%=leads%>">

<%

String dealSize = "";

if (lead.getDealSize().trim().length() > 0)

{

dealSize = lead.getDealSize().trim();

if (!dealSize.startsWith("?"))

dealSize = "$" + dealSize;

}

%>

<TR>

<TD class="bgNeg"><INPUT name="lead<%=lead.getId()%>" type="checkbox" value="true"></INPUT></TD>

<TD class="bgNeg"><SPAN class="text"><%=lead.getPriority().getName()%></SPAN></TD>

<TD class="bgNeg"><SPAN class="text"><%=lead.getCampaign() == null ? "No Campaign" : lead.getCampaign().getName()%></SPAN></TD>

<TD class="bgNeg"><A href=""><B><%=lead.getCompanyName()%></B></A></TD>

<TD class="bgNeg"><SPAN class="text"><%=lead.getDisplayDate()%></SPAN></TD>

<TD class="bgNeg" align="center"><%=getDisplayForActions(lead.getCalled())%></TD>

<TD class="bgNeg" align="center"><%=getDisplayForActions(lead.getBrochureSent())%></TD>

<TD class="bgNeg" align="center"><%=(lead.getResult().intValue() == 1) ? "<img src='' width='18' height='18' border='0'>" : "&nbsp;"%></TD>

<TD class="bgNeg" align="center"><%=(lead.getResult().intValue() == 2) ? "<img src='' width='18' height='18' border='0'>" : "&nbsp;"%></TD>

<TD class="bgNeg" align="center"><%=(lead.getResult().intValue() == 3) ? "<img src='' width='18' height='18' border='0'>" : "&nbsp;"%></TD>

<TD class="bgNeg" align="center"><SPAN class="text"><%=dealSize%></SPAN></TD>

</TR>

</ejb:iterate>

</TABLE>

</TD>

<TD width="8" class="bgNeg"><IMG src="" width="8" height="1" border="0"></TD>

</TR>

</TABLE>

<BR>

</ejb:iterate>

</ejb:iterate>

<%

if (managerFilterStatus.equals("On") && noManagers)

{

%>

<TABLE border="0" cellspacing="0" cellpadding="0" width="*">

<TR>

<TD>&nbsp;&nbsp;<SPAN class="text">All managers have been blocked by the filter</SPAN>&nbsp;&nbsp;</TD>

</TR>

</TABLE>

<%

}

%>

</FORM>

<%@ include file="footer.html" %>

</BODY>

</HTML>

Reply via email to