sql-to-jdl icon indicating copy to clipboard operation
sql-to-jdl copied to clipboard

The elements [application.table-to-export] were left unbound

Open olehamarxy opened this issue 4 years ago • 6 comments

I got this after run mvn

***************************
APPLICATION FAILED TO START
***************************

Description:

 Binding to target [Bindable@e2cfdab type = org.blackdread.sqltojava.config.ApplicationProperties, value = 'none', 
 annotations = array<Annotation> 
 [@org.springframework.boot.context.properties.ConfigurationProperties(ignoreInvalidFields=false, 
 ignoreUnknownFields=false, prefix=application, value=application)]] failed:

    Property: application.table-to-export
    Value: tera
    Origin: URL [file:application.yml] - 2:22
    Reason: The elements [application.table-to-export] were left unbound.

Action:

Update your application's configuration

My application.xml is:

spring:
    datasource:
            type: com.zaxxer.hikari.HikariDataSource
            url: jdbc:mysql://127.0.0.1:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false
            username: root
            password:
            hikari:
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true
    jooq:
        sql-dialect: mysql


application:
    table-to-export: tera
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
        type: jdl

olehamarxy avatar Aug 19 '21 19:08 olehamarxy

application.xml? -> application.yml

Also check https://github.com/Blackdread/sql-to-jdl/blob/master/src/main/resources/application.yml Newest version of the code uses database-to-export

Blackdread avatar Aug 20 '21 01:08 Blackdread

Yes. Right that is .yml, not .xml database-to-export made the trick, runs well, but I received an error

mvn_error1.log

olehamarxy avatar Aug 23 '21 05:08 olehamarxy

the error is explicit, just rename your table calculator-1 to something that can be used by jooq and more importantly by java

Blackdread avatar Aug 23 '21 05:08 Blackdread

Unfortunately I can't rename the table 'cause this is working project. calculator-1 is a legal name for table. But it seems that Jooq does not use backticks

olehamarxy avatar Aug 23 '21 06:08 olehamarxy

I've added the table calculator-1 to ignore list for testing purposes and received next error mvn_error2.log

olehamarxy avatar Aug 23 '21 06:08 olehamarxy

I executed the code for a project with 250 tables, it worked all good, using mysql 8.0.21 (it used to run 5.7 but we upgraded to latest mysql). So if you can write a test similar to GenerateForMysql8Test and GenerateForMysql57Test then I would be able to reproduce this error.

Since you are using MariaDB, would be great to have a GenerateForMariaDbTest; Can you do it and have a test sql V1__base.sql like others I used with the extra features you have so to be able to reproduce the problem.

Based on second log, this error comes from the native statement/prepared statement so need to reproduce it with a proper test.

Blackdread avatar Aug 23 '21 06:08 Blackdread

No test provided. Probably should close until is comes up again. This might also be resolved by the switch to native SQL.

octgsoftware avatar Dec 04 '22 14:12 octgsoftware

Agreed

Blackdread avatar Dec 04 '22 14:12 Blackdread