String index out of range: -1

java.lang.StringIndexOutOfBoundsException

/refId,47615/refDownload.pml

java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1931) at java.lang.String.substring(String.java:1904) at com.seqtek.ac.pt.file.RefDownloadBean.doDownLoad(RefDownloadBean.java:50) at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.seqtek.pml.parser.handlers.content.bean.ActionBean.invokeMethod(ActionBean.java:110) at com.seqtek.pml.parser.handlers.content.bean.ActionBean.doLoad(ActionBean.java:47) at com.seqtek.ac.pml.AcActionBean.doLoad(AcActionBean.java:85) at com.seqtek.pml.parser.handlers.action.tag.PMLTagHandler.postprocess(PMLTagHandler.java:110) at com.seqtek.pml.parser.Parser.parseDocument(Parser.java:601) at com.seqtek.pml.parser.Parser.parseDocument(Parser.java:650) at com.seqtek.pml.parser.Parser.parseXML(Parser.java:469) at com.seqtek.pml.parser.Parser.load(Parser.java:325) at com.seqtek.pml.parser.Parser.load(Parser.java:301) at com.seqtek.pml.nav.NavServlet.postRequest(NavServlet.java:324) at com.seqtek.pml.module.ModularSiteServlet.postRequest(ModularSiteServlet.java:47) at com.seqtek.pml.nav.NavServlet.doPost(NavServlet.java:172) at com.seqtek.pml.nav.NavServlet.doGet(NavServlet.java:155) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)