• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!