java -jar 启动时哪些参数必须指定?

Java 未结 1 2017

java -jar 启动时哪些参数必须指定?


java -Duser.timezone=GMT+08 -Djava.security.egd=file:/dev/./urandom  -Dfile.encoding=UTF-8 -jar app.jar --spring.profiles.active=dev  --spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 --spring.cloud.nacos.config.namespace=public --spring.cloud.nacos.config.server-addr=127.0.0.1:8848 --spring.cloud.nacos.config.group=DEFAULT_GROUP


报错读不到配置


java.lang.IllegalStateException: dbType not support : null, url ${blade.datasource.test.url}

        at com.alibaba.druid.wall.WallFilter.init(WallFilter.java:167)

        at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:827)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1903)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1846)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)

        at

1条回答
  • 2019-06-27 13:45

    你的启动环境变量和读取数据库的配置变量不匹配。

    再看下详细的错,是不是win部署的,是win的话把nacos配置里的中文注释删掉

    0 讨论(0)
提交回复