Skip to content

Bug: Props can not be found with MicronautBeanProcessor #84

@cemo

Description

@cemo

I am not sure this is the correct repo or not but I am trying to make use MicronautBeanProcessor.

My problem is that Micronaut can not resolve Spring's properties.

For EachProperty part of DataJdbcConfiguration configuration:

https://github.com/micronaut-projects/micronaut-data/blob/c1d1dc3cdee0e73125e1bc58d05c05d23c1e0633/data-jdbc/src/main/java/io/micronaut/data/jdbc/config/DataJdbcConfiguration.java#L34-L35

@EachProperty(value = DataJdbcConfiguration.PREFIX, primary = "default")
public class DataJdbcConfiguration implements Named {

it triggers:

@Override
public <T> Optional<T> getProperty(String name, ArgumentConversionContext<T> conversionContext) {
return Optional.ofNullable(environment.getProperty(name, conversionContext.getArgument().getType()));
}

However name's value is datasources. When it delegates to Spring it can not find this property. datasouces.default.url works.

I am little surprised why this is not hit before.

my prop is like this:

datasources:
  default:
    url: "jdbc:mysql://localhost:3306/cemo?useSSL=false"
    username: "root"
    password: ""
    driverClassName: com.mysql.cj.jdbc.Driver
```

Any help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions