From ed598ba427036351027eaad55543e2968dcdcbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=81=E6=99=93=E6=B3=A2?= Date: Fri, 22 Nov 2019 17:49:26 +0800 Subject: [PATCH 1/3] add some warnings for classpath file datasource You could use absolute path when you use File datasource & fat jar. --- .../sentinel-core-example/readme.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md index 8cc2f53eb..01fcf7b25 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md @@ -193,6 +193,18 @@ Now ReadableDataSource type support 5 categories: `file`, `nacos`, `zk`, `apollo If you want to use `nacos`, `zk`, `apollo` or `redis` ReadableDataSource, you could add `sentinel-datasource-nacos`, `sentinel-datasource-zookeeper`,`sentinel-datasource-apollo` or `sentinel-datasource-redis` dependency. +## warning +You should use `file` ReadableDataSource in a fatjar carefully or you may get error like this below + +``` +java.lang.RuntimeException: [Sentinel Starter] DataSource ds1 handle file [classpath: flowrule.json] error: class path resource [flowrule.json] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:xxx/xxx.jar!/BOOT-INF/classes!/flowrule.jso +``` +You could use absolute path when you use File datasource & fat jar. +It is recommended to use Nacos/Apollo/Zookeeper/Redis datasource to store rules. +https://github.com/alibaba/spring-cloud-alibaba/issues/428 + + + When ReadableDataSource load rule data successfully, console will print some logs: ``` @@ -203,4 +215,4 @@ When ReadableDataSource load rule data successfully, console will print some log ## More For more information about Sentinel, see [Sentinel Project](https://github.com/alibaba/Sentinel). -If you have any ideas or suggestions for Spring Cloud Sentinel starter, please don't hesitate to tell us by submitting github issues. \ No newline at end of file +If you have any ideas or suggestions for Spring Cloud Sentinel starter, please don't hesitate to tell us by submitting github issues. From 460daaf1d8976743971bd4dc6036fb06182fa96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=81=E6=99=93=E6=B3=A2?= Date: Fri, 22 Nov 2019 17:58:45 +0800 Subject: [PATCH 2/3] Update readme.md --- .../sentinel-core-example/readme.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md index 01fcf7b25..1856a4a05 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme.md @@ -193,16 +193,6 @@ Now ReadableDataSource type support 5 categories: `file`, `nacos`, `zk`, `apollo If you want to use `nacos`, `zk`, `apollo` or `redis` ReadableDataSource, you could add `sentinel-datasource-nacos`, `sentinel-datasource-zookeeper`,`sentinel-datasource-apollo` or `sentinel-datasource-redis` dependency. -## warning -You should use `file` ReadableDataSource in a fatjar carefully or you may get error like this below - -``` -java.lang.RuntimeException: [Sentinel Starter] DataSource ds1 handle file [classpath: flowrule.json] error: class path resource [flowrule.json] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:xxx/xxx.jar!/BOOT-INF/classes!/flowrule.jso -``` -You could use absolute path when you use File datasource & fat jar. -It is recommended to use Nacos/Apollo/Zookeeper/Redis datasource to store rules. -https://github.com/alibaba/spring-cloud-alibaba/issues/428 - When ReadableDataSource load rule data successfully, console will print some logs: @@ -211,6 +201,17 @@ When ReadableDataSource load rule data successfully, console will print some log [Sentinel Starter] DataSource ds1-sentinel-file-datasource load 3 DegradeRule [Sentinel Starter] DataSource ds2-sentinel-nacos-datasource load 2 FlowRule ``` +## Warning +You should use `file` ReadableDataSource in a fatjar carefully or you may get error like this below + +``` +java.lang.RuntimeException: [Sentinel Starter] DataSource ds1 handle file [classpath: flowrule.json] error: class path resource [flowrule.json] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:xxx/xxx.jar!/BOOT-INF/classes!/flowrule.jso +``` + +You could use absolute path when you use File datasource & fat jar. +It is recommended to use Nacos/Apollo/Zookeeper/Redis datasource to store rules. + +https://github.com/alibaba/spring-cloud-alibaba/issues/428 ## More For more information about Sentinel, see [Sentinel Project](https://github.com/alibaba/Sentinel). From e4a4e7f28825c908742965f9e13a2c7b3b4119f0 Mon Sep 17 00:00:00 2001 From: fangjian0423 Date: Fri, 29 Nov 2019 11:00:39 +0800 Subject: [PATCH 3/3] update pom to adapt Hoxton version --- pom.xml | 27 ++++++++++++------- spring-cloud-alibaba-dependencies/pom.xml | 2 +- .../pom.xml | 14 +++++----- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index b1ad7acb1..2d5e28105 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-build - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RELEASE @@ -73,13 +73,14 @@ - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - Horsham.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE + Horsham.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE 4.12 3.0 @@ -163,7 +164,7 @@ org.springframework.cloud - spring-cloud-netflix + spring-cloud-netflix-dependencies ${spring-cloud-netflix.version} pom import @@ -177,6 +178,14 @@ import + + org.springframework.cloud + spring-cloud-config-dependencies + ${spring-cloud-config.version} + pom + import + + org.springframework.cloud spring-cloud-bus-dependencies diff --git a/spring-cloud-alibaba-dependencies/pom.xml b/spring-cloud-alibaba-dependencies/pom.xml index 16acbef66..13dc4f598 100644 --- a/spring-cloud-alibaba-dependencies/pom.xml +++ b/spring-cloud-alibaba-dependencies/pom.xml @@ -6,7 +6,7 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RELEASE diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml index 3e3455f7b..ff17d363f 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-build - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RELEASE 4.0.0 @@ -28,11 +28,11 @@ 2.7.3 - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE + 2.2.0.RELEASE 4.0.1 @@ -58,7 +58,7 @@ org.springframework.cloud - spring-cloud-netflix + spring-cloud-netflix-dependencies ${spring-cloud-netflix.version} pom import