This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JForum and the fly likes NumberFormatException while saving edited message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "NumberFormatException while saving edited message" Watch "NumberFormatException while saving edited message" New topic
Author

NumberFormatException while saving edited message

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi all!

I got the following problem:

I am editing a message in a forum as admin and after click on the "submit" button, I get the exception:

net.jforum.exceptions.ForumException:
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:597)
at net.jforum.Command.process(Command.java:114)
at net.jforum.JForum.processCommand(JForum.java:217)
at net.jforum.JForum.service(JForum.java:200)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
at
org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
... 31 more
Caused by: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:415)
at java.lang.Integer.parseInt(Integer.java:497)
at
net.jforum.context.web.WebRequestContext.getIntParameter(WebRequestContext.java:343)
at
net.jforum.view.forum.ModerationHelper.buildModerationLogFromRequest(ModerationHelper.java:150)
at net.jforum.view.forum.PostAction.editSave(PostAction.java:876)
... 31 more

URL is: /idabcJForum/jforum.page?null

Could someone tell me, what's going wrong there?

I have seen, that the exception caused by not existing "log_type" in the request. If I add a hidden field for it and for "log_description" (in the post_form.htm template) everything runs just fine, but I'm not sure if it's a correct solution since I dont' see this field in this forum when I'm editing my own message.

Thanks in advance

August
[originally posted on jforum.net by August]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Are you using custom or older templates? You may need to reconcile your templates with the newer ones.

Version 2.1.8 added a Moderation Logging feature which tracks moderator actions. The fields you say are missing are in the 2.1.8 post_forum.htm templates. They are wrapped in a "If moderator" clause and only get added if the id is not the same as the poster and has post edit rights.

Another alternative to updating templates is to turn of moderation logging in the config file by setting the moderation.logging.enabled property to false.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi!

Thank you for the answer. It is realy a custom template.

The fields you say are missing are in the 2.1.8 post_forum.htm templates.


That was exactly the template where I added those fileds. And yes, I use the version 2.1.8
[originally posted on jforum.net by August]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NumberFormatException while saving edited message
 
Similar Threads
VB variables? SQL queries?
Can't add new Forums
Error when storing profile
A message preview problem
uddibrowser + juddi v3 / how to config