问题描述
我正在尝试部署在Tomcat上运行的Java Web应用程序.我有书
I'm trying to deploy a Java web application running on Tomcat. I got the book
我已经做了一切使IntelliJ IDEA 13与Tomcat 8.0.9协同工作的事情.我已经手动测试了服务器容器,它工作得很好,即使部署.war文件也可以工作得很好.但是,当我继续从IntelliJ启动/调试Web应用程序时(在本例中为本书的第一个示例),该应用程序将无法启动.Tomcat日志中的输出内容不多.
and I've done everything said to get IntelliJ IDEA 13 work together with Tomcat 8.0.9. I've tested the server container manually and it works great, even deploying .war files works great. However when i move on to start/debug a web application - in this case the first example form the book - from IntelliJ the application wont start. The output in the Tomcat Log doesn't say much.
服务器输出告诉我这一点:
Server output tells me this:
Connected to server
[2014-08-08 09:17:35,075] Artifact Sample-Debug-IntelliJ:war exploded: Artifact is being deployed, please wait...
[2014-08-08 09:17:35,097] Artifact Sample-Debug-IntelliJ:war exploded: Error during artifact deployment. See server log for details.
[2014-08-08 09:17:35,098] Artifact Sample-Debug-IntelliJ:war exploded: com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: L:\java-dev\java_web_apps_chapter_code\9781118656464 Full Code\Chapter 02\Sample-Debug- IntelliJ\target\sample-debug-intellij-1.0.0.SNAPSHOT not found for the web module.
08-Aug-2014 21:17:44.671 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager
08-Aug-2014 21:17:44.939 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager has finished in 268 ms
Tomcat Catalina日志输出如下:
Tomcat Catalina Log output this:
08-Aug-2014 22:56:35.843 INFO [main] org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache Tomcat Native library 1.1.30 using APR version 1.4.8.
08-Aug-2014 22:56:35.846 INFO [main] org.apache.catalina.core.AprLifecycleListener.init APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
08-Aug-2014 22:56:36.652 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.1g 7 Apr 2014)
08-Aug-2014 22:56:36.738 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"]
08-Aug-2014 22:56:36.746 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
08-Aug-2014 22:56:36.747 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1060 ms
08-Aug-2014 22:56:36.771 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
08-Aug-2014 22:56:36.771 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.9
08-Aug-2014 22:56:36.778 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
08-Aug-2014 22:56:36.784 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
08-Aug-2014 22:56:36.785 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 38 ms
08-Aug-2014 22:56:46.785 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager
08-Aug-2014 22:56:47.035 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory L:\java-dev\apache-tomcat-8.0.9\webapps\manager has finished in 251 ms
我曾经在Windows和OSX上都尝试过,但两者的故事却完全相同,而错误却完全相同.
I've tried on both Windows and OSX and it's the same story on both with the exact same error.
当我访问 http://localhost:8080/
时,我可以看到服务器已启动并正在运行.但是,该应用程序尚未部署.
When i access http://localhost:8080/
i can see that the server is up and running. However, the application isn't deployed.
有人遇到与我相同的错误和/或知道解决方案吗?
Anyone experiencing the same error as me and/or know a solution?
我正在运行IntelliJ IDEA 13.0.3,Java 1.8.0_11和Tomcat 8.0.9.
I'm running IntelliJ IDEA 13.0.3, Java 1.8.0_11 and Tomcat 8.0.9.
我也尝试了IntelliJ IDEA 13.1.4.没什么区别.
I've also tried with IntelliJ IDEA 13.1.4. Didn't make any difference.
- 下载了Java 1.8.0_11,将其安装并添加到环境变量中.
-
下载了Tomcat,将其解压缩并对其进行了以下更改(步骤2-4);在
conf/tomcat-users.xml
中,我添加了该用户:
<user username="admin" password="admin" roles="manager-gui,admin-gui" />
在 conf/web.xml
中,我在 org.apache.jasper.servlet.jspServlet
元素
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.8</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.8</param-value>
</init-param>
<init-param>
<param-name>compiler</param-name>
<param-value>modern</param-value>
</init-param>
下载了apache-ant,并使用以下脚本在 apache-tomcat/bin
目录中添加了 setenv.bat
文件
export CLASSPATH=L:/java-dev/jdk8/lib/tools.jar:L:/java-dev/apache-ant/lib/ant.jar:L:/java-dev/apache-ant/lib/ant-launcher.jar
启动IntelliJ并添加了Tomcat应用程序服务器.
Started IntelliJ and added the Tomcat application server.
然后我导入了项目,并将其设置为使用我刚刚添加的Tomcat服务器.
Then i imported the project and set it to use the Tomcat server that I just added.
更新时间:2014-08-09 16:22
我试图部署一个由IntelliJ创建的JavaEE Web应用程序,并且该应用程序可以立即运行.本书所引用的源代码似乎有问题.
UPDATE: 2014-08-09 16:22
I tried to deploy a JavaEE web application that IntelliJ created itself, and that worked right away. Seems like it's something wrong with the source code that the book references.
推荐答案
我遇到了类似的问题.问题出在运行/调试配置"中的工件配置中.我必须删除项目工件并阅读它.重要的是选择"Web应用程序:爆炸,来自模块...
I had similar problem. The problem was in artifact configuration in Run/Debug Configurations. I had to remove the project artifact and readd it. The important thing is to choose Web Application: Exploded, From Modules...
您可以阅读我的博客帖子,其中包含有关此问题的屏幕截图.
You can read my blog post that contains screenshots about this issue.
这篇关于IntelliJ IDEA 13.0.3和Tomcat 8.0.9.不能让它工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!