From 65c2f55617e9fe632ef78b7e7af5c22c4e44ed41 Mon Sep 17 00:00:00 2001 From: nkorange Date: Tue, 9 Jul 2019 11:04:00 +0800 Subject: [PATCH] Fix standalone use derby failed bug --- .../com/alibaba/nacos/client/naming/utils/UtilAndComs.java | 2 +- .../config/server/service/LocalDataSourceServiceImpl.java | 6 +++++- distribution/bin/startup.sh | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java index 137724cbf..06f1f7f02 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java @@ -20,7 +20,7 @@ package com.alibaba.nacos.client.naming.utils; */ public class UtilAndComs { - public static final String VERSION = "Nacos-Java-Client:v1.0.1"; + public static final String VERSION = "Nacos-Java-Client:v1.1.1"; public static String WEB_CONTEXT = "/nacos"; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java index 31d6dca77..a45f08618 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java @@ -22,6 +22,7 @@ import com.alibaba.nacos.config.server.utils.StringUtils; import org.apache.commons.dbcp.BasicDataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.stereotype.Service; @@ -61,6 +62,9 @@ public class LocalDataSourceServiceImpl implements DataSourceService { private JdbcTemplate jt; private TransactionTemplate tjt; + @Autowired + private PropertyUtil propertyUtil; + @PostConstruct public void init() { BasicDataSource ds = new BasicDataSource(); @@ -86,7 +90,7 @@ public class LocalDataSourceServiceImpl implements DataSourceService { tm.setDataSource(ds); tjt.setTimeout(5000); - if (STANDALONE_MODE && !PropertyUtil.isStandaloneUseMysql()) { + if (STANDALONE_MODE && !propertyUtil.isStandaloneUseMysql()) { reload(); } } diff --git a/distribution/bin/startup.sh b/distribution/bin/startup.sh index ed3278c45..1054beb49 100644 --- a/distribution/bin/startup.sh +++ b/distribution/bin/startup.sh @@ -105,7 +105,7 @@ else fi JAVA_OPT="${JAVA_OPT} -Dnacos.home=${BASE_DIR}" -JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/target/${SERVER}.jar" +JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins/health -jar ${BASE_DIR}/target/${SERVER}.jar" JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}" JAVA_OPT="${JAVA_OPT} --spring.config.location=${CUSTOM_SEARCH_LOCATIONS}" JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/nacos-logback.xml"