java IntelliJ IDEA:Tomcat 8.5.13 和 9.0.0.M19 — 工件部署期间出错。有关详细信息,请参阅服务器日志

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43354676/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 07:22:06  来源:igfitidea点击:

IntelliJ IDEA: Tomcat 8.5.13 and 9.0.0.M19 — Error during artifact deployment. See server log for details

javatomcatintellij-idea

提问by Wojciech Kope?

I can't understand what happened. There was no problem 2 days ago and now I can't deploy my applications. Any of it. The only thing I've done regarding network was plugging my laptop in other socket in the house using ethernet wire, nothing else. I tried almost every solution I found here and nothing helped.

我无法理解发生了什么。2 天前没有问题,现在我无法部署我的应用程序。任何一个。我在网络方面所做的唯一一件事就是使用以太网线将我的笔记本电脑插入房子的其他插座,没有别的。我几乎尝试了在这里找到的所有解决方案,但没有任何帮助。

Logs:

日志:

C:\servers\apache-tomcat-8.5.13\bin\catalina.bat run
[2017-04-11 06:19:51,636] Artifact TestJEE:war exploded: Server is not connected. Deploy is not available.
Using CATALINA_BASE:   "C:\Users\wojci\.IntelliJIdea2016.3\system\tomcat\Tomcat_8_5_13_TestJEE"
Using CATALINA_HOME:   "C:\servers\apache-tomcat-8.5.13"
Using CATALINA_TMPDIR: "C:\servers\apache-tomcat-8.5.13\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_112"
Using CLASSPATH:       "C:\servers\apache-tomcat-8.5.13\bin\bootstrap.jar;C:\servers\apache-tomcat-8.5.13\bin\tomcat-juli.jar"
11-Apr-2017 18:19:54.084 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.13
11-Apr-2017 18:19:54.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Mar 27 2017 14:25:04 UTC
11-Apr-2017 18:19:54.087 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.13.0
11-Apr-2017 18:19:54.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
11-Apr-2017 18:19:54.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
11-Apr-2017 18:19:54.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
11-Apr-2017 18:19:54.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_112\jre
11-Apr-2017 18:19:54.088 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_112-b15
11-Apr-2017 18:19:54.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
11-Apr-2017 18:19:54.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\wojci\.IntelliJIdea2016.3\system\tomcat\Tomcat_8_5_13_TestJEE
11-Apr-2017 18:19:54.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\servers\apache-tomcat-8.5.13
11-Apr-2017 18:19:54.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\wojci\.IntelliJIdea2016.3\system\tomcat\Tomcat_8_5_13_TestJEE\conf\logging.properties
11-Apr-2017 18:19:54.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
11-Apr-2017 18:19:54.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
11-Apr-2017 18:19:54.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
11-Apr-2017 18:19:54.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
11-Apr-2017 18:19:54.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
11-Apr-2017 18:19:54.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
11-Apr-2017 18:19:54.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
11-Apr-2017 18:19:54.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
11-Apr-2017 18:19:54.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\wojci\.IntelliJIdea2016.3\system\tomcat\Tomcat_8_5_13_TestJEE
11-Apr-2017 18:19:54.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\servers\apache-tomcat-8.5.13
11-Apr-2017 18:19:54.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\servers\apache-tomcat-8.5.13\temp
11-Apr-2017 18:19:54.093 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2.
11-Apr-2017 18:19:54.093 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
11-Apr-2017 18:19:54.093 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
11-Apr-2017 18:19:55.187 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2k  26 Jan 2017)
11-Apr-2017 18:19:55.560 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
11-Apr-2017 18:19:55.691 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
11-Apr-2017 18:19:55.745 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
11-Apr-2017 18:19:55.763 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
11-Apr-2017 18:19:55.802 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2418 ms
11-Apr-2017 18:19:55.982 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
11-Apr-2017 18:19:55.983 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.13
11-Apr-2017 18:19:56.185 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
11-Apr-2017 18:19:56.250 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
11-Apr-2017 18:19:56.382 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 578 ms
[2017-04-11 06:19:56,404] Artifact TestJEE:war exploded: Artifact is being deployed, please wait...
Connected to server
[2017-04-11 06:19:56,493] Artifact TestJEE:war exploded: Error during artifact deployment. See server log for details.
11-Apr-2017 18:20:06.205 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor C:\Users\wojci\.IntelliJIdea2016.3\system\tomcat\Tomcat_8_5_13_TestJEE\conf\Catalina\localhost\ROOT.xml
11-Apr-2017 18:20:06.968 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor C:\Users\wojci\.IntelliJIdea2016.3\system\tomcat\Tomcat_8_5_13_TestJEE\conf\Catalina\localhost\ROOT.xml has finished in 762 ms
11-Apr-2017 18:20:06.973 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\servers\apache-tomcat-8.5.13\webapps\manager
11-Apr-2017 18:20:07.084 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\servers\apache-tomcat-8.5.13\webapps\manager has finished in 112 ms
Disconnected from server

