spring Sping Boot 应用程序失败,localhost格式不正确

x4shl7ld  于 2023-06-28  发布在  Spring
关注(0)|答案(1)|浏览(125)

我有基本的Sping Boot 应用程序与Spring Cloud。当我尝试运行时,出现错误:

2020-02-27 18:52:29.542 ERROR [main] o.s.boot.SpringApplication - Application run failed
java.lang.IllegalArgumentException: "http://localhost:8445" is malformed

为什么会这样呢?如何修复它?

yh2wf1be

yh2wf1be1#

我希望你得到了解决方案,但这将帮助别人。
当我们在spring Boot www.example.com文件中添加属性值时application.properties,应该没有双引号(“”)。如果你在双引号中提到它将抛出一个异常。

payment.host="http://localhost:9090"

这将抛出

java.lang.IllegalArgumentException: "http://localhost:9090" is malformed

但当我们删除双引号应用程序将运行没有任何错误。

payment.host=http://localhost:9090

Tomcat已在以下端口上启动:8080(http)与上下文路径

相关问题