我正在尝试使用 intellij 12 配置 tomcat 7,但没有成功。
如果我从命令行运行 catalina.sh 启动脚本,tomcat 可以正常启动,我可以看到 tomcat 主页。
如果我从 Intellij 运行 tomcat,我会得到以下堆栈跟踪(来自 intellijs 日志文件):
2013-03-20 21:11:48,631 [1065007] DEBUG - .util.AbstractConnectorCommand -
javax.management.InstanceNotFoundException: Catalina:type=Server at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:668)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1442)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:75)
.....................
看起来它找不到任何tomcat实例。
我在 intellij 的输出日志中没有收到任何错误,在 intellij 中配置 tomcat 时也没有错误。
输出日志:/Library/Tomcat/bin/catalina.sh 运行
Mar 20, 2013 9:11:48 PM 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: /Users/rana/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Mar 20, 2013 9:11:48 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 20, 2013 9:11:48 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mar 20, 2013 9:11:48 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 482 ms
Mar 20, 2013 9:11:48 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 20, 2013 9:11:48 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.37
Mar 20, 2013 9:11:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 20, 2013 9:11:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 20, 2013 9:11:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 37 ms
Connected to server
Mar 20, 2013 9:11:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/apache-tomcat-7.0.37/webapps/manager
有谁知道为什么会这样?