codingapi / codingapi/tx-lcn

lx-lcn必须要数据源吗,没有数据源应用启动不了

オープン
#427 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
4.2k
フォーク
1.4k
PR マージ指標
30日以内にマージされた PR はありません

説明

- [ ] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate.

### 1. Bug Description
使用tx-lcn 5.0.2时,有如下4个服务:business-service,inventory-service,order-service,account-service,其中 business-service服务是没有数据源,inventory-service,order-service,account-service都是有自己的数据源,因为business-service它只是负责调用其他3个服务完成业务,但是启动时报异常,其他3个有数据源的就能正常启动,异常如下:
Parameter 0 of constructor in com.codingapi.txlcn.tc.core.transaction.txc.analy.TableStructAnalyser required a bean of type 'javax.sql.DataSource' that could not be found.

The following candidates were found but could not be injected:
- Bean method 'dataSource' in 'JndiDataSourceAutoConfiguration' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'
- Bean method 'dataSource' in 'XADataSourceAutoConfiguration' not loaded because @ConditionalOnBean (types: org.springframework.boot.jdbc.XADataSourceWrapper; SearchStrategy: all) did not find any beans of type org.springframework.boot.jdbc.XADataSourceWrapper

Action:

Consider revisiting the entries above or defining a bean of type 'javax.sql.DataSource' in your configuration.

### 2. Environment:
- JDK version: 1.8
- OS: windows7
- TX-LCN version: 5.0.2
- Others:

### 3. Exception Stacktrace

```
Paste your Exception Stacktrace here!
```

### 4. Tour Idea

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

起動時例外で示されている TableStructAnalyser コンストラクターから始め、business-service の設定をデータソースを定義している 3 つのサービスと比較します。TX-LCN 5.0.2 で起動失敗を再現し、その後、DataSource のないサービスは起動できる一方で、データソースを持つサービスは引き続き正常に初期化されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, spring-boot
領域
backend, databases, distributed-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。