将 jar 发布到多台服务器的 shell bash 脚本 问题 解决: #!/bin/bash #./deploy.sh root@a.com b@c.com build() { mvn -verbose mvn -DskipTests=true clean package } upload() { SITE=$1 echo $SITE; scp target/r.jar $SITE:/home/app/temp/ scp -r target/lib/ $SITE:/home/app/temp/ ssh $SITE 'mv /home/app/temp/r.jar /home/app/run/r.jar ' ssh $SITE 'rm -rdf /home/app/run/lib/ && mv /home/app/temp/lib/ /home/app/run/ ' PSAUX=$(ssh $SITE ps aux | grep -i r.jar | grep java | grep -v bash) PID=$(echo $PSAUX | awk 'RS {print $2 }') if [ -n $PID ]; then echo "kill -9 $PID" ssh $SITE "kill -9 $PID" sleep 5 fi echo " start ..." ssh $SITE 'cd /home/app/run && nohup java -jar /home/app/run/r.jar >/home/app/run/app.log 2>&1 & ' } build for i in $@ do upload "$i" done 123456789101112131415161718192021222324252627282930 #!/bin/bash#./deploy.sh root@a.com b@c.com build() { mvn -verbose mvn -DskipTests=true clean package}upload() { SITE=$1 echo $SITE; scp target/r.jar $SITE:/home/app/temp/ scp -r target/lib/ $SITE:/home/app/temp/ ssh $SITE 'mv /home/app/temp/r.jar /home/app/run/r.jar ' ssh $SITE 'rm -rdf /home/app/run/lib/ && mv /home/app/temp/lib/ /home/app/run/ ' PSAUX=$(ssh $SITE ps aux | grep -i r.jar | grep java | grep -v bash) PID=$(echo $PSAUX | awk 'RS {print $2 }') if [ -n $PID ]; then echo "kill -9 $PID" ssh $SITE "kill -9 $PID" sleep 5 fi echo " start ..." ssh $SITE 'cd /home/app/run && nohup java -jar /home/app/run/r.jar >/home/app/run/app.log 2>&1 & '} buildfor i in $@do upload "$i"done &… Read More
Spring Feign java.lang.IllegalStateException: Ambiguous mapping 问题: Java Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'thelook.client.flipcoin.FlipcoinClient' method public abstract thelook.client.flipcoin.FlipcoinClient$AllocateResp thelook.client.flipcoin.FlipcoinClient.allocate(int,int) to {GET /v1/allocate, consumes [application/json;charset=UTF-8], produces [application/json;charset=UTF-8]}: There is already 'thelook.client.facade.FacadeClient' bean method public abstract thelook.client.facade.FacadeClient$AllocateResp thelook.client.facade.FacadeClient.allocate(java.lang.String,java.lang.String,java.lang.String) mapped. at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:618) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:586) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:312) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$1(AbstractHandlerMethodMapping.java:282) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$$Lambda$1107.0000000059D7B820.accept(Unknown Source) at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:280) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.processCandidateBean(AbstractHandlerMethodMapping.java:252) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:211) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:199) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:164) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774) ... 89 more 123456789101112131415161718 Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'thelook.client.flipcoin.FlipcoinClient' method public abstract thelook.client.flipcoin.FlipcoinClient$AllocateResp thelook.client.flipcoin.FlipcoinClient.allocate(int,int)to {GET /v1/allocate, consumes [application/json;charset=UTF-8], produces [application/json;charset=UTF-8]}: There is already 'thelook.client.facade.FacadeClient' bean methodpublic abstract thelook.client.facade.FacadeClient$AllocateResp thelook.client.facade.FacadeClient.allocate(java.lang.String,java.lang.String,java.lang.String) mapped. at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:618) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:586) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:312) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$1(AbstractHandlerMethodMapping.java:282) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$$Lambda$1107.0000000059D7B820.accept(Unknown Source) at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:280) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.processCandidateBean(AbstractHandlerMethodMapping.java:252) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:211) at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:199) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:164) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774) ... 89 more R… Read More
docker service update docker service update --mount-add 'type=bind,source=/opt/d1,target=/var/data' *** 1 docker service update --mount-add 'type=bind,source=/opt/d1,target=/var/data' *** &… Read More
【转】综合Twitter、Github等各大网站API设计经验:RESTful API实用设计与最佳实践 – Vinay Sahni https://www.jdon.com/53510 综合Twitter、Gith… Read More
maven Failure to find **** was cached in the local repository, resolution will not be reattempted until the update interval of dahezi-release has elapsed or updates are forced 问题: Failure to find thelook:commons-java:pom:0.1… Read More