简单的Jprofiler设置无法正常工作 [英] Simple Jprofiler setup not working
问题描述
我正在尝试启动并运行一个简单的本地主机JProfiler会话。我创建了会话,主机是127.0.0.1,端口是默认的8849,我已经将启动/关闭命令指向我的本地tomcat安装startup.sh/shutdown.sh。我点击确定,我得到连接到127.0.0.1:8849,150秒后(我修改了超时)它超时并说:
I'm trying to get a simple, localhost session of JProfiler up and running. I've created the session, the host is 127.0.0.1, the port is the default 8849, and I've pointed the startup/shutdown commands to my local tomcat installation startup.sh/shutdown.sh. I click OK and I get "Connecting to 127.0.0.1:8849" and after 150 seconds (I modified the timeout) it times out and says:
无法连接到127.0.0.1:8849。请确保远程地址正确,远程程序正确启动,并且网络路由允许套接字连接。
Could not connect to 127.0.0.1:8849. Please make sure that the remote address is correct, the remote program is started properly, and the network route allows socket connections.
地址不可能出错,并且我已经验证了(ps -ef | grep tomcat)进程已启动,并且还检查了tomcat日志并且它正在等待请求:
The address can't possibly be wrong, and I've verified (ps -ef|grep tomcat) that the process is up, and also checked the tomcat log and it's waiting for requests:
INFO: Starting Coyote HTTP/1.1 on http-8080
Apr 15, 2011 7:49:13 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 15, 2011 7:49:13 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/21 config=null
Apr 15, 2011 7:49:13 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 47312 ms
打开端口还需要做些什么吗?例如,我应该修改传递给tomcat的JAVA_OPTS吗?
Is there something else I need to do to open the port? For instance am I supposed to modify the JAVA_OPTS that get passed to tomcat?
推荐答案
是的。
你需要这样的东西(适用于OS X)
Yes. you need something like this (for OS X)
export JAVA_OPTS="-agentlib:jprofilerti=port=8849 \
-Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar"
export DYLD_LIBRARY_PATH=/Applications/jprofiler5/bin/macos
通常在JProfiler中通过向导配置新会话时,它会告诉您需要输入的确切参数。
Usually when you configure a new session through the wizard in JProfiler, it will tell you those exact parameters that you need to put in.
对我来说,这个向导是StartCenter - > New Session,然后选择New remote integration。
这将询问本地/远程,启动模式,jvm类型,分析端口,并在第6页上说执行必要的修改并列出那些。
For me this wizard is StartCenter -> New Session , then select "New remote integration". This will then ask local/remote , startup mode, jvm type, profiling port and on page 6 says "Perform required modifications" and it lists those.
或者,您可以从菜单栏中选择集成向导。
Alternatively you can select "Integration wizard" from the menu bar.
这篇关于简单的Jprofiler设置无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!