tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Stepanenko" <andrew.stepane...@gmail.com>
Subject Re: Struggling with basic database connection
Date Sat, 23 Sep 2006 11:59:00 GMT
Hello,

looks like the docs I gave a link to describe the old approach, sorry.
Here is what I have in my context.xml:

######
<!-- The contents of this file will be loaded for each web application -->
<Context path="" docBase="/export/home/andrews/dev/unfas/web"
debug="1" reloadable="true">

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/unfasHB" auth="Container" scope="Shareable"
type="javax.sql.DataSource"
            factory="org.apache.commons.dbcp.BasicDataSourceFactory"
        url="jdbc:mysql://localhost:3306/unfas?useUnicode=true&amp;characterEncoding=UTF-8&amp;characterSetResults=UTF-8"
            driverClassName="com.mysql.jdbc.Driver"
            username="andrews"
            password="xxx"
            maxIdle="5"
            maxActive="50"
            autoReconnect="true"
    />
</Context>
#####

also, the format of <Resource> has been changed. Now, all
configuration data should be provided as attributes and not nested
tags.

Regards,
Andrew Stepanenko,
http://unf.tane.edu.ua

On 9/23/06, Alan Chandler <alan@chandlerfamily.org.uk> wrote:
> On Saturday 23 September 2006 09:57, Andrew Stepanenko wrote:
> > Hello,
> >
> > there is a difference between how resources are defined in 5.0 and
> > 5.5. In 5.0 you could provide your resource definitions right in the
> > server.xml, but in 5.5 you need to create a separate context.xml file
> > ($CATALINA_HOME/conf/Catalina/<hostname>/context.xml) and put resource
> > definitions there.
> > See this link:
> > http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
> >
> > I also had this problem when migrating from 5.0 to 5.5. After I
> > defined a separate context.xml it started to work again.
>
> The docs seem very vague on this issue,  but it does imply that I could still
> use $CATALINA_HOME/conf/server.xml
>
> One question that isn't answered in the docs is what the root element should
> be - the best seems to be the example for accessing a database, and even
> there it puts <Context ...>
>
> I tried with context.xml in the directory you mentioned and it said it
> couldn't find the webapp "context", so I renamed it to my application and
> tried again.  But it didn't work.
>
> So still stumped
>
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Andrew Stepanenko,
Ph.D. student,
Dept. of Information Computing Systems and Control,
Web: http://www.tanet.edu.te.ua/icsc/
Software engineer,
Ukrainian-Dutch Faculty of Economics and Management
Ternopil State Economic University
Shevchenko Street 9, Office 24-25
Ternopil, 46000 UKRAINE
Tel: +38 (0352) 43 52 41
fax: +38 (0352) 43 52 45
Web: http://unf.tane.edu.ua

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


Mime
View raw message