home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / faq-databases.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  4.6 KB  |  145 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <!DOCTYPE faqs PUBLIC "-//APACHE//DTD FAQ V1.0//EN" "faq-v10.dtd">
  18.  
  19. <faqs title="Database FAQs">
  20. <faq>
  21.   <question>
  22.     When I try to use the Connection pooling code, I get the following exception:
  23.     "Could not get the datasource java.sql.SQLException: You cannot
  24.     get a Poolable before the pool is initialized".  What's going on?
  25.   </question>
  26.   <answer>
  27.     <p>
  28.       The most common reason for this exception is that the driver was not loaded.
  29.       Cocoon uses an initial parameter in the "web.xml" file to automatically load
  30.       classes on startup.  This way, the class is loaded only once and the server's
  31.       time is spent doing more productive things.  Make sure the following entry
  32.       is in your "web.xml" file.
  33.     </p>
  34.  
  35.     <source><![CDATA[
  36. <init-param>
  37.  <param-name>load-class</param-name>
  38.  <param-value>
  39.    <!-- comma or whitespace separated list of fully
  40.      qualified class names to load on startup.
  41.    -->
  42.    oracle.jdbc.driver.OracleDriver
  43.  </param-value>
  44. </init-param>
  45. ]]></source>
  46.  
  47.     <p>
  48.       If the class is loaded correctly, and you are still getting this error, then there
  49.       is probably an error in your connection information.  The SQLException
  50.       above is thrown when there are no open connections to the database.
  51.     </p>
  52.   </answer>
  53. </faq>
  54.  
  55. <faq>
  56.  <question>
  57.    The sql samples don't run.
  58.  </question>
  59.  <answer>
  60.    <p>
  61.      The sql samples are working when deploing the war file using the build
  62.      system:</p>
  63.        <source>
  64. ./build.sh \
  65.    -Dinstall.war=path/to/tomcat/webapps install
  66. </source>
  67.  
  68.    <p>
  69.      This command will take care of the path inside the configuration file to the database resources.
  70.    </p>
  71.  </answer>
  72. </faq>
  73.  
  74. <faq>
  75.  <question>
  76.    I've been able to run the database samples, but they don't run anymore.
  77.  </question>
  78.  <answer>
  79.    <p>
  80.     This happens when the servlet engine has been stopped abruptly (e.g. with ctrl-C).
  81.    </p>
  82.    <p>
  83.     Hsqldb - the database used by C2 samples - is a single-process engine that
  84.     locks the database by setting the "modified" entry in
  85.     "WEB-INF/db/cocoondb.properties" to the value "yes" while some JDBC
  86.     connections exist. 
  87.    </p>
  88.    <p>
  89.     With connection pooling, there's always some connections opened, and they're
  90.     not closed properly when you stop abruptly the servlet engine, so the database
  91.     stays in locked state and connections are refused at the next server startup.
  92.    </p>
  93.    <p>
  94.     To unlock the database, change manually "modified" to "no" in the "cocoondb.properties"
  95.     before restarting the server.
  96.    </p>
  97.  </answer>
  98. </faq>
  99.  
  100. <faq>
  101.  <question>
  102.    I get an AbstractMethodError when Cocoon tries to query my database.
  103.  </question>
  104.  <answer>
  105.    <p>
  106.     In this case Cocoon returns a "500 internal error" result, and the 
  107.     AbstractMethodError is visible in the tomcat logs after a call to
  108.     Connection.prepareStatement(...).
  109.    </p>
  110.    <p>
  111.     This happens when the JDBC driver being used does not implement the
  112.     JDBC 1.2 interfaces: using its default configuration, the SQLTransformer 
  113.     calls a version of the JDBC Connection.prepareStatement(...) method that is not
  114.     available in pre-1.2 drivers.
  115.    </p>
  116.    <p>
  117.     To avoid this problem, configure the SQLTransformer with "old-driver=true" in the
  118.     sitemap, as shown in this example:
  119.    </p>
  120.     
  121.         <source><![CDATA[
  122.         <map:transformer 
  123.           logger="sitemap.transformer.sql" 
  124.           name="sql" 
  125.           src="org.apache.cocoon.transformation.SQLTransformer"
  126.         >
  127.           <old-driver>true</old-driver>
  128.         </map:transformer> 
  129.         ]]></source>
  130.  </answer>
  131. </faq>
  132.  
  133. <faq>
  134.  <question>
  135.    Where can I find more information about connecting to databases using Cocoon?
  136.  </question>
  137.  <answer>
  138.   <p>
  139. Learn more about connecting to databases by downloading the free chapter, <link href="http://www.newriders.com/books/product.asp?product_id={C3C05052-BE3B-4E06-A60A-13FB40AF58F6}" >A User's Look at the Cocoon architecture,</link> from Langham and Ziegeler's <em>Cocoon: Building XML Applications</em> available at the New Riders web site.
  140.   </p>
  141. </answer>
  142. </faq>
  143.  
  144. </faqs>
  145.