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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:41:04+00:00 2026-05-20T09:41:04+00:00

My Grails app runs fine in Tomcat when the (MySQL) dataSource is defined in

  • 0

My Grails app runs fine in Tomcat when the (MySQL) dataSource is defined in DataSource.groovy. But when using an external config file I get ClassNotFoundExceptions for the MySQL drivers from Tomcat. No special War dependencies are set up either.

I am probably missing something obvious, but cant seem to identify it. Tried moving the MySQL connector to the CATALINA_HOME/lib, but that doesn’t do it.

Any thoughts or help is greatly appreciated!

....
//loading external config  
def extConfig = System.properties.getProperty("${appName}-config.location");  
grails.config.locations = [ "file:${extConfig}/${appName}-config.properties"]  
//config file contents.  
dataSource.pooled = true  
dataSource.dbCreate = "create-drop"  
dataSource.driverClassName = "com.mysql.jdbc.Driver"  
dataSource.username = "root"  
dataSource.password = "ttech"  
dataSource.url="jdbc:mysql://localhost:3306/registration"
  • 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-05-20T09:41:05+00:00Added an answer on May 20, 2026 at 9:41 am

    In our projects we have an external properties file for configuration and we use it to set the datasource configuration as well, in our case we use PostgresSQL and we use the BuildConfig.groovy to include the jar file for the driver, when the WAR is generated Grails dependency management system puts the jar in WEB-INF/lib and that has worked just fine for us, no need to put in the Tomcat lib folder.

    In your settings I see that you are not specifying the dialect for the datasource, you might want to check that in your external file too.

    Hope this helps!

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

Sidebar

Related Questions

In order to get MySQL working with a Grails app, I copied the JAR
I have a grails project and my configuration points to a mysql database: DataSource.groovy
Has anyone built a grails app using extjs as the frontend? Are there any
I am developing an app using Grails and GWT for a client side. I
I'm trying to test my grails app using integration test that makes http requests.
I have a grails app that is using jsecurity plugin for authentication. How do
I'm trying to stream an audio file from a grails app. The audio file
I am working on a grails app and need to remove Tomcat plugin in
I have a Maven/Grails app that almost builds, but fails to find web.xml at
My Grails app is using the Spring Security plugin. I need to login a

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.