Hi

I'm a bit of a newbie as far as cocoon is concerned but I am hoping someone
can shed some light on my perplexing problem.

I have been trying to get cocoon to connect to a database.  I have cocoon
serving static content and xsp pages which are transformed using stylesheets
into html for display.  I now want to drag some content for these xsp pages
from a mysql database.  I have followed some of the previous email
discussions on this list and think I have the bases covered as far as
configuration goes.  Unfortunately, upon adding the following to my
configuration, Tomcat seems to halt halfway through loading.  This is cured
by commenting out the "org.gjt.mm.mysql.Driver" line from web.xml.  I don't
know what the problem is when loading this driver.  My cocoon.xconf looks
like this (please don't judge me by the passwords):

<datasources>
        <jdbc name="mypool" logger="core.datasources.mypool">
                <pool-controller min="5" max="10"/>
                <dburl>jdbc:mysql://localhost:9002/pms</dburl>
                <user>jim</user>
                <password>jim</password>
        </jdbc>
</datasources>

My web.xml in WEBINF looks like this:

<init-param>
        <param-name>load-class</param-name>
        <param-value>
                <!--For mySQL:-->
        org.gjt.mm.mysql.Driver
        </param-value>
</init-param>

I have put the jar driver file containing the driver in my jdk\jre\lib\ext
directory and even tried unjaring it and putting the org... directory tree
in the classpath.  Nothing seems to work.  Following some previous threads
on the subject and can answer YES to the following that were posted by
Andrey Demchenko (but I do not really understand what the relevance of 3)
is):

1) You must have jdbc driver file in classpath
2) Check your cocoon.xconf
for <datasources>...</datasources> for pool configuration
3) See access.log for message like this
 DEBUG   (2002-03-26) 17:04.45:713   [access] (Unknown-URI)
Unknown-thread/Cocoon
Servlet: Trying to load class: org.gjt.mm.mysql.Driver

One extra point to note is that I have cocoon serving pages from
http://localhost:8080/mydir/ rather than from the cocoon directory.  I
achieved this by following the directions of Leigh Dodds tutorial on
ibm.com/developerWorks and creating a directory structure as follows:

Tomcat\WebApps\cocoon...(all the usual stuff in here)
              \mydir\mycontent
                    \WEB-INF
                    \cocoon.xconf

If you have read the tutorial you will know what I have done but basically I
created my on directory to hold my web app in the WebApps directory of
Tomcat and just coppied the WEB-INF directory and cocoon.xconf from the
cocoon directory to the one I created.  This allowed cocoon to work fine
until now.  Could it be that by doing this I am having problems with tomcat
trying to read in drivers twice from both web.xml files or something?  I
have tried many combinations of where to put the driver files and tried the
org.gjt.mm.mysql.Driver in both web.xml files (in the cocoon dir and mydir)
but still tomcat seems to hang half way through loading.  It wont even serve
its own homepage!

Can anybody help - this is desperate.  I am writing an app for my
dissertation and if I cant connect to a database then there goes any chance
of a decent degree!!!

Many thanks
Jim Harris


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to