Web Browser does not launch automatically

Hi

  I am working on deploying a web app to a browser (default: firefox) using Idea 9.0.3 on Ubuntu 9.10.

  When I hit Run,

  1. Ant Build starts and completes successfully
  2. Tomcat starts and the following message is seen as the last of a series of messages in "output" under the"Server" tab.

30 Sep, 2010 2:12:14 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
30 Sep, 2010 2:12:14 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13751 ms


  Following this, I need to manually open up the browser, go to     Tomcat Web Application Manager at http://localhost:8080/manager/html to check if my app is deployed and then launch it from there.

  I was expecting that IDEA would automatically launch the Firefox browser with my web app deployed.

  Please find attached a few screenshots of my settings. Please let me know where I am going wrong.

  Any help is greatly appreciated.


Screenshot-Run-Debug Configurations.png
Screenshot-Run-Debug Configurations-startup-connection.png
Screenshot-Settings.png

10 comments

I have googled for answers to my question, also searched thru jetbrains forums - but could not find useful information to solve the problem. If someone could give me a few pointers to investigate, that would be great.

Thanks.

0

Your settings look good to me. Is there anything in the idea log files (located at ~/.IntelliJIdea90/system/log) that might provide a clue? Is there a possible permissions issue?

p.s. you are correct that IDEA should automatically launch the browser given your settings. I can say that it works on Windows. Never tried it on Linux.

0

I have the exact same problem on Windows XP with IDEA 9.03.  Not sure why its not working but would love to know.

0

Mark

  I never knew about the log file .IntelliJIdea90/system/log/idea.log. Thanks a lot for pointing it out.

  One error that I see is:

2010-09-29 14:16:47,898 [5333478]   INFO - tbrains.idea.tomcat.TomcatUtil - Cannot load /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml. /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml (No such file or directory)
com.intellij.execution.ExecutionException: Cannot load /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml. /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml (No such file or directory)

  There is no META-INF folder inside the "exploded" folder. Am I missing out something? Is this the cause of the problem?

Thanks.

0

This exception is harmless. Did you see 'Connected to server' message in 'output' panel of 'Run' toolwindow?

Mark

>

   I never knew about the log file .IntelliJIdea90/system/log/idea.log. Thanks a lot for pointing it out.

>

   One error that I see is:

>

2010-09-29 14:16:47,898    INFO - tbrains.idea.tomcat.TomcatUtil - Cannot load /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml. /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml (No such file or directory)
com.intellij.execution.ExecutionException: Cannot load /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml. /home/shaahul/mywebapp/mywebapp/exploded/META-INF/context.xml (No such file or directory)

>

   There is no META-INF folder inside the "exploded" folder. Am I missing out something? Is this the cause of the problem?

>

Thanks.

>

---
Original message URL: http://devnet.jetbrains.net/message/5273714#5273714



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

hi Nikolay

  I could not find the "Connected to Server" message in the "output" of "Run" window.

  These are the messages I get.

/usr/share/tomcat6/bin/catalina.sh run
1 Oct, 2010 4:02:40 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
1 Oct, 2010 4:02:40 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 706 ms
1 Oct, 2010 4:02:40 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
1 Oct, 2010 4:02:40 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
log4j:WARN Please initialize the log4j system properly.
1 Oct, 2010 4:02:48 PM liquibase.database.template.JdbcTemplate comment
INFO: Lock Database
1 Oct, 2010 4:02:48 PM liquibase.lock.LockHandler acquireLock
INFO: Successfully acquired change log lock
1 Oct, 2010 4:02:48 PM liquibase.parser.xml.XMLChangeLogHandler startElement
WARNING: /WEB-INF/liquibase/liquibase.xml is using schema version 1.6 rather than version 1.9
1 Oct, 2010 4:02:48 PM liquibase.database.AbstractDatabase getRanChangeSetList
INFO: Reading from `DATABASECHANGELOG`
1 Oct, 2010 4:02:48 PM liquibase.database.template.JdbcTemplate comment
INFO: Release Database Lock
1 Oct, 2010 4:02:48 PM liquibase.lock.LockHandler releaseLock
INFO: Successfully released change log lock
Loaded propertyLocator.properties Successfully..
Using properties from usePath = WEB-INF/properties/Laptop
PREFIX = /home/user9/mywebapp/mywebapp/exploded/WEB-INF/properties/Laptop
Using properties file: /home/user9/mywebapp/mywebapp/exploded/WEB-INF/properties/Laptop/logger-config.properties
Watch is set to: null
hibernate File = /home/user9/mywebapp/mywebapp/exploded/WEB-INF/hibernate.cfg.xml
InitServlet intialized
Loaded environment.properties Successfully..
1 Oct, 2010 4:03:02 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
1 Oct, 2010 4:03:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 21642 ms


  The "Deployment" window under "Run" window shows the name of the artifact to deploy at the server startup "mywebapp:Web exploded" with a green "ok" symbol - which makes me assume that the app has been successfully deployed. Following which I need to manually open the browser, go to the "Tomcat Manager" application and then start mywebapp.

