Tomcat CATALINA_BASE 指的是 C 盘,但我的 Tomcat 安装和配置是在 E 盘内

问题描述 投票:0回答:1

我正在 IntelliJ Idea Ultimate 上运行 Java EE 项目。但是,在运行项目时,我遇到以下错误。

这是我的 tomcat IntelliJ 应用程序服务器配置:

"E:\Software Development\Java Development\Servelts & JSP\apache-tomcat-9.0.85-windows-x64\apache-tomcat-9.0.85\bin\catalina.bat" run
[2024-04-16 11:30:54,189] Artifact customer-support:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Program Files\Apache Software Foundation\Tomcat 8.0"
Using CATALINA_HOME:   "E:\Software Development\Java Development\Servelts & JSP\apache-tomcat-9.0.85-windows-x64\apache-tomcat-9.0.85"
Using CATALINA_TMPDIR: "E:\Software Development\Java Development\Servelts & JSP\apache-tomcat-9.0.85-windows-x64\apache-tomcat-9.0.85\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk-21"
Using CLASSPATH:       "E:\Software Development\Java Development\Servelts & JSP\apache-tomcat-9.0.85-windows-x64\apache-tomcat-9.0.85\bin\bootstrap.jar;E:\Software Development\Java Development\Servelts & JSP\apache-tomcat-9.0.85-windows-x64\apache-tomcat-9.0.85\bin\tomcat-juli.jar"
Using CATALINA_OPTS:   ""
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Apr 16, 2024 11:30:55 AM org.apache.catalina.startup.Catalina parseServerXml
WARNING: Unable to load server configuration from [C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\server.xml]
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\conf\server.xml (The system cannot find the path specified)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:84)
    at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:180)
    at org.apache.catalina.startup.CatalinaBaseConfigurationSource.getResource(CatalinaBaseConfigurationSource.java:118)
    at org.apache.tomcat.util.file.ConfigurationSource.getConfResource(ConfigurationSource.java:150)
    at org.apache.tomcat.util.file.ConfigurationSource.getServerXml(ConfigurationSource.java:127)
    at org.apache.catalina.startup.CatalinaBaseConfigurationSource.getServerXml(CatalinaBaseConfigurationSource.java:52)
    at org.apache.catalina.startup.Catalina.parseServerXml(Catalina.java:606)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:709)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:307)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:477)

Apr 16, 2024 11:30:55 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server, server instance is not configured
Disconnected from server

我尝试在环境变量中设置一个新的 CATALINA_BASE 变量,但它不起作用。请给我找到一个解决方案,如何更新 CATALINA_BASE 的值以便它检测到正确的值。

我期望 CATALINA_BASE 值与 CATALINA_HOME 变量相同。我的C盘里面没有任何与Tomcat相关的东西。

intellij-idea servlets tomcat9 java-ee-8
1个回答
0
投票

幸运的是,我自己在IntelliJ Idea中的Application Server配置部分找到了答案。 只需将正确的tomcat安装路径粘贴到此处即可。

© www.soinside.com 2019 - 2024. All rights reserved.