• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JForumBaseServlet.init can't load dao.driver. Did I break tomcat 5.5?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been tinkering with JForum quite a bit to tie it into an existing web-app.

I wanted to add some new DAO classes, so I subclassed the net.jforum.dao.mysql.MysqlDataAccessDriver, and changed mysql.properties
dao.driver=org.2wav.dao.mysql.MyDataAccessDriver

The code builds, org.2wav.dao.mysql.MyDataAccessDriver appears to be in the WEB-INF/classes directory.

In JForumBaseServlet.java, this code now throws a NoClassDefFoundException:


// Start the dao.driver implementation
DataAccessDriver.init((DataAccessDriver)Class.forName(
SystemGlobals.getValue(ConfigKeys.DAO_DRIVER)).newInstance());



I suspected something is wrong with my custom DataAccessDriver, however, when I change dao.driver back to the original settings, i get the same class def error. Code that worked before is now busted. I have restarted tomcat, and even tried changing the code to directly instantiate net.jforum.dao.mysql.MysqlDataAccessDriver but that throws java.lang.ExceptionInInitializerError.

Any ideas what I might have broken, that JForumBaseServlet.init no longer can load dao.driver?
[originally posted on jforum.net by 2wav]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hhmm..

are you able to instantiate the class by hand? for example, create a .jsp file with the following contents:



and execute it. It works?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bad class path for login authenticator in global properties was causing the DataAccessDriver to fail on static initialization.

Thanks for your response. I wish I had stuck with it just a bit longer before calling cavalry.
[originally posted on jforum.net by Anonymous]
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic