tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashmi Rubdi" <rashmi....@gmail.com>
Subject Re: mailer-taglib v1.1 error when changing database
Date Thu, 03 May 2007 04:16:09 GMT
Hi Philip,

On 5/2/07, phil@primeradesigns.com <phil@primeradesigns.com> wrote:
> -------------------------------------------------------------
> block of code around 265:sendtag.java
> -------------------------------------------------------------
>                 // check for more than one address
>                 if (ref.indexOf(',') != -1) {
>                     // position of the start of the error inducing address
>                     int pos = ref.substring(0, ae.getPos()).indexOf(',') + 1;
>                     // extract the error inducing address
>                     ref = ref.substring(pos, ref.indexOf(','));
>                 }

As Navas mentioned, the error is occurring, because the input data
changed and something in the input data is triggering the error. But,
we could patch SendTag.java in case it needs to be fixed.

In the above lines of code, ref is a String variable that contains
comma separated values.

I don't know what the variable ae holds, if ae.getPos() returns a
value that is either less than 0 or greater than ref.length() - 1 then
you'd get the java.lang.StringIndexOutOfBoundsException

Also if pos is greater than or equal to ref.length() , or less than 0
or if ref.indexOf(',') is 0 and pos is greater than 0 , you get
java.lang.StringIndexOutOfBoundsException

I would temporarily put System.out.println statements and see what's in the
ref, pos and ae variables --- but that might not be a good idea in
this case if there are thousands of e-mail addresses.

Another way to debug the above would be with a debugging tool (most
IDEs have them), set a breakpoint and watch the values of  ref, ae and
pos variables.


>
>
> -------------------------------------------------------------
> mt code:
> -------------------------------------------------------------
> <mt:mail server="mail.strangecargo.org.uk"
> to="newsletter@strangecargo.org.uk" authenticate="true"
> user="mail.agent@strangecargo.org.uk" password="xxxxxxxx" subject="Strange
> Cargo Newsletter" >
>
> <c:forEach var="subs" items="${subscribers.rows}" varStatus="status">
> <mt:addrecipient type ="bcc">${subs.subscriberemail}</mt:addrecipient>
> </c:forEach>
>
> <mt:from>info@strangecargo.org.uk</mt:from>
> <mt:message type="html">
> ${testhere}</mt:message>
> <mt:send/>
> </mt:mail>

The actual data that is being passed to SendTag.java would give clues here.

-Regards
Rashmi

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message