teiid / teiid-spring-boot

Teiid Spring Boot is fast way to get to your Data Virtualizations projects using Teiid and Spring Boot
https://teiid.io
Apache License 2.0
46 stars 63 forks source link

So many circular reference errors for OData setup #337

Open ozzioma opened 1 year ago

ozzioma commented 1 year ago
org.teiid teiid-spring-boot-starter 1.7.2
     https://mvnrepository.com/artifact/org.teiid/spring-odata
    <dependency>
        <groupId>org.teiid</groupId>
        <artifactId>spring-odata</artifactId>
        <version>1.7.2</version>
    </dependency>

spring.datasource.equity.url=jdbc:postgresql://localhost:5432/db spring.datasource.equity.username=user spring.datasource.equity.password=pwd spring.datasource.equity.driver-class-name=org.postgresql.Driver spring.datasource.equity.platform=equity

spring.teiid.model.package=com.ap.greenpole2.odata.equity.entities

@ConfigurationProperties(prefix = "spring.datasource.equity") @Bean public DataSource equity() { return DataSourceBuilder.create().build(); }

The dependencies of some of the beans in the application context form a cycle:

dataSourceScriptDatabaseInitializer defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class] ↓ equity defined in class path resource [com/ap/greenpole2/odata/equity/config/ODataConfig.class] ┌─────┐ | teiid defined in class path resource [org/teiid/spring/autoconfigure/TeiidAutoConfiguration.class] ↑ ↓ | teiidInitializer └─────┘

Another one

webConfig ┌─────┐ | teiid defined in class path resource [org/teiid/spring/autoconfigure/TeiidAutoConfiguration.class] ↑ ↓ | teiidInitializer └─────┘

Another one

org.teiid.spring.odata.WebConfig (field org.teiid.spring.autoconfigure.TeiidServer org.teiid.spring.odata.WebConfig.server) ┌─────┐ | teiid defined in class path resource [org/teiid/spring/autoconfigure/TeiidAutoConfiguration.class] ↑ ↓ | teiidInitializer └─────┘

The above errors are few of so many. I cloned the spring-odata module and used the SpringClient, SpringODataFilter, WebConfig,SimpleErrorController, StaticContentController,ODataController classes directly all to no avail.

Was this project properly tested before releasing both the binaries and user guides? Nothing appears to work, as so many DataSource, TeiidServer and AutoConfiguration circular reference errors abound on startup.

How does this work? Clearly the user guide needs reworking to explain the circular reference errors.