linda1890 / jforum2

Automatically exported from code.google.com/p/jforum2
Other
0 stars 0 forks source link

JForum doesn't start after manual installation with oracle database. #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Manual install for oracle, run ddl and init scripts.
2. open browser and go to: http://localhost:8080/jforum/forums/list.page
3.

What is the expected output? What do you see instead?

Expectation is the forum start page. Instead the following exception is shown:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet jforum threw 
exception
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:619)

root cause

net.jforum.exceptions.ForumStartupException: Error while starting JForum
    java.lang.Class.forName0(Native Method)
    java.lang.Class.forName(Class.java:169)
    net.jforum.ConfigLoader.loadDaoImplementation(ConfigLoader.java:216)
    net.jforum.JForum.startApplication(JForum.java:329)
    net.jforum.JForum.init(JForum.java:112)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:619)

root cause

net.jforum.exceptions.ForumException: java.lang.NullPointerException
    java.lang.Class.forName0(Native Method)
    java.lang.Class.forName(Class.java:169)
    net.jforum.ConfigLoader.loadDaoImplementation(ConfigLoader.java:216)
    net.jforum.JForum.startApplication(JForum.java:329)
    net.jforum.JForum.init(JForum.java:112)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:619)

root cause

java.lang.NullPointerException
    java.lang.Class.forName0(Native Method)
    java.lang.Class.forName(Class.java:169)
    net.jforum.ConfigLoader.loadDaoImplementation(ConfigLoader.java:216)
    net.jforum.JForum.startApplication(JForum.java:329)
    net.jforum.JForum.init(JForum.java:112)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:619)

note The full stack trace of the root cause is available in the Apache 
Tomcat/6.0.32 logs.

--------------------------

I think that the problem is that the additional oracle database properties file 
is not used.

If I include the following line in JForum.startApplication():

SystemGlobals.loadAdditionalDefaults(SystemGlobals.getValue(ConfigKeys.DATABASE_
DRIVER_CONFIG));

Then JForum starts OK.

The same initialization is done in the 
TestCaseUtils.initDatabaseImplementation() method, so I think it should be done 
in application startup as well.

Original issue reported on code.google.com by peter.ri...@gmail.com on 23 Apr 2012 at 9:58

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r182.

This fixes the issue. Please review and close. Note I felt that creating a 
testcase for this is not practical, so there are no testcase for this.

Original comment by peter.ri...@gmail.com on 24 Apr 2012 at 9:39

GoogleCodeExporter commented 9 years ago
Did you follow the steps listed in 
http://code.google.com/p/jforum2/wiki/ManualInstallation ?
Besides running the database part, you need to edit the config 
file(SystemGlobals.properties or jforum-custom.conf).

The problem is that JForum use Oracle Blob type to store post, and the 
oracle_data_dump.sql doesn't contain three SQL statements in the Demostration 
Forum section:
INSERT INTO jforum_topics
INSERT INTO jforum_posts
INSERT INTO jforum_posts_text
They are executed in the InstallAction.java during auto installation.
So the fix should be to remove the following line from oracle_data_dump.sql:
INSERT INTO jforum_forums
and execute this in the InstallAction.java when using auto installation.

Original comment by andow...@gmail.com on 18 May 2012 at 9:16

GoogleCodeExporter commented 9 years ago
Fixed in revision r188.
You'll need to add a config key installed=true in jforum-custom.conf file after 
manual installation.

Original comment by andow...@gmail.com on 29 May 2012 at 9:52