File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes Error 500--Internal Server Error After Redeploying Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Error 500--Internal Server Error After Redeploying" Watch "Error 500--Internal Server Error After Redeploying" New topic
Author

Error 500--Internal Server Error After Redeploying

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi, I tried to change the gui of the discussion forum and after changing the logo and doing the redeploy on my web server, I got this error message:

Error 500--Internal Server Error
net.jforum.exceptions.DatabaseException: Error while trying to start the database: net.jforum.exceptions.DatabaseException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:468)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:125)
at net.jforum.C3P0PooledConnection.getConnection(C3P0PooledConnection.java:137)
at net.jforum.ForumStartup.startDatabase(ForumStartup.java:78)
at net.jforum.JForum.init(JForum.java:95)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:274)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: net.jforum.exceptions.DatabaseException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
... 27 more
Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
... 27 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: The pool timed out while waiting to acquire a resource -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1157)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:405)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:351)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:466)
... 24 more


Does anyone know was cause this and how to fix it?

[originally posted on jforum.net by nadj]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
It looks like you're database connection information got changed and is invalid. Maybe you're using the test server and not production?

When you say "redeployed" does that mean your application server needs to have a full war to make changes? If that's the case, you'll need to be careful about how you make changes. There are various "dynamic" files that are created in the jForum application directory. Things like the config file, which can be edited via the admin screens; and attachments to postings.

If you're application server environment doesn't let you update individual files, you will probably have to take steps to protect these changes. E.g., shut the forum application down, make a "snapshot war" from the application directory, then modify this with your changes, and then re-deploy the war, and restart the application.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi,

I still get the same error. I reinstall the forum from scracth on BEA WebLogic 9.2 and I am using an Oracle 10g database and i use a pooled connection. After the installation, everything works but when i do an update of the files with BEA, I cannot access the forum after. I keep getting the Error 500

net.jforum.exceptions.DatabaseException: Error while trying to start the database: net.jforum.exceptions.DatabaseException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:468)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:125)
at net.jforum.C3P0PooledConnection.getConnection(C3P0PooledConnection.java:137)
at net.jforum.ForumStartup.startDatabase(ForumStartup.java:78)
at net.jforum.JForum.init(JForum.java:95)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:274)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: net.jforum.exceptions.DatabaseException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
... 27 more
Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
... 27 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: The pool timed out while waiting to acquire a resource -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1157)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:405)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:351)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:466)



I don't know what i am doing wrong or if someone had have the same problem and how they fix it. It seems the combination of WL oracle and JForum is not the best. Any suggestions?

Thanks
[originally posted on jforum.net by nadj]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Sorry, I don't really use Oracle and Weblogic so I can't say for sure, but the error message and location REALLY look like you don't have your DB connection information set up correctly.

Common things that come to mind might be JDBC driver versions and security issues (e.g. the DB user you are using doesn't have the right to connect from that machine, etc). If you are using a JNDI datasource for your DB access, sometimes the URLs for these can be tricky.

Have you tried just writing a simple jsp page to access the DB using the standard JDBC calls from the jForum web context? This sometimes can give you more information about what is going wrong and if it's a jForum or just connection issue.

FWIW, I'm not sure, but I think there are people using WL and Oracle...
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
now I found the reason for my problem. It was that I used different MySQL Database settings (username, password and databasename) in the test- and productive environment.
After I changed these settings in the config file: /WEB-INF/config/database/mysql/mysql.properties
everything works as expected. I can now redeploy my application without going through the /install.jsp


[originally posted on jforum.net by rsoika]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi,

I have the same problem. When I redeploy my customized JForum on Glassfish I got these DatabaseExceptions and I need to call the /install.jsp page. This solves the problem but removes my data stored in a mysql database.

Ok I understand that I should backup my data to avoid this situation after a redeploy. But what did you mean exactly with

monroe wrote:There are various "dynamic" files that are created in the jForum application directory


Is there a short description available what steps are necessary when I want to redeploy a customized JFourm war file?

The funny thing is that in my developer environment (Ubuntu/Eclipse/Glassfish/Mysql) I did lot of redeployments with out this problem! I triggered the redeployment by the Ant-Script (where I copy the new build directly into the autodeploy folder of glassfish). This works without any problems. I can see my changes in my testforum without backup the mysql data before.

thanks for help
ralph

[originally posted on jforum.net by rsoika]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error 500--Internal Server Error After Redeploying