0

I think the problem will be fixed in next EAP build.

hi Nikolay

>

   I could not find the "Connected to Server" message in the "output" of "Run" window.

>

   These are the messages I get.

>

/usr/share/tomcat6/bin/catalina.sh run
> 1 Oct, 2010 4:02:40 PM org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> 1 Oct, 2010 4:02:40 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 706 ms
> 1 Oct, 2010 4:02:40 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> 1 Oct, 2010 4:02:40 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
> log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
> log4j:WARN Please initialize the log4j system properly.
> 1 Oct, 2010 4:02:48 PM liquibase.database.template.JdbcTemplate comment
> INFO: Lock Database
> 1 Oct, 2010 4:02:48 PM liquibase.lock.LockHandler acquireLock
> INFO: Successfully acquired change log lock
> 1 Oct, 2010 4:02:48 PM liquibase.parser.xml.XMLChangeLogHandler startElement
> WARNING: /WEB-INF/liquibase/liquibase.xml is using schema version 1.6 rather than version 1.9
> 1 Oct, 2010 4:02:48 PM liquibase.database.AbstractDatabase getRanChangeSetList
> INFO: Reading from `DATABASECHANGELOG`
> 1 Oct, 2010 4:02:48 PM liquibase.database.template.JdbcTemplate comment
> INFO: Release Database Lock
> 1 Oct, 2010 4:02:48 PM liquibase.lock.LockHandler releaseLock
> INFO: Successfully released change log lock
> Loaded propertyLocator.properties Successfully..
> Using properties from usePath = WEB-INF/properties/Laptop
> PREFIX = /home/user9/mywebapp/mywebapp/exploded/WEB-INF/properties/Laptop
> Using properties file: /home/user9/mywebapp/mywebapp/exploded/WEB-INF/properties/Laptop/logger-config.properties
> Watch is set to: null
> hibernate File = /home/user9/mywebapp/mywebapp/exploded/WEB-INF/hibernate.cfg.xml
> InitServlet intialized
> Loaded environment.properties Successfully..
> 1 Oct, 2010 4:03:02 PM org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> 1 Oct, 2010 4:03:02 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 21642 ms

>

   The "Deployment" window under "Run" window shows the name of the artifact to deploy at the server startup "mywebapp:Web exploded" with a green "ok" symbol - which makes me assume that the app has been successfully deployed. Following which I need to manually open the browser, go to the "Tomcat Manager" application and then start mywebapp.

>

---
Original message URL: http://devnet.jetbrains.net/message/5273752#5273752



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Same problem here, using IDEA 9.0.4 on windows XP.

The problem started a few weeks ago, when I reinstalled my laptop.
Before that, everything worked fine, using the same IDEA version. I did switch to a more recent Tomcat though (6.0.32). Might this be the cause of the problem?

0

Just confirmed that it is the tomcat version.
Using Tomcat 6.0.20 (which I used before) my webapp is automatically loaded in the browser.
However, this does not happen when using Tomcat 6.0.32!

0

The problem is with context definitions. According to Tomcat docs Context elements may be explicitly defined:

  • In the
    $CATALINA_BASE/conf/context.xml
    file:   the Context element information will be loaded by all webapps.
  • In the   
    $CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default
      file: the Context element information will be loaded by all webapps of that   host.
  • In individual files (with a ".xml" extension) in the   
    $CATALINA_BASE/conf/[enginename]/[hostname]/
    directory.   The name of the file (less the .xml extension) will be used as the   context path. Multi-level context paths may be defined using #, e.g.   
    foo#bar.xml
    for a context path of
    /foo/bar
    . The   default web application may be defined by using a file called   
    ROOT.xml
    .
  • Only if a context file does not exist for the application in the   
    $CATALINA_BASE/conf/[enginename]/[hostname]/
    , in an individual   file at
    /META-INF/context.xml
    inside the application files. If   the web application is packaged as a WAR then   
    /META-INF/context.xml
    will be copied to   
    $CATALINA_BASE/conf/[enginename]/[hostname]/
    and renamed to   match the application's context path. Once this file exists, it will not be   replaced if a new WAR with a newer
    /META-INF/context.xml
    is   placed in the host's appBase.


The log message means idea falls to the step 4, but normally context xml should be resolved at step 3 (

$CATALINA_BASE/conf/Catalina/localhost/yourcontextname.xml)

With Tomcat 6.0.32 idea creates context.xml instead of  
yourcontextname.xml in that folder for unknown reasons. Also, i see idea deploys all the bundled applications, although corresponding checkbox is unset.


regards, Alex
0

Please sign in to leave a comment.