Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Error creating forum (v2.1.5)

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Whenever I try to create a forum in the new installation, using the latest CVS version, I get the follwowing error:

An error has ocurred. For detailed stack trace, please see the page's source code.

java.lang.reflect.InvocationTargetException



with the following detailed stacktrace:


10:26:26,277 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:324)
at net.jforum.Command.process(Command.java:120)
at net.jforum.view.admin.AdminCommand.process(AdminCommand.java:64)
at net.jforum.JForum.service(JForum.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:171)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.util.NoSuchElementException
at org.hsqldb.lib.IntValueHashMap.get(Unknown Source)
at org.hsqldb.CompiledStatementManager.getStatementID(Unknown Source)
at org.hsqldb.Session.sqlPrepare(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
at net.jforum.dao.generic.AutoKeys.executeAutoKeysQuery(AutoKeys.java:128 )
at net.jforum.dao.generic.AutoKeys.executeAutoKeysQuery(AutoKeys.java:112)
at net.jforum.dao.generic.GenericForumDAO.addNew(GenericForumDAO.java:218 )
at net.jforum.view.admin.ForumAction.insertSave(ForumAction.java:212)
... 15 more



Shouls I open a bug(JIRA issue), or is this to be expected from the CVS version?

Cheers!
[originally posted on jforum.net by GreenEyed]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your environment?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently testing using:

JDK 1.4.2_07
OS: Windows XP
Servlet Container: Resin 2.1.13
DB: embedded HSQLDB

Cheers!


[originally posted on jforum.net by GreenEyed]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I'll take a look.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there again,

I found the issue: It's a small typo in the file hsqldb.sql version 1.20

Where it reads:

ForumModel.generatedForumId = SELECT MAX(forum_id) from jforum_forums


it should read:

ForumModel.lastGeneratedForumId = SELECT MAX(forum_id) from jforum_forums


This was causing this.getAutoGeneratedKeysQuery() to return null in the case of HSQLDB, causing the java.util.NoSuchElementException when trying to prepare the statement that was null.

I'll open a JIRA bug, but just in case here it is the diff:

diff -w -b -r1.20 hsqldb.sql
59c60
< ForumModel.generatedForumId = SELECT MAX(forum_id) from jforum_forums <br /> --- <br /> > ForumModel.lastGeneratedForumId = SELECT MAX(forum_id) from jforum_forums


Oracle, SQLServer and PostgreSQL files are correct and MySQL does not need the line, so I guess that's all.

Cheers!

Edit: JIRA issue opened: JF-319
[originally posted on jforum.net by GreenEyed]
 
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic