You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2021/03/08 09:53:26 UTC
[servicecomb-java-chassis] branch master updated: [SCB-2206]ProducerOperationHandler print message null when exception … (#2278)
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new ba9e12e [SCB-2206]ProducerOperationHandler print message null when exception … (#2278)
ba9e12e is described below
commit ba9e12e521d28bc4756c831ca423a43211dbbae9
Author: bao liu <bi...@qq.com>
AuthorDate: Mon Mar 8 17:53:18 2021 +0800
[SCB-2206]ProducerOperationHandler print message null when exception … (#2278)
* [SCB-2206]ProducerOperationHandler print message null when exception is InvocationTargetException
* [SCB-2206]fix tests to avoid port conflict
---
.../servicecomb/core/handler/impl/ProducerOperationHandler.java | 6 ++++--
.../servicecomb/demo/multiServiceCenterClient/Application.java | 2 +-
.../src/main/resources/application.yml | 5 -----
.../org/apache/servicecomb/demo/zeroconfig/tests/Application.java | 2 +-
.../src/main/resources/application.yml | 3 ---
5 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java b/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
index ed81e4b..488a504 100644
--- a/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
+++ b/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
@@ -93,7 +93,8 @@ public class ProducerOperationHandler implements Handler {
} catch (Throwable e) {
if (shouldPrintErrorLog(e)) {
invocation.getTraceIdLogger().error(LOGGER, "unexpected error {}, message={}",
- invocation.getInvocationQualifiedName(), e.getMessage());
+ invocation.getInvocationQualifiedName(),
+ org.apache.servicecomb.foundation.common.utils.ExceptionUtils.getExceptionMessageWithoutTrace(e));
}
invocation.onBusinessMethodFinish();
invocation.onBusinessFinish();
@@ -126,7 +127,8 @@ public class ProducerOperationHandler implements Handler {
} catch (Throwable e) {
if (shouldPrintErrorLog(e)) {
invocation.getTraceIdLogger().error(LOGGER, "unexpected error operation={}, message={}",
- invocation.getInvocationQualifiedName(), e.getMessage());
+ invocation.getInvocationQualifiedName(),
+ org.apache.servicecomb.foundation.common.utils.ExceptionUtils.getExceptionMessageWithoutTrace(e));
}
invocation.onBusinessMethodFinish();
invocation.onBusinessFinish();
diff --git a/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/java/org/apache/servicecomb/demo/multiServiceCenterClient/Application.java b/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/java/org/apache/servicecomb/demo/multiServiceCenterClient/Application.java
index 6998697..e435308 100644
--- a/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/java/org/apache/servicecomb/demo/multiServiceCenterClient/Application.java
+++ b/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/java/org/apache/servicecomb/demo/multiServiceCenterClient/Application.java
@@ -36,7 +36,7 @@ public class Application {
public static void main(final String[] args) throws Exception {
new SpringApplicationBuilder().sources(Application.class)
- .web(WebApplicationType.SERVLET).build().run(args);
+ .web(WebApplicationType.NONE).build().run(args);
runTest();
}
diff --git a/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/resources/application.yml b/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/resources/application.yml
index ebba6a0..6fbd422 100644
--- a/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/resources/application.yml
+++ b/demo/demo-multi-service-center/demo-multi-service-center-client/src/main/resources/application.yml
@@ -15,9 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-server:
- port: 8084
-
# java-chassis configurations
APPLICATION_ID: demo-multi-service-center
service_description:
@@ -29,8 +26,6 @@ servicecomb:
address: http://127.0.0.1:30100
registry-serverB:
address: http://127.0.0.1:40100
- rest:
- address: 0.0.0.0:8084
handler:
chain:
diff --git a/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/java/org/apache/servicecomb/demo/zeroconfig/tests/Application.java b/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/java/org/apache/servicecomb/demo/zeroconfig/tests/Application.java
index 5bd9920..1341ab2 100644
--- a/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/java/org/apache/servicecomb/demo/zeroconfig/tests/Application.java
+++ b/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/java/org/apache/servicecomb/demo/zeroconfig/tests/Application.java
@@ -29,7 +29,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
public class Application {
public static void main(final String[] args) throws Exception {
- new SpringApplicationBuilder().sources(Application.class).web(WebApplicationType.SERVLET)
+ new SpringApplicationBuilder().sources(Application.class).web(WebApplicationType.NONE)
.build().run(args);
runTest();
diff --git a/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/resources/application.yml b/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/resources/application.yml
index 541af06..9d610e0 100644
--- a/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/resources/application.yml
+++ b/demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-tests/src/main/resources/application.yml
@@ -15,9 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-server:
- port: 8084
-
# java-chassis configurations
APPLICATION_ID: demo-zeroconfig-schemadiscovery-registry