由于在调试时直接取消部署,因此无法进行Java Web应用程序调试

时间:2010-03-23 00:30:33

标签: java debugging netbeans

当我尝试调试我的webapp时,它启动了tomcat服务器和应用程序,但在应用程序可用之前不久就关闭了调试器。虽然应用程序一直在运行,但在它再次消失之前我会看到调试工具栏一秒钟。

Tomcat的日志:

Listening for transport dt_socket at address: 11555
23.03.2010 01:24:35 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
23.03.2010 01:24:35 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
23.03.2010 01:24:35 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 847 ms
23.03.2010 01:24:35 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
23.03.2010 01:24:35 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
23.03.2010 01:24:41 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
23.03.2010 01:24:41 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
23.03.2010 01:24:41 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/78  config=null
23.03.2010 01:24:41 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5855 ms
23.03.2010 01:24:42 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context []
23.03.2010 01:24:45 org.apache.catalina.core.StandardContext start
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] has already been started

调试日志:

Attached JPDA debugger to localhost:11555
Checking data source definitions for missing JDBC drivers...
Deploying JDBC driver to /Applications/NetBeans/apache-tomcat-6.0.20/lib/mysql-connector-java-5.1.6-bin.jar
Stopping Tomcat process...
Waiting for Tomcat...
Tomcat server stopped.
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
Undeploying ...
OK - Undeployed application at context path /
In-place deployment at /path/to/project/dir/build/web
deploy?config=file%3A%2Fvar%2Ffolders%2FZP%2FZPbqxGrbHFaUlXzAfgWV1%2B%2B%2B%2BTQ%2F-Tmp-%2Fcontext734173871283203218.xml&path=/
OK - Deployed application at context path /
start?path=/
Start is in progress...
OK - Started application at context path /
debug-display-browser:
Browsing: http://localhost:8084/
connect-client-debugger:
BUILD SUCCESSFUL (total time: 18 seconds)

系统是MacOS 10.6.2上的Netbeans 6.8。

2 个答案:

答案 0 :(得分:1)

您应该看看TC服务器是否仍处于调试模式。最简单的方法是调试 - >将调试器附加到localhost; 11555。如果它仍在运行'debuggable',你将能够以这种方式进行相当多的调试。

答案 1 :(得分:1)

我有类似的问题,调试开始但有点立即停止。但是,该应用程序已部署。即使Tomcat在调试模式下运行,我甚至无法手动附加到调试器。通过创建一个简单的可调试hello world项目并开始调试,它也使调试器能够打破我的“问题项目”的断点。但这不是真正的工作方式。

我的问题是通过从我的web项目中删除mysql-connector-java.jar来“解决”。我没有看到任何推理,但它现在只是起作用。仅供参考,Netbean的Tomcat配置属性“启用JDBC驱动程序部署”没有效果。

我的环境是Netbeans 6.9.1,项目类型是maven2,在Win7上运行。