cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Rolappe" <m_rola...@web.de>
Subject AW: Cocoon and MySQL
Date Sun, 02 Feb 2003 23:55:35 GMT
hi richard,

first point: don't be afraid to look at the logs yourself ;-) most of the
time they'll reveal what's going wrong. for example in the error.log you
attached:

ERROR   (2003-02-02) 22:45.52:747   [core] (Unknown-URI)
Unknown-thread/Cocoon: Could not configure Cocoon environment
org.xml.sax.SAXParseException: The element type "dburl" must be terminated
by the matching end-tag "</dburl>".
	at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHand
lerWrapper.java:232)
	at
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.ja
va:213)
	...

looking at the following:

> The following line I was unsure about:

> <dburl>jdbc:mysql://192.168.44.21:3306</dbrul>
                                          ^^^ this one's wrong ;-)

ok, next point:

> I got the localhost address from MySQL Admin - I'm not sure if this is
right? I uncommented these items from the my.ini file.

you can just use 'localhost' (assuming the db is running on the same
machine).

> I am also not sure about <jdbc name = "">.  I have tried researching this
but I'm still unsure.

you can name the datasource as you wish, e.g.:

        <jdbc name="emotion">
            <pool-controller max="10" min="5"/>
            <auto-commit>true</auto-commit>
            <dburl>jdbc:mysql://localhost/soundpool</dbrul> <!-- mysql
database soundpool must exist -->
            <user>r_cunliffe</user> <!-- mysql user r_cunliffe must
exist -->
            <password>????????</password>
        </jdbc>

of course, the data given in this configuration must correspond to your
database configuration. in the dburl you can leave out the port if you're
using the standard.

-----Ursprungliche Nachricht-----
Von: cocoon-users-return-46007-m_rolappe=web.de@xml.apache.org
[mailto:cocoon-users-return-46007-m_rolappe=web.de@xml.apache.org]Im Auftrag
von Richard Cunliffe
Gesendet: Sonntag, 2. Februar 2003 23:52
An: cocoon-users@xml.apache.org
Betreff: Cocoon and MySQL


(I have attached my cocoon and tomcat logs as Zip files)


Hi,

            MS Windows      XP
            Apache              2.0.43
            Tomcat             4.0.6
            Cocoon              2.0.4
            JDK                   1.3.1_06
            MySQL              3.23.55
            JDBC                 2.0.14


I am trying to connect to a MySQL database and have followed the
instructions provided by Flash Guides and Wiki, but cocoon does not start-up
after I edit the cocoon.xconf. If I comment out the inserted code, and
restart tomcat then cocoon will load.

I have download the JDBC file: mysql-connector-java-2.0.14.jar and have put
it in the following directories:


C:\tomcat\webapps\cocoon\WEB-INF\lib\mysql-connector-java-2.0.14-bin.jar
      C:\tomcat\lib\mysql-connector-java-2.0.14-bin.jar



The relevant part of web.xml looks like this:


     <init-param>
        <param-name>load-class</param-name>
        <param-value>
          <!-- For MySQL Driver: -->
        com.mysql.jdbc.Driver
        <!-- For Database Driver: -->
             org.hsqldb.jdbcDriver

        <!-- For parent ComponentManager sample:
        org.apache.cocoon.samples.parentcm.Configurator
        -->
        </param-value>
            </init-param>





The relevant part of cocoon.xconf looks like so:


  <!-- Datasources: -->
  <datasources>
    <jdbc logger="core.datasources.personnel" name="personnel">
      <!--
          If you have an Oracle database, and are using the the
      pool-controller below, you should add the attribute
      "oradb" and set it to true.

      <pool-controller min="5" max="10" oradb="true"/>

      That way the test to see if the server has disconnected
      the JdbcConnection will function properly.
      -->
      <pool-controller max="10" min="5"/>
      <!--
          If you need to ensure an autocommit is set to true or
      false, then create the "auto-commit" element below.

      <auto-commit>false</auto-commit>

      The default is true.
      -->
      <dburl>jdbc:hsqldb:hsql://localhost:9002</dburl>
      <user>sa</user>
      <password/>

      <jdbc name="personnel">
            <pool-controller min="5" max="10"/>
            <auto-commit>true</auto-commit>
            <dburl>jdbc:mysql://192.168.44.21:3306/soundpool</dbrul>
            <user>r_cunliffe</user>
            <password>????????</password>
      </jdbc>


      </jdbc>
  </datasources>



The following line I was unsure about:

<dburl>jdbc:mysql://192.168.44.21:3306</dbrul>

I got the localhost address from MySQL Admin - I'm not sure if this is
right? I uncommented these items from the my.ini file.

I am also not sure about <jdbc name = "">.  I have tried researching this
but I'm still unsure.



On the Flash Guide it suggested that I should delete the following
directory, which I have done:

C:\tomcat\work\Standalone\localhost\cocoon

But it recreates itself.

What can you suggest? Is there anything on the MySQL side I should be
checking?



Thanks,

Richard.


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

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message