Languages

Spring Boot - Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured (mchange-commons-java-0.2.19.jar).

7 points
Asked by:
Wallace
636

I am working with my Spring Boot Application.

I have got some error:

java.nio.file.NoSuchFileException: C:\Users\thomas\.m2\repository\com\mchange\c3p0\0.9.5.5\mchange-commons-java-0.2.19.jar
***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

Disconnected from the target VM, address: '127.0.0.1:63565', transport: 'socket'
1 answer
3 points
Answered by:
Wallace
636

As I see the JAR file name was changed fromĀ mchange-commons-java-0.2.19.jar toĀ c3p0-0.9.5.5.jar.

Expected file path:

C:\Users\thomas\.m2\repository\com\mchange\c3p0\0.9.5.5\mchange-commons-java-0.2.19.jar

Found file path:

C:\Users\thomas\.m2\repository\com\mchange\c3p0\0.9.5.5\c3p0-0.9.5.5.jar

Hints:

  • it looks like bugĀ caused by changesĀ againstĀ detected vulnerabilities inĀ Mchange Commons Java » 0.2.19Ā (check this link)
  • if you useĀ hibernate-c3p0, check latest versionsĀ and site notification:
    Note: This artifact was moved to: org.hibernate.orm » hibernate-c3p0 » 6.0.0.CR2

Screenshot with changed name:

Solution

You can try to:

  1. UpgradeĀ hibernate-c3p0
    https://mvnrepository.com/artifact/org.hibernate/hibernate-c3p0
  2. or:Ā do not use:
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-c3p0</artifactId>
      <version><!-- used version here ... --></version>
      <scope>compile</scope>
    </dependency>
0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
šŸš€
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ā¤ļøšŸ’» šŸ™‚

Join