最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

解決spring cloud服務啟動之后回到命令行會自動掛掉問題

 更新時間:2020年09月17日 09:59:00   作者:Lovnx  
這篇文章主要介紹了解決spring cloud服務啟動之后回到命令行會自動掛掉問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

我們的spring cloud微服務一般是打成jar包發(fā)布的,Linux下啟動jar包和windows下一樣,都是java -jar 包名,實際操作過的小伙伴可能會遇到這種情況:用java -jar啟動之后,再切回到命令行服務會掛掉,怎么解決呢?使用nohup命令就不會了!

例:

jar包:

micro-service/micro-eureka-server-0.0.1-SNAPSHOT.jar

啟動命令:

ohup java -jar micro-service/micro-eureka-server-0.0.1-SNAPSHOT.jar &

啟動之后用 ctrl+c 回到命令行就不會掛掉了,想要看看啟動起來沒有可以查看進程:

ps -ef | grep eureka

當然,我們也可以在啟動的時候指定某些配置:

指定端口號:

nohup java -jar micro-service/micro-eureka-server-0.0.1-SNAPSHOT.jar --server.port=8888 &

其他的依葫蘆畫瓢…

補充知識:springcloud創(chuàng)建統(tǒng)一配置后不能正常啟動

我就廢話不多說了,大家還是直接看代碼吧~

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-02-13 20:58:10.919 ERROR 22052 --- [      main] o.s.boot.SpringApplication        : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'sp.user-service.users' in value "${sp.user-service.users}"
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE]
	at cn.tedu.sp03.Sp03UserserviceApplication.main(Sp03UserserviceApplication.java:11) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'sp.user-service.users' in value "${sp.user-service.users}"
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:403) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:636) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	... 19 common frames omitted
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'sp.user-service.users' in value "${sp.user-service.users}"
	at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:908) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1228) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:636) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	... 30 common frames omitted

以上這篇解決spring cloud服務啟動之后回到命令行會自動掛掉問題就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

  • Java如何實現(xiàn)支付寶電腦支付基于servlet版本

    Java如何實現(xiàn)支付寶電腦支付基于servlet版本

    這篇文章主要介紹了Java如何實現(xiàn)支付寶電腦支付基于servlet版本,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下
    2019-11-11
  • Spring事務失效的8大原因詳解

    Spring事務失效的8大原因詳解

    這篇文章主要介紹了Spring事務失效的8大原因詳解,這里以 MySQL 為例,其 MyISAM 引擎是不支持事務操作的,InnoDB 才是支持事務的引擎,一般要支持事務都會使用 InnoDB,需要的朋友可以參考下
    2023-09-09
  • 詳解springboot中mybatis注解形式

    詳解springboot中mybatis注解形式

    在本文中小編給大家分享了關于springboot中mybatis注解形式的介紹,有興趣的可以跟著學習下。
    2018-10-10
  • Spring Cache框架應用介紹

    Spring Cache框架應用介紹

    我們一定聽說過"緩存無敵"的話,特別是在大型互聯(lián)網(wǎng)公司,"查多寫少"的場景屢見不鮮。Spring Cache是作用在方法上的,其核心思想是,當我們在調用一個緩存方法時會把該方法參數(shù)和返回結果作為一個鍵值對存在緩存中
    2022-09-09
  • javafx 如何將項目打包為 Windows 的可執(zhí)行文件exe

    javafx 如何將項目打包為 Windows 的可執(zhí)行文件exe

    文章介紹了三種將JavaFX項目打包為.exe文件的方法:方法1使用jpackage(適用于JDK14及以上版本),方法2使用Launch4j(適用于所有JDK版本),方法3使用InnoSetup(用于創(chuàng)建安裝包),每種方法都有其特點和適用范圍,可以根據(jù)項目需求選擇合適的方法,感興趣的朋友一起看看吧
    2025-01-01
  • 解決mybatis-plus3.4.1分頁插件PaginationInterceptor和防止全表更新與刪除插件SqlExplainInterceptor過時失效問題

    解決mybatis-plus3.4.1分頁插件PaginationInterceptor和防止全表更新與刪除插件SqlE

    這篇文章給大家介紹了在Spring.xml文件中配置mybatis-plus3.4.1分頁插件PaginationInterceptor和防止全表更新與刪除插件SqlExplainInterceptor過時失效問題解決方案,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友參考下吧
    2020-12-12
  • Java通過正則表達式獲取域名簡單示例

    Java通過正則表達式獲取域名簡單示例

    在Java中可以使用正則表達式來從字符串中匹配和提取域名,下面這篇文章主要給大家介紹了關于Java通過正則表達式獲取域名的相關資料,文中通過代碼介紹的非常詳細,需要的朋友可以參考下
    2023-12-12
  • Java使用ReentrantLock進行加解鎖的示例代碼

    Java使用ReentrantLock進行加解鎖的示例代碼

    在多線程編程中,為了確保多個線程在訪問共享資源時不會發(fā)生沖突,我們通常需要使用 鎖 來同步對資源的訪問,本文將深入探討如何優(yōu)雅地使用 ReentrantLock,避免常見的坑點,并提升代碼的可維護性,需要的朋友可以參考下
    2025-04-04
  • spring hibernate實現(xiàn)動態(tài)替換表名(分表)的方法

    spring hibernate實現(xiàn)動態(tài)替換表名(分表)的方法

    下面小編就為大家?guī)硪黄猻pring hibernate實現(xiàn)動態(tài)替換表名(分表)的方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-08-08
  • Java通過反射將 Excel 解析成對象集合實例

    Java通過反射將 Excel 解析成對象集合實例

    這篇文章主要介紹了Java通過反射將 Excel 解析成對象集合實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-08-08

最新評論

民丰县| 双城市| 吉木萨尔县| 故城县| 东海县| 黄骅市| 林西县| 申扎县| 巴里| 深水埗区| 华蓥市| 茂名市| 阳城县| 佛山市| 宜兴市| 嘉义县| 高雄市| 灯塔市| 通山县| 霍州市| 西峡县| 天门市| 驻马店市| 张家港市| 东兰县| 大田县| 绥芬河市| 孝义市| 剑川县| 郯城县| 高陵县| 隆化县| 山阳县| 德钦县| 读书| 三明市| 屯门区| 绥化市| 德清县| 重庆市| 大兴区|