在ubuntu服务器中为Tomcat7设置JPDA [英] Setting up JPDA for Tomcat7 in ubuntu-server
问题描述
我正在尝试在ubuntu中为Tomcat7设置JPDA。
我已经使用apt-get方法来安装Tomcat7。
通过尝试编辑/ usr / share /tomcat7/startup.sh文件包含以下几行,我尝试使tomcat7进入调试模式并允许通过Eclipse进行远程调试。
I am attempting to setup the JPDA for Tomcat7 in ubuntu.
I have used the apt-get method of installing Tomcat7.
By attempting to edit the /usr/share/tomcat7/startup.sh file with the following lines I try to get tomcat7 to boot into debug mode and allow remote debugging via eclipse.
JPDA_TRANSPORT="dt_socket"
JPDA_ADDRESS="8000"
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
编辑startup.sh文件后,我使用以下方法重新启动tomcat7:
After editing the startup.sh file, I reboot tomcat7 using:
sudo service tomcat7 restart
然后尝试使用IP地址以eclipse连接到tomcat jpda端口8000。我从Eclipse收到连接被拒绝错误。
Then attempt to connect to the tomcat jpda in eclipse with the IP address and port 8000. I receive a "Connection Refused" error from Eclipse.
我试图使用startup.sh脚本而不是像我这样的服务可执行方法来手动启动tomcat7。以为startup.sh可能没有被调用。
I have attempted to manually start tomcat7 using the startup.sh script rather than the service executable method as I thought perhaps the startup.sh was not being called.
sudo ./startup.sh
此操作失败,并显示以下输出:
This failed with the following output:
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
touch: cannot touch `/usr/share/tomcat7/logs/catalina.out': No such file or directory
./catalina.sh: 389: ./catalina.sh: cannot create /usr/share/tomcat7/logs/catalina.out: Directory nonexistent
我还试图更改/etc/init.d/tomcat7中的启动脚本,因为我正在使用服务来启动/重新启动tomcat7,但无济于事...
I have also attempted to alter the startup script at /etc/init.d/tomcat7 as I am using service to start/restart tomcat7 to no avail...
我在做什么错了?
推荐答案
在Ubuntu 12.04+中有一个部分在 / etc / default / tomcat7
中是这样的:
In Ubuntu 12.04+ there is a section like this in /etc/default/tomcat7
:
# To enable remote debugging uncomment the following line.
# You will then be able to use a java debugger on port 8000.
#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
所以只需取消注释并运行 sudo服务tomcat7重新启动
。
So just uncomment it and run sudo service tomcat7 restart
.
这篇关于在ubuntu服务器中为Tomcat7设置JPDA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!