Spring boot application.properties problem

Asked

Viewed 23 times

1

This is my application.properties file.

  ###############################################################################
    # PORTA
    ###############################################################################
    
    server.port=8100
    
    ###############################################################################
    # BANCO DE DADOS
    ###############################################################################
    
    spring.datasource.url=jdbc:sqlserver://194.168.1.30:1445;DatabaseName=DB_TREINAMENTO_JAVA
    spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
    spring.datasource.username=sa
    spring.datasource.password=123
    
    ###############################################################################
    # LIQUIBASE
    ###############################################################################
    
    spring.liquibase.change-log=classpath:/db/changelog/master.xml
    spring.liquibase.default-schema=dbo
    
    ###############################################################################
    # CONFIGURACOEES SPRING
    ###############################################################################
    
    spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
    spring.jpa.database=SQL_SERVER
    spring.jpa.properties.hibernate.show_sql=false
    spring.jpa.properties.hibernate.format_sql=true
    
    ###############################################################################
    # CONFIGURAÇÕES ARQUIVOS - UPLOAD
    ###############################################################################
    
    spring.servlet.multipart.enabled=true
    spring.servlet.multipart.file-size-threshold=2KB
    spring.servlet.multipart.max-file-size=200MB
    spring.servlet.multipart.max-request-size=215MB
    
    file.upload-dir=/documentos/UploadDir

And he’s generating this Exception the moment I run my project...

***************************
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).

I’m not getting the root of the problem of this project.

  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

1 answer

1

Make sure the dependency of driver connection with the bank is in your project.

In your case it would be the driver for the SQLServer.

If you’re a Maven, see if you have:

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    <version>4.0</version>
</dependency>

If it were Radle, it would be:

implementation 'com.microsoft.sqlserver:sqljdbc4:4.0'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.