On Mon, April 21, 2008 10:55 am, Stefan Dirschnabel wrote:
> Hi,
>
> I experience a problem changing the context root path of my Tomcat 5.5.
> I deploy my application using a war file. Because the Application can
> now only be accessed using www.url.de/warfilename I changed the context
> root of my Tomcat. I just want the user to enter www.url.de to access
> the application. In fact it works almost perfect. The "www.url.de" is
> translated to the according subdirectory in the webapps folder and I can
> see the website.
If you want the user to access your webapp with www.url.de you should call
your webapps context ROOT. You can achieve this by moving the webapp from
webapps/mywebapp to webapps/ROOT. Remember to move the corresponding
context file as well, so move conf/Catalina/localhost/mywebapp.xml to
conf/Catalina/localhost/ROOT.xml.
>
> Almost, because my connection pooling which I realized with JNDI does
> not work anymore. It's interesting that the JNDI Lookup (and so the
> connection pooling) _still_ works if I use the old url
> www.url.de/warfilename. Just the access via the new url does not work.
> I get:
>
> javax.naming.NameNotFoundException: Name jdbc is not bound in this
> Context
>
> My context.xml in the META-INF:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/" docBase="warfilename" reloadable="true" >
>   <Resource name="jdbc/warfilename" type="javax.sql.DataSource"
>                maxActive="50" maxIdle="5" maxWait="10000"
>                username="user" password="password"
> driverClassName="com.mysql.jdbc.Driver"
>                url="jdbc:mysql://localhost/user" />
> </Context>
This file is only here for use in deployment. It will be copied to
conf/Catalina/localhost/webappname.xml. You should leave out the path
Attribute, since it will be determined by the name of the file.
>
>
> My context tag in the server.xml:
>
> <Context path="/"
>          docBase="warfilename"
>          reloadable="true" />
Context should be a file under conf/Catalina/localhost for each
context/webapp you install. This file should have configured the database
Resource, which you used above in META-INF/context.xml.

HTH
 Felix
>
>
> I really can't find the solution and searching the web for hours
> (days?!) now. I also tested the usage of globalnaming resources in the
> server.xml but no result - same problem. Shouldn't this be a familiar
> use case ^^
>
>
> Regards
> Stefan Dirschnabel
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to