HI Astghik

1. Don't put <Context ... /> elements in server.xml.  They should go
into files named ROOT.xml in /etc/tomcat6/Catalina/localhost and
/etc/tomcat6/Catalina/www.myip.com.  While your at it, drop the docbase
and path attributes ... they aren't needed when the Context element is
in it's own xml file.

2. Rename myapp in /var/lib/tomcat6/webapps from myapp to ROOT.  ROOT is
a special name for the default webapp and defined in the servlet spec. 
Between this and the first suggestion, both localhost and www.myip.com
should be showing your "myapp" webapp as the default webapp (no /myapp
in the url).

3. Don't point two host elements at the same appBase.  Either have two
separate appbases, one for each host and keep two copies of the webapp
or use an Alias element and have only one <Host ...> element.  See
http://tomcat.apache.org/tomcat-6.0-doc/config/host.html for more
information on the Alias directive.

4. I don't see anything here that has any impact on database
connectivity ... actually don't see any database configuration here at
all.  Could you include some info on your hibernate setup for "myapp"?

--David

On 8/13/10 7:03 AM, Astghik wrote:
> Hello All.
>
> I have Apache Tomcat 6 server running on Ubuntu 9.10. . I've changed my
> application context path http://myip:8080/myapp to http://myip:8080 by
> making changes in server.xml.
>
> <Engine name="Catalina" defaultHost="localhost">
> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> resourceName="UserDatabase"/>
> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"
> xmlValidation="false" xmlNamespaceAware="false">
> <Context path="" docBase="myapp" debug="0"/>
> </Host>
> <Host name="www.myip.com" appBase="/var/lib/tomcat6/webapps">
> <Context path="" docBase="myapp"/>
> </Host>
> </Engine>
>
> But I got another problem, all images (there are in
> /var/lib/tomcat6/webapps/myapp/img dir) are broken and "An error occurred:
> org.springframework.dao.DataAccessResourceFailureE xception: could not
> execute query; nested exception is
> org.hibernate.exception.JDBCConnectionException: could not execute query"
> exception is throwing.
>
> How to fix those problems?
>
> Regards,
> Astghik
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to