You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by di...@apache.org on 2002/01/03 22:45:19 UTC

cvs commit: jakarta-slide/src/doc howto-j2eestore.xml

dirkv       02/01/03 13:45:19

  Added:       src/doc  howto-j2eestore.xml
  Log:
  J2EE Store Howto
  converted from README by Colin Britton
  
  Revision  Changes    Path
  1.1                  jakarta-slide/src/doc/howto-j2eestore.xml
  
  Index: howto-j2eestore.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!DOCTYPE document [
    <!ENTITY project SYSTEM "stylesheets/project.xml">
  ]>
  
  <document>
  
    &project;
  
    <properties>
          <author email="cbritton@metatomix.com">Colin Britton</author>
          <title>J2EE Store Howto</title>
      </properties>
    
    <body>
    
    <section name="Building the store">
      <p>In order to use the J2EE stores you need to build Jakarta-Slide with the Datasource 
      classes available.
      They are included in JDK1.4 but earlier versions require an additional library 
      (jdbc2_0-stdext.jar) in the slide lib directory. </p>
    </section>
  
    <section name="Configuring Slide">
      <p>In order to use the stores, the Domain.xml file needs to contain the following configuration for the store:
  <pre>
  &lt;definition&gt;
      &lt;store name="j2ee"&gt;
          &lt;nodestore classname="slidestore.j2ee.J2EEDescriptorsStore"&gt;
              &lt;parameter name="datasource"&gt;jdbc/mtx&lt;/parameter&gt;
          &lt;/nodestore&gt;
          &lt;securitystore&gt;
              &lt;reference store="nodestore"/&gt;
          &lt;/securitystore&gt;
          &lt;lockstore&gt;
              &lt;reference store="nodestore"/&gt;
          &lt;/lockstore&gt;
          &lt;revisiondescriptorsstore&gt;
              &lt;reference store="nodestore"/&gt;
          &lt;/revisiondescriptorsstore&gt;
          &lt;revisiondescriptorstore&gt;
              &lt;reference store="nodestore"/&gt;
          &lt;/revisiondescriptorstore&gt;
          &lt;contentstore classname="slidestore.j2ee.J2EEContentStore"&gt;
              &lt;parameter name="datasource"&gt;jdbc/mtx&lt;/parameter&gt;
          &lt;/contentstore&gt;
      &lt;/store&gt;
      &lt;scope match="/" store="j2ee"/&gt;
  &lt;/definition&gt;
  </pre>
    </p>
    </section>
  
    <section name="Configuring Tomcat 4.x">
      <p>In order to use this with Tomcat you need to setup the datasource. 
      Instructions for this are at 
      <a href="http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html">
      http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html</a>.
      </p>
      <p>If you follow the above instructions you will make changes similar to the 
      following in web.xml and server.xml.</p>
  <p>
  <pre>
  web.xml
  &lt;resource-ref&gt;
      &lt;description&gt;Testing Tomcat-wide datasource usage&lt;/description&gt;
      &lt;res-ref-name&gt;jdbc/mtx&lt;/res-ref-name&gt;
      &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
  &lt;/resource-ref&gt;
  
  server.xml
  &lt;DefaultContext debug="99"&gt;
      &lt;Resource name="jdbc/mtx" auth="Container" type="javax.sql.DataSource"/&gt;
      &lt;ResourceParams name="jdbc/mtx_system"&gt;
          &lt;parameter&gt;
              &lt;name&gt;user&lt;/name&gt;
              &lt;value&gt;bar&lt;/value&gt;
          &lt;/parameter&gt;
          &lt;parameter&gt;
              &lt;name&gt;password&lt;/name&gt;
              &lt;value&gt;foo&lt;/value&gt;
          &lt;/parameter&gt;
          &lt;parameter&gt;
              &lt;name&gt;driverClassName&lt;/name&gt;
              &lt;value&gt;com.jnetdirect.jsql.JSQLDriver&lt;/value&gt;
          &lt;/parameter&gt;
          &lt;parameter&gt;
              &lt;name&gt;driverName&lt;/name&gt;
              &lt;value&gt;jdbc:JSQLConnect://localhost/test&lt;/value&gt;
          &lt;/parameter&gt;
      &lt;/ResourceParams&gt;
  &lt;/DefaultContext&gt;
  </pre>
  </p>
    </section>
  
    <section name="Troubleshooting">
    <p>A couple of general notes in case you encounter problems.</p>
  
    <p>It is important that the only jndi.jar, naming.jar and jdbc.jar's and 
    your jdbc driver are in the %CATALINA_HOME%/common/libs and/or %CATALINA_HOME%/libs folders.</p>
  
    <p>If slide loads any of the classes from its own classloder it will either 
    not find the tomcat datasource or it will fail to load the DB drivers.</p>
  
    <p>With Tomcat 4.0.1 the standard implementation provides a datasource which 
    has pooling. It has no configured limits, it will grow as required and lazily 
    shrinks to reduce its size. Tomcat also has the capability to support 
    other datasource implementations and may offer one based on the Apache commons 
    DBCP pool implementationin a future release.</p>
    </section>
  
  </body>
  </document>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>