尝试使用intellij进行部署时,服务器未连接 [英] Server is not connected when trying to deploy with intellij

查看:874
本文介绍了尝试使用intellij进行部署时,服务器未连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在intellij中构建,部署和调试我的webapp。

I am trying to build, deploy and debug my webapp inside intellij.

我使用这个答案设置了我的tomcat能够使服务器运行。问题是我的webapp没有被部署,尽管它是在部署标签中定义的。

I have setup my tomcat using this answer and I was able to get the server running. The issue is that my webapp is not being deployed, though it is defined in the deployment tab.

我收到以下错误:
服务器未连接。部署不可用

如果我复制战争并启动服务器,一切正常。使用端口8080和8000。

If I copy the war and start the server everything works Ok. With ports 8080 and 8000.

我做错了什么?

以防万一它与某种方式相关,该项目是用Maven& amp; Spring

Just in case it is somehow related, the project is build with Maven & Spring

我添加了服务器的运行/调试配置:

I added the Run/Debug Configuration for the Server:

服务器选项卡

部署选项卡

调试控制台输出:

D:\development\infra\appServers\apache-tomcat-7.0.47\bin\catalina.bat run
[2014-08-05 01:23:11,413] Artifact devstage:war exploded: Server is not connected. Deploy is not available.
Using CATALINA_BASE:   "C:\Users\chaim\.IntelliJIdea13\system\tomcat\Unnamed_devstage_4"
Using CATALINA_HOME:   "D:\development\infra\appServers\apache-tomcat-7.0.47"
Using CATALINA_TMPDIR: "D:\development\infra\appServers\apache-tomcat-7.0.47\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.7.0_45"
Using CLASSPATH:       "D:\development\infra\appServers\apache-tomcat-7.0.47\bin\bootstrap.jar;D:\development\infra\appServers\apache-tomcat-7.0.47\bin\tomcat-juli.jar"
Aug 05, 2014 1:23:12 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8.
Aug 05, 2014 1:23:12 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Aug 05, 2014 1:23:12 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)
Aug 05, 2014 1:23:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Aug 05, 2014 1:23:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Aug 05, 2014 1:23:12 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 902 ms
Aug 05, 2014 1:23:12 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 05, 2014 1:23:12 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Aug 05, 2014 1:23:12 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Aug 05, 2014 1:23:12 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Aug 05, 2014 1:23:12 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 35 ms
[2014-08-05 01:23:21,363] Artifact devstage:war exploded: Server is not connected. Deploy is not available.
Aug 05, 2014 1:23:22 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\development\infra\appServers\apache-tomcat-7.0.47\webapps\manager
[2014-08-05 01:23:38,311] Artifact devstage:war exploded: Server is not connected. Deploy is not available.


推荐答案

在我的情况下,这个问题是由于一个JAVA_OPTS catalina.bat(或catalina.sh)中定义的变量。

In my case, this problem was due to a JAVA_OPTS variable defined in catalina.bat (or catalina.sh).

我只评论了catalina.bat的第一行,一切都开始工作了。
以下是该行:

I only commented the first line of catalina.bat and everything started working. Here is the line :

set "JAVA_OPTS=-Xmx1024M -XX:MaxPermSize=512m -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true"

发表评论,把 rem 放在它前面。 rem 是在windows .bat文件中注释一行的方法。

To comment, put rem in front of it. rem is the way to comment a line in windows .bat files.

我认为此行与IntelliJ JAVA_OPTS设置冲突。事实上,IntelliJ尝试在tomcat上设置一个端口用作调试器,但catalina.bat JAVA_OPTS变量删除了此设置。

I suppose that this line conflicts with IntelliJ JAVA_OPTS settings. In fact, IntelliJ tries to set a port on tomcat to use as a debugger, but the catalina.bat JAVA_OPTS variable deleted this setting.

这篇关于尝试使用intellij进行部署时,服务器未连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