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 9263687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:38:41+00:00 2026-06-18T13:38:41+00:00

I have a new application in Jboss using a .war file I’m trying to

  • 0

I have a new application in Jboss using a .war file I’m trying to connect to MySQL DB at startup time (init method),
I have modified the standalone-sip.xml and added my driver following:
https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7/

In the startup logs I can see Driver and datasource are loading correctly:

23:19:30,565 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010404: **Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver** (version 5.1)
23:19:30,748 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "mysql-connector-java-5.1.22-bin.jar"
23:19:30,750 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: **Bound data source [java:jboss/datasources/opencall]**
23:19:30,933 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
23:19:30,954 INFO  [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011907: Register module: Module "deployment.mysql-connector-java-5.1.22-bin.jar:main" from Service Module Loader

But I see:

23:18:50,959 ERROR [stderr] (MSC service thread 1-5) java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from [Module "deployment.opencall-2.1.0-SNAPSHOT.war:main" from Service Module Loader]
23:18:50,959 ERROR [stderr] (MSC service thread 1-5)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

After that I see:

23:18:51,700 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "mysql-connector-java-5.1.22-bin.jar"

I believe problem is that my application is starting before mysql driver is loaded. But not sure how to force my app to use mysql driver during startup before is deployed. This is my code:
When I run it without Jboss it works fine, only when I deployed the war file fails.

try {

    Class.forName(dbClass).newInstance();

} catch (InstantiationException e) {
    logger.error("InstantiationException() Exception");
    e.printStackTrace();
} catch (IllegalAccessException e) {
    logger.error("IllegalAccessException() Exception");
    e.printStackTrace();
}
        if (dbPassword.equals(null))
    dbPassword="";
    Connection dbConnection = DriverManager.getConnection (dbUrl,dbUserName,dbPassword);
    dbConnection.close();

Found this:
Is this a similar issue:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

  • 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-18T13:38:43+00:00Added an answer on June 18, 2026 at 1:38 pm
    <!-- mysql dependencies -->
        <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.23</version>
        </dependency>
    

    Added mysql in my maven dependencies (pom.xml) and then re- build

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

Sidebar

Related Questions

I have created a new application using Entity Framework 4.3 database migrations. The migrations
I have been building a new application using my current understanding of domain driven
i am creating a new android application.i am using the table layout. I have
I m new to Jboss, but I have multiple web applications each using spring-hibernate
I have a problem deploying an Axis 2 web application. I'm using Jboss 4.2.0,
I am making a web application using JBOSS and Seam but I am trying
I have legacy application using struts & ejb2.0 , hibernate v3.0 running on JBoss
I have started a new web application and have decided to use jquery as
I have this code: app = new Application(); app.Visible = false; workbook = app.Workbooks.Add(1);
I am making a new application in MongoDB, and I have found that the

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.