You can pass environment variable values to custom Java properties. For example, if you define a variable MY_ENV_VAR, you can pass it to the foo property as follows:
-Dfoo= M Y E N V V A R 可 以 在 w i n d o w s 上 配 置 文 件 的 路 径 , 然 后 用 环 境 变 量 {MY_ENV_VAR} 可以在windows上配置文件的路径,然后用环境变量 MYENVVAR可以在windows上配置文件的路径,然后用环境变量{const}来设置参数。
Exception in thread “main” java.lang.AbstractMethodError: org.springframework.boot.context.config.ConfigFileApplicationListener.supportsSourceType(Ljava/lang/Class;)Z
ssl socket
-Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty
-Dzookeeper.client.secure=true
-Dzookeeper.ssl.keyStore.location=E:\keystore.jks
-Dzookeeper.ssl.keyStore.password=password
-Dzookeeper.ssl.trustStore.location=E:\truststore.jks
-Dzookeeper.ssl.trustStore.password=password
java.lang.InternalError: java.io.FileNotFoundException: null\lib\currency.data (系统找不到指定的路径。)
解决办法:
If you want to a a property, do this instead:
System.getProperties().put(“SOME_KEY”, “SOME_VALUE”);
or
Map myCustomMapOfProps = …
System.getProperties().putAll(myCustomMapOfProps);
java.lang.NoClassDefFoundError: org/apache/curator/framework/CuratorFrameworkFactory
添加依赖:
org.apache.curator
curator-recipes
4.0.1
reading-java-system-properties-from-command-line?
jcmd 24614 VM.system_properties
错误:A component required a bean named ‘dubbo’ that could not be found.
解决:
dubbo.protocol.name=dubbo 已经配置导致的 重复配置导致的
*/
@Service(version = “${demo.service.version}”,dynamic = true)
错误:
org.apache.dubbo.rpc.RpcException: No provider available from registry
locahost:2281 for service com.tangxin.dubbo.remote.DemoService
on consumer 192.168.1.3 use dubbo version 2.7.1, please check status of providers
(disabled, not registered or in blacklist).
服务消费方没有给指定版本号version
错误使用
@Reference(check = false) //check启动时检查提供者是否存在 true报错,false忽略
private DemoService demoService;
修改成如下:
@Reference(check = false,version="${dubbo.server.version}") //check启动时检查提供者是否存在 true报错,false忽略
private DemoService demoService;
错误:
java.lang.IllegalStateException: Serialized class com.tangxin.dubbo.domain.UserInfo must implement java.io.Serializable
解决办法:
实体类实现implement java.io.Serializable