When i attempt to connect to "localhost:8080" i get a message about connection being REJECTED and "Disconnected from server" message in logs. There is nothing useful in the logs (no warnings/errors). This issue is in EVERY of my JEE applications.

当我尝试连接到“localhost:8080”时,我在日志中收到一条关于连接被拒绝的消息和“与服务器断开连接”的消息。日志中没有任何用处(没有警告/错误)。这个问题存在于我的每个 JEE 应用程序中。

As I said a tried many solutions from here EXCEPT the one with changing the value of %JAVA_OPTS% env var because I've got no 'setenv.bat' file anywhere in Tomcat directory and in Catalina.bat this variable seems to be set properly.
I'm quite new to this kind of technology and I am a little afraid to start tweaking around in stuff I don't know.

正如我所说,从这里尝试了许多解决方案,除了更改 %JAVA_OPTS% env var 的值的解决方案,因为我在 Tomcat 目录和 Catalina.bat 中的任何地方都没有“setenv.bat”文件,这个变量似乎设置正确.
我对这种技术很陌生,我有点害怕开始调整我不知道的东西。

What could be causing this issue? What are the possible solutions?

什么可能导致这个问题?可能的解决方案是什么?

回答by CrazyCoder

There appears to a be a deployment issue with the most recent Tomcat versions from IntelliJ IDEA. We have an open bug for that with the patched files attached that you can use to workaround the problem:

IntelliJ IDEA 的最新 Tomcat 版本似乎存在部署问题。我们有一个未解决的错误,附带了修补文件,您可以使用它来解决问题:

  • IDEA-171174Tomcat 9.0.0.M19: failed to deploy simple WAR artifact
  • IDEA-171174Tomcat 9.0.0.M19:无法部署简单的 WAR 工件

You can find the patched jarof IntelliJ IDEA Tomcat plug-in, replace <IDEA_HOME>/plugins/Tomcat/lib/tomcatIntegration.jarwith it.

可以找到IntelliJ IDEA Tomcat插件打补丁的jar包,替换掉<IDEA_HOME>/plugins/Tomcat/lib/tomcatIntegration.jar

The original issue is caused by this Tomcat bug:

原来的问题是由这个Tomcat bug引起的:

  • Bug 60949- unable to deploy/undeploy war file using the manager
  • 错误 60949- 无法使用管理器部署/取消部署War文件

This bug is resolved in the following Tomcat versions:

此错误已在以下 Tomcat 版本中得到解决:

  • 8.5.14 and later
  • 9.0.0.M20 and later
  • 8.5.14 及更高版本
  • 9.0.0.M20 及更高版本

It's recommended to either wait for/install the fixed Tomcat versions or to revert back to the versions which are not affected by the bug (5.8.12 and 9.0.0.M18), since the workaround for IntelliJ IDEA uses some dirty hacks to make it work with Tomcat 5.8.13 and 9.0.0.M19 which are affected by Bug 60949(broken JMX).

建议要么等待/安装修复的 Tomcat 版本,要么恢复到不受错误影响的版本(5.8.12 和 9.0.0.M18),因为 IntelliJ IDEA 的解决方法使用了一些肮脏的黑客来使它适用于受错误60949 (损坏的 JMX)影响的 Tomcat 5.8.13 和 9.0.0.M19 。