Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9160925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:51:07+00:00 2026-06-17T13:51:07+00:00

I am getting well-known NoClassDefFoundError: com/mysql/jdbc/StringUtils, but my case is little different: I am

  • 0

I am getting well-known NoClassDefFoundError: com/mysql/jdbc/StringUtils, but my case is little different: I am not using MySQL at all.

I’m working with PostgreSQL 9.1 database using JDK 1.6.
On my computer everything works perfectly (PostgreSQL driver is loaded, no classpath issues etc.), but I have to upload my project to my University’s servers, where I am getting the following error:

java.lang.NoClassDefFoundError: Could not initialize class com.mysql.jdbc.StringUtils

Here is a full stack trace:

com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:286)
java.sql.DriverManager.getConnection(DriverManager.java:582)
java.sql.DriverManager.getConnection(DriverManager.java:185)
elections.ConnectionManager.getConnection(ConnectionManager.java:29)
elections.daos.LoginDAO.login(LoginDAO.java:23) 
elections.controllers.LoginController.doPost(LoginController.java:46) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:641) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
java.lang.reflect.Method.invoke(Method.java:597) 
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274) 
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271) 
java.security.AccessController.doPrivileged(Native Method) 
javax.security.auth.Subject.doAsPrivileged(Subject.java:517) 
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306) 
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:299) 
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57) 
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193) 
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189) 
java.security.AccessController.doPrivileged(Native Method) 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:208) 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197) 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770) 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
java.lang.Thread.run(Thread.java:662)

Here’s my class which provides connection (It’s my first JDBC project; I know that code below is not threadsafe; I’m going to rewrite it using Connection Pooling, but first I need to get it to work…)

static Connection conn;

public static Connection getConnection() throws Exception {
    try {

        String url = "jdbc:postgresql://host/database";
        String username = "username";
        String pwd = "password";

        Class.forName("org.postgresql.Driver");

        try {
            conn = DriverManager.getConnection(url, username, pwd);
        } catch (SQLException e) {
            e.printStackTrace();
            throw e;
        }
    } catch (ClassNotFoundException e) {
        throw e;
    }
    return conn;
}

I did huge search on the internet but I seem to be the only man in the world with such issue… Everybody else has this problem with MySQL only.

I have even tried to put MySQL driver (containing the lacking com.mysql.jdbc.StringUtils class) into WEB-INF/lib folder, but this didn’t help.

Only useful information I have found is that probably error is hidden somewhere else (that means, some class that com.mysql.jdbc.StringUtils depends on couldn;t be loaded), but I don’t know where to search.

I really don’t understand why MySQL classes are searched for, while I use PostgreSQL only.

Any kind of help would be appreciated! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:51:09+00:00Added an answer on June 17, 2026 at 1:51 pm

    Ok, It turned out to be permissions issue with Tomcat Security Manager. As soon as admin will examine what the exact reason was, I’ll post it here and accept the best answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am firing a GET request using jquery but not getting response what could
I am getting the all well known FileNotFoundException when i try to call a
I am having trouble getting well formatted results from my mysql query. Here is
I've been getting parser error with message The server tag is not well formed
I'm using the plain iframe codes, NOT xfbml (was getting fragments appended so reverted
I'm using this well known sample code from Apple to convert camera buffer still
Well, I was trying to fix this program, and I keep getting the errors
Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
I'm confused about the world of Ruby Gems. There are several well-known repositories. Which
I'm getting a little bit crazy right now. My company switched from VS2008 to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.