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

NoClassDefFoundError if servlet isn't started right away

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've installed JForum as a way of gettng a bit of feedback about my site, http://wow.gedsguides.com/, not that anyone seems to be bothering.

Anyway, it installed OK but there are a couple of problems.

The first, small problem, is when I restart Tomcat, if I don't immediately open the home page for the forums (http://www.gedsguides.com/forums/forums/list.page) then it won't start properly on demand later. I haven't tested how long I have to leave it before this happens, but it's no more than a couple of hours. If I do open a window right away, everything seems to work fine.

Second, more serious thing, is that it's started going wrong now after about 12-24 hours or so, and when I visit the page I get this:

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:105)
org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)

root cause

java.lang.NoClassDefFoundError
net.jforum.C3P0PooledConnection.init(C3P0PooledConnection.java:64)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:75)
net.jforum.JForum.init(JForum.java:93)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)



My ISP is running Tomcat 5.5.9 on JDK 1.5.0.

Hmm, actually I've just noticed that someone - possibly me - has set it to restart tomcat automatically every 24 hours, in which case problem #2 is probably the same as problem #1 .

I suppose I could get over this by setting the servlet to be started automatically rather than on-demand, and I will as a last resort, but initially I'd prefer to know what's going wrong.

[originally posted on jforum.net by gedsguides]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Man, that's really crazy.

Yeah, you can configure the servlet so it start automatically.

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
I have install it many times, it the same problem.
It seems can install well, but when i open the first pages, (http://www.loveworldfriend.com/JForum-2.1.6/forums/list.page)
it is here:


java.lang.NoClassDefFoundError
at net.jforum.C3P0PooledConnection.init(C3P0PooledConnection.java:64)
at net.jforum.ForumStartup.startDatabase(ForumStartup.java:75)
at net.jforum.JForum.init(JForum.java:93)
at com.caucho.server.http.Application.createServlet(Application.java:3114)
at com.caucho.server.http.Application.loadServlet(Application.java:3065)
at com.caucho.server.http.QServletConfig.loadServlet(QServletConfig.java:435)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2809)
at com.caucho.server.http.Application.buildFilterChain(Application.java:2765)
at com.caucho.server.http.Invocation.service(Invocation.java:313)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:595)


[originally posted on jforum.net by kevin]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given that I'm not the only one getting this error, I'd say this is a real, solid bug. I have to say it doesn't do JForum any favours when I look at my forums and see that they are down yet again, same old problem. Thank god they aren't getting any traffic ((

kevin wrote:I have install it many times, it the same problem.
It seems can install well, but when i open the first pages, (http://www.loveworldfriend.com/JForum-2.1.6/forums/list.page)
it is here:


java.lang.NoClassDefFoundError
at net.jforum.C3P0PooledConnection.init(C3P0PooledConnection.java:64)
at net.jforum.ForumStartup.startDatabase(ForumStartup.java:75)
at net.jforum.JForum.init(JForum.java:93)
at com.caucho.server.http.Application.createServlet(Application.java:3114)
at com.caucho.server.http.Application.loadServlet(Application.java:3065)
at com.caucho.server.http.QServletConfig.loadServlet(QServletConfig.java:435)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2809)
at com.caucho.server.http.Application.buildFilterChain(Application.java:2765)
at com.caucho.server.http.Invocation.service(Invocation.java:313)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:595)


[originally posted on jforum.net by gedsguides]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looked at the code lines around the section causing the problem and it seems like it's related to your JDBC driver.

One thing to make sure of is that the JDBC driver jar is not located in multiple Tomcat lib levels (e.g. common/shared/webapp). TC has strict class loader security rules. This means that if the JDBC layer and same driver has been initialized at the Common level, a call by a Webapp can not replace the Common level class with the Webapp level class (A trojan webapp could use this to hijack the server if it was allowed).

A quick test of this would be to remove the JDBC driver from your webapp lib directory and see if jForum still works.

FWIW, a common cause having the same JDBC driver loaded at a higher level, this is that another webapp is using a JNDI datasource or Tomcat security is using a DataSourceRealm.

If that's not the case, try adding a <load-on-startup>1</load-on-startup> node to the Jforum servlet in your web.xml to force it to start when TC is restarted. Make sure to remove the Installer servlet (see: https://coderanch.com/t/576919 #14222)

Hope this helps.

Greg
[originally posted on jforum.net by monroe]
 
    Bookmark Topic Watch Topic
  • New Topic