Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

797
Views
Spring Boot DataSource: no se especifica el atributo 'url'

Estoy tratando de seguir esta guía https://spring.io/guides/gs/accessing-data-mysql/

pero esta guía es para expertos y estoy probando el gradle

y obteniendo este error

 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

en application.properties solo tengo estas cosas.

 spring.datasource.url=jdbc:mysql://localhost:3306/db_example spring.datasource.username=root spring.datasource.password=root spring.jpa.hibernate.ddl-auto=update spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

Intenté todas las cosas posibles que hay en el SO.

los unicos deps que tengo son estos

 dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' runtimeOnly 'mysql:mysql-connector-java' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } }
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Esta es una pregunta antigua, pero para cualquier otra persona que se encuentre con esto, SI por casualidad está usando IntelliJ (como lo hace OP aquí en función de sus comentarios), asegúrese de que nuestro amado IDE reconozca su aplicación.propiedades/aplicación.yml como tal, vaya a File -> Project Structure -> Modules , luego seleccione su archivo de resources y haga clic en "Recursos" en Mark as: elemento de encabezado (basado en IntelliJ Community Edition 2019.1). También tenga en cuenta, como sin duda el IDE le notificará, que al volver a importar cualquier cambio de Maven, deberá realizar este procedimiento nuevamente.

over 4 years ago · Santiago Trujillo Report

0

Estaba teniendo el mismo problema y lo resolví migrando mi proyecto que estaba en la versión 2.4.x , a la 2.3.x

over 4 years ago · Santiago Trujillo Report

0

en IDE / STS (traje de herramientas de resorte), todo funcionaba bien
pero cuando se crea un archivo "project.jar",
esto fue tirado.

los espacios innecesarios " " en el archivo "application.yml" pueden causar esto.

 server: port: 8085 spring: datasource: url: jdbc:mysql://localhost:3306/studentdb username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: ddl-auto: update show-sql: true database-platform: org.hibernate.dialect.MySQL5InnoDBDialect application: name: STUDENT-SERVICE

en lugar de modificar mi archivo "application.yml"
simplemente moví todas mis declaraciones en el archivo "application.yml" a
"application.properties" y formateó las declaraciones como se requiere en ".properties".

 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/studentdb spring.datasource.username=root spring.datasource.password=root spring.jpa.hibernate.ddl-auto = update spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect spring.jpa.show-sql=true spring.jpa.properties.hibernate.format.sql=true spring.application.name=student-service server.port=8085

y voilá

(puede agregar parámetros al final de la URL)
(spring.datasource.url=jdbc:mysql://localhost:3306/studentdb?allowPublicKeyRetrieval=true&useSSL=false)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!