[teiid-issues] [JBoss JIRA] (TEIIDSB-127) "No registered data sources found" if used "management.server.port=8081"

Steven Hawkins (Jira) issues at jboss.org
Mon Oct 21 17:48:00 EDT 2019


    [ https://issues.jboss.org/browse/TEIIDSB-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13802355#comment-13802355 ] 

Steven Hawkins commented on TEIIDSB-127:
----------------------------------------

Closed the pr to move the discussion over here.  Here's what I've tried:

Order on the configuration and datasource beans - this does not work as it's for ordering in a collection. Lazy, PriorityOrder, AutoConfigurationOrder also did not work.

The ApplicationContext (shown in the pr) or an approach using AutoWire of source lists with a qualifier (to exclude the Teiid DataSource) works for as long as there's no spring data initialization. But the creation of the Teiid DataSource can happen in between the creation of the other source and when spring runs the schema creation - thus the test failure with the pr.

The only thing that seems to consistently work is an explicit depends on. In the DataSources class if we require something like:

{code}
    @DependsOn("mydb", "myotherdb",...)
    public Object sources() {
        return new Object();
    }
{code}

Then add an

{code}
@DependsOn("teiid-sources")
{code}

To our DataSource then spring can figure it all out. I'm not sure if there is a great way to turn that into a configuration property as DependsOn expects an array, not a comma separated list. An issue would probably be the handling of multiple DataSources classes.

I'll try playing around with some of the Conditional annotations, but beyond that I'm out of ideas.  As long as the vdb is not importing from a source to define the metadata it is possible to work around this particular issue by adding more logic to the transaction management initialization such that it can allow more datasources to be added later - but of course that's not a general solution to this problem.

> "No registered data sources found" if used "management.server.port=8081"
> ------------------------------------------------------------------------
>
>                 Key: TEIIDSB-127
>                 URL: https://issues.jboss.org/browse/TEIIDSB-127
>             Project: Teiid Spring Boot
>          Issue Type: Bug
>          Components: datasource
>    Affects Versions: 1.2.0
>         Environment: teiid-spring-boot
>            Reporter: Renat Eskenin
>            Assignee: Steven Hawkins
>            Priority: Major
>
> When we used management.server.port=8081 and server.port=8080 in spring boot properties we get exception
> [2019-10-10 12:12:53,806 MSK] ERROR [test] org.teiid.PROCESSOR                                          [restartedMain]: TEIID30019 Unexpected exception for request 8fPp+5AbzHhy.0
> java.lang.IllegalArgumentException: No registered data sources found
> How can we change management port for spring actuator and do not broken Teiid?



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the teiid-issues mailing list