Chinaunix首页 | 论坛 | 博客
  • 博客访问: 535085
  • 博文数量: 298
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 3077
  • 用 户 组: 普通用户
  • 注册时间: 2019-06-17 10:57
文章分类

全部博文(298)

文章存档

2022年(96)

2021年(201)

2019年(1)

我的朋友

分类: Java

2022-03-28 11:39:24


点击(此处)折叠或打开


  1. 报错内容如下

  2. org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
  3.         at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)
  4.         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
  5.         at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
  6.         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
  7.         at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
  8.         at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
  9.         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
  10.         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
  11.         at com.alibaba.nacos.Nacos.main(Nacos.java:35)
  12.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  13.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  14.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  15.         at java.lang.reflect.Method.invoke(Method.java:483)
  16.         at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
  17.         at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
  18.         at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
  19.         at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
  20. Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
  21.         at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:124)
  22.         at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86)
  23.         at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:416)
  24.         at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:180)
  25.         at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)
  26.         at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
  27.         ... 16 common frames omitted
  28. (spring cloud alibaba from fhadmin.cn)

  29. 因为如果直接在bin目录下用鼠标双击startup.cmd启动的话,默认的是以cluster(集群)的方式启动,直接启动第一个会报Unable to start embedded Tomcat错误,改成单机启动:

  30. 用记事本打开bin目录下查看startup.cmd

  31. @echo off
  32. rem Copyright 1999-2018 Alibaba Group Holding Ltd.
  33. rem Licensed under the Apache License, Version 2.0 (the "License");
  34. rem you may not use this file except in compliance with the License.
  35. rem You may obtain a copy of the License at
  36. rem
  37. rem http://www.apache.org/licenses/LICENSE-2.0
  38. rem
  39. rem Unless required by applicable law or agreed to in writing, software
  40. rem distributed under the License is distributed on an "AS IS" BASIS,
  41. rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  42. rem See the License for the specific language governing permissions and
  43. rem limitations under the License.
  44. if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is & EXIT /B 1
  45. set "JAVA=%JAVA_HOME%\bin\java.exe"

  46. setlocal enabledelayedexpansion

  47. set BASE_DIR=%~dp0
  48. rem added double quotation marks to avoid the issue caused by the folder names containing spaces.
  49. rem removed the last 5 chars(which means \bin\) to get the base DIR.
  50. set BASE_DIR="%BASE_DIR:~0,-5%"

  51. set CUSTOM_SEARCH_LOCATIONS=file:%BASE_DIR%/conf/

  52. set MODE="standalone"
  53. set FUNCTION_MODE="all"
  54. set SERVER=nacos-server
  55. set MODE_INDEX=-1
  56. set FUNCTION_MODE_INDEX=-1
  57. set SERVER_INDEX=-1
  58. set EMBEDDED_STORAGE_INDEX=-1
  59. set EMBEDDED_STORAGE=""


  60. 把 set MODE="cluster" 改为 set MODE="standalone" 即可


阅读(754) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~