我如何使用Eclipse调试Web应用程序? [英] How can I debug Web Application with Eclipse?
问题描述
我想调试我的大学队友的web应用程序,因为我正在开发android应用程序,它将与web应用程序进行交互。
我正在使用debug透视和与ororid或普通Java应用程序我没有问题..但与Web应用程序我无法调试..我把breackpoints和调试作为Web应用程序在调试的角度来看......但它不起作用...
这是我的控制台
初始化App Engine服务器
30-dic-2012 20.06.21 com.google.apphosting.utils.jetty.JettyLogger info
INFO:通过com.google记录到JettyLogger(null) .apphosting.utils.jetty.JettyLogger
30-dic-2012 20.06.33 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO:已成功处理C:\Users\alfo888_ibg\ workspace\TablePlus\war\WEB-INF / appengine-web.xml
30-dic-2012 20.06.34 com.google.apphosting.utils.config.Abstrac tConfigXmlReader readConfigXml
INFO:已成功处理C:\ Users \alfo888_ibg\workspace\TablePlus\war\WEB-INF / web.xml
30-dic-2012 20.06.44 com。 google.apphosting.utils.jetty.JettyLogger info
INFO:jetty-6.1.x
30-dic-2012 20.06.48 com.google.appengine.api.datastore.dev.LocalDatastoreService init
INFO:初始化本地数据存储:
类型:高复制
存储:C:\ Users \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ local_db.bin
30-dic-2012 20.06.49 com.google.appengine.api.datastore.dev.LocalDatastoreService加载
INFO:加载数据存储的时间:297 ms
30-dic- 2012 20.06.53 com.google.apphosting.utils.jetty.JettyLogger info
INFO:Started SelectChannelConnector@0.0.0.0:8888
30-dic-2012 20.06.53 com.google.appengine.tools。 development.DevAppServerImpl start
INFO:服务器在本地主机上运行:8888
30-dic-2012 20.06.53 com。 google.appengine.tools.development.DevAppServerImpl start
INFO:管理控制台在localhost上运行:8888 / _ah / admin
$ b $上面的解决方案看起来不错,但是也需要通过JPDA端口(例如,http:// www。在下面的端口4000上通过运行时参数进行设置)。
例如,在Tomcat或Jetty上运行Web应用程序之前,需要设置java opts:
如果您通过控制台运行Web应用程序,您可以执行以下操作:
set JAVA_OPTS = - Xdebug -Xnoagent -Djava.compiler = NONE -Xrunjdwp:transport = dt_socket,address = 4000,server = y,suspend = n
pre>
如果您在Tomcat上运行您的应用程序,那么您可以在您的tomcat配置中的Java选项卡的这些说明。 (请参阅下图)
Java选项:
-Xdebug - Xnoagent -Djava.compiler = NONE -Xrunjdwp:transport = dt_socket,address = 4000,server = y,suspend = n
然后从IDE开始,您可以运行调试器来调试端口4000上的目标VM。(如下面的屏幕截图所示)
此页面详细介绍了如何操作:
>
http://www.eclipsezone。 com / eclipse / forums / t53459.html
I would like to debug web application of my university mate because I am developing android application that it will interact with the web application.
I am using "debug" perspective and with andorid or normal Java application I don't have problem.. but with the web application I can't debug .. I put breackpoints and "debug as web application" in debug perspective... but it doesn't work...
It's my console
Initializing App Engine server
30-dic-2012 20.06.21 com.google.apphosting.utils.jetty.JettyLogger info INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger 30-dic-2012 20.06.33 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml INFO: Successfully processed C:\Users\alfo888_ibg\workspace\TablePlus\war\WEB-INF/appengine-web.xml 30-dic-2012 20.06.34 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml INFO: Successfully processed C:\Users\alfo888_ibg\workspace\TablePlus\war\WEB-INF/web.xml 30-dic-2012 20.06.44 com.google.apphosting.utils.jetty.JettyLogger info INFO: jetty-6.1.x 30-dic-2012 20.06.48 com.google.appengine.api.datastore.dev.LocalDatastoreService init INFO: Local Datastore initialized: Type: High Replication Storage: C:\Users\alfo888_ibg\workspace\TablePlus\war\WEB-INF\appengine-generated\local_db.bin 30-dic-2012 20.06.49 com.google.appengine.api.datastore.dev.LocalDatastoreService load INFO: Time to load datastore: 297 ms 30-dic-2012 20.06.53 com.google.apphosting.utils.jetty.JettyLogger info INFO: Started SelectChannelConnector@0.0.0.0:8888 30-dic-2012 20.06.53 com.google.appengine.tools.development.DevAppServerImpl start INFO: The server is running at localhost:8888 30-dic-2012 20.06.53 com.google.appengine.tools.development.DevAppServerImpl start INFO: The admin console is running at localhost:8888/_ah/admin
解决方案The above solution looks good, but will also need to attach to the server from the debugger through a JPDA port (ex. on setting it up via runtime arguments on port 4000 below).
For example.. before running your web application on Tomcat or Jetty, you need to set your java opts:
If you run your web application via the console you can do something like:
set JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n"
If you are running your application on Tomcat then you can these instructions of the "Java" tab in your tomcat config. (see image below)
Java options:
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
Then from the IDE you can run the debugger to debug the target VM on port 4000. (like in screenshot below)
This page shows you a little more in detail how to do it:
http://www.eclipsezone.com/eclipse/forums/t53459.html
这篇关于我如何使用Eclipse调试Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!