Context Path in server.xml

I am running IDEA 4.5 and Tomcat 4.1.31. If I run my webapp from IDEA using Run option, TOmcat doesn't seem to recognize Context path which is pointing my web application outside Tomcat directory. I get Resource not available error.

IDEA seems to start Tomcat using catalina.bat. If I start Tomcat using start.bat outside IDEA everything seems works.

My web application is under D:\MyWebApplication\PSF\psf\target\webapp\WEB-INF directory.

Here is a snippet from server.xml. I am pointing to web.xml from D:\MyWebApplication\PSF\psf\target\webapp\WEB-INF directory under Run Configuation in IDEA.

The URL for my web application is
http://localhost/psf/do/Welcome.

server.xml
....................

............................. web.xml .................. psf /do/* ]]>

.............................

Is this a bug, Is there any work around for this problem.

I really appreciate all the help.

2 comments

We use multiple contexts as part of our server configuration. So far,
the best thing to do in that case is to have a plain-vanilla tomcat
server with the default server.xml. Then let IntelliJ do all the work
for you. This will prevent you from running more than one application
at a time, but everything else works great.

Norris Shelton
Sun Certified Java Programmer




Brunda Sathi wrote:

>I am running IDEA 4.5 and Tomcat 4.1.31. If I run my webapp from IDEA using Run option, TOmcat doesn't seem to recognize Context path which is pointing my web application outside Tomcat directory. I get Resource not available error.
>
>IDEA seems to start Tomcat using catalina.bat. If I start Tomcat using start.bat outside IDEA everything seems works.
>
>My web application is under D:\MyWebApplication\PSF\psf\target\webapp\WEB-INF directory.
>
>Here is a snippet from server.xml. I am pointing to web.xml from D:\MyWebApplication\PSF\psf\target\webapp\WEB-INF directory under Run Configuation in IDEA.
>
>The URL for my web application is
>http://localhost/psf/do/Welcome.
>
>server.xml
>...................
>
><Context className="org.apache.catalina.core.StandardContext"

cachingAllowed="true"

>charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>cookies="true" crossContext="true" debug="3"
>docBase="D:\All_Telcordia_Projects\PSF\psf\target\webapp"
>mapperClass="org.apache.catalina.core.StandardContextMapper"
>path="/psf" privileged="false" reloadable="true"
>override="true" swallowOutput="false" useNaming="true"
>wrapperClass="org.apache.catalina.core.StandardWrapper">

<Logger className="org.apache.catalina.logger.FileLogger"
debug="9" directory="logs"
prefix="localhost_psf_log." suffix=".txt"
timestamp="true" verbosity="1"/>

></Context>
>............................
>
>
>web.xml
>.................
>
><!-- Action Servlet Mapping -->

<servlet-mapping>
<servlet-name>psf</servlet-name>
<url-pattern>/do/*</url-pattern>
</servlet-mapping>

>
>............................
>
>Is this a bug, Is there any work around for this problem.
>
>I really appreciate all the help.
>

>

0

Sorry, this is an old post, but the first thing I saw was the docbase=... does not match the directory where the app is located.

0

Please sign in to leave a comment.