I change getSignature method
public String getSignature() {
String s = this.signature;
if (s.toLowerCase().indexOf("{img}")>=0 && s.toLowerCase().indexOf("{/img}")>=0) { // I use "{" here because I cannot post "[" in the forum... i am using "[" in the program actually
int startIdx = s.toLowerCase().indexOf("
int endIdx = s.toLowerCase().indexOf("" border="0" class="postimg">", startIdx) + "[/img]".length();
System.err.println(s.substring(0, startIdx) + s.substring(endIdx, s.length()));
s = s.substring(0, startIdx) + s.substring(endIdx, s.length());
}
return s;
}
And then it will error like this ...
11:37:43,069 ERROR [ExceptionWriter ] java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.jforum.Command.process(Command.java:116)
at net.jforum.JForum.service(JForum.java:182)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at net.jforum.entities.User.getSignature(User.java:366)
at net.jforum.view.forum.common.ViewCommon.prepareUserSignature(ViewCommon.java:240)
at net.jforum.view.forum.PostAction.list(PostAction.java:215)
... 24 more
[originally posted on jforum.net by Ryu]