Re: mailer-taglib v1.1 error when changing database
"José Navas" <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
Philip It seems that there is no validation on ae.getPos( ), may be it's beyond ref.length( ) When you change the database, the data changes, so the problem occurs. Just a hunch. Regards, Navas On 5/2/07, [email protected] <[email protected]> wrote: > > > Hi Philip, > > > > I haven't worked with the mailer-taglib, but I'm familiar with other > > taglibs and some basic concepts of taglibs and also the specific error > > you are getting, I'm not sure if I can help but I'll try. > > > > It would be useful for us to see relevant snippets of code that causes > > this error, in order to diagnose the problem. > > > > Please post the section between > > <mt:send> > > > > </mt:send> > > > > and also post any other code that you think is relevant. > > > > According to the documentation > > > http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringIndexOutOfBoundsException.html > > this error java.lang.StringIndexOutOfBoundsException: String index out > > of range: -1 is caused when "..... indicate that an index is either > > negative or greater than the size of the string." > > > > And the above error is occurring when the substring method is invoked > > on something in > > org.apache.taglibs.mailer.SendTag.doStartTag(SendTag.java:265) > > > > Looking at line 265 of SendTag.java would give additional clues. > > > > -Regards > > Rashmi > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > Hi Rashmi, > > Thanks for your interest: > > as follows is info as requested. It is odd because it is exactly same code > as when I use dummy database, which works. I have verified correct mysql > parameters however will look into what the database is actually pulling up > and see if there are problems there. > thanks > > > ------------------------------------------------------------- > 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(',')); > } > > > ------------------------------------------------------------- > mt code: > ------------------------------------------------------------- > <mt:mail server="mail.strangecargo.org.uk" > to="[email protected]" authenticate="true" > user="[email protected]" 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>[email protected]</mt:from> > <mt:message type="html"> > ${testhere}</mt:message> > <mt:send/> > </mt:mail> > ------------------------------------------------------------- > mt info: > ------------------------------------------------------------- > to: is populated > bcc: is populated with correct mysql parameters > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >