title: Configure tomcat 7 in intellij
body: <p>I'm trying to configure tomcat 7 with intellij 12 but with no success.</p>
  
  <p>If I run the catalina.sh startup script from command line, tomcat starts properly and I can see tomcat homepage.</p>
  
  <p>If I run tomcat from Intellij, I get the following stacktrace (from intellijs log-file):</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>..............</p>
  
  <p>Looks like it cannot find any instance of tomcat.</p>
  
  <p>I do not get any errors in the output log in intellij, and no errors when configuring tomcat in intellij.</p>
  
  <p>Output-log:
  /Library/Tomcat/bin/catalina.sh run</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Does anyone know why this is happening?</p>