User: tobias
Date: 01/01/09 17:04:29
Modified: documentation oraclecmp.htm
Log:
removed the instructions for donwloading and installing minerva as minerva is
already included into JBoss 2.0-Final. This thing is still outdated. Someone should
check it from top to bottom.
Revision Changes Path
1.3 +16 -11 newsite/documentation/oraclecmp.htm
Index: oraclecmp.htm
===================================================================
RCS file: /products/cvs/ejboss/newsite/documentation/oraclecmp.htm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- oraclecmp.htm 2001/01/08 05:33:11 1.2
+++ oraclecmp.htm 2001/01/10 01:04:29 1.3
@@ -11,6 +11,9 @@
<h2>JBoss CMP Quick Start using JBoss 2.0 and Oracle</h2>
<p>Author: Ewan Branda<br>
Last revised: July 11, 2000</p>
+<hr>
+This guide is a little bit outdated. At the moment we are reorganizing the
documentation and we will take care of this piece too. Meanwhile I made some slight
adjustments to this guide, which were probably NOT sufficient to make it 100% correct
again. Good luck. (TF 2001/01/08)
+<hr>
<p>This guide should help you to quickly get JBoss 2.0 up and running
using container-managed persistence and Oracle. With minor modifications you can use
the same example with any database. It should be used in conjunction with the
documents <i>Beginning EJB programming using jBoss</i> and <i>Using container-managed
persistence with jBoss</i> available at the <a href="http://www.jboss.org">JBoss</a>
web site (click on "Getting Started" under "How To").</p>
<p>In order to get JBoss up and running you have to do the
following basic procedures: </p>
<ol>
@@ -25,9 +28,9 @@
<ol type="1">
<li>If you are not running Java 1.3 then download it from <a
href="http://java.sun.com">http://java.sun.com</a> and install it. JBoss only works
with version 1.3 of the java VM.
<li>Download the jboss 2.0 distribution from <a
href="http://www.jboss.org">http://www.jboss.org</a>.
- <li>Download the minerva.jar archive from <a
href="http://www.jboss.org">http://www.jboss.org</a>.
+<!-- outdated TF 2001/01/09 <li>Download the minerva.jar archive from <a
href="http://www.jboss.org">http://www.jboss.org</a>.-->
<li>Run the JBoss installer and point it to the 1.3 VM when
prompted. The remainder of this document will refer to the JBoss installation
directory as <em>$JBOSS_ROOT</em> .
- <li>Copy the minerva.jar archive to the
<i>$JBOSS_ROOT/lib/ext</i> directory
+<!-- outdated TF 2001/01/09 <li>Copy the minerva.jar archive to the
<i>$JBOSS_ROOT/lib/ext</i> directory -->
</ol>
<p>
<hr>
@@ -36,7 +39,7 @@
<ol>
<li>Edit the <em>$JBOSS_ROOT/conf/jboss.conf</em> file. You
need to add <code><MLET></code> tags for each data source you are using. These
notes assume that you are using the Minerva connection pooler (installed in the steps
above). Here is an example entry for an oracle data source:
<p><code><MLET
CODE="org.jboss.jdbc.XADataSourceLoader"
ARCHIVE="jboss.jar,minerva.jar" CODEBASE="../lib/ext/"><br>
- <ARG TYPE="java.lang.String"
VALUE="MyConnectionPool"><br>
+ <ARG TYPE="java.lang.String"
VALUE="OracleDB"><br>
<ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl"><br>
<ARG TYPE="java.lang.String"
VALUE="jdbc:oracle:thin:@localhost:1521:orcl"><br>
<ARG TYPE="java.lang.String"
VALUE="theUsername"><br>
@@ -46,7 +49,7 @@
<ARG TYPE="java.lang.Integer"
VALUE="5"></code><code><br>
<ARGTYPE="java.lang.String"VALUE="GCEnabled=true;ShrinkingEnabled=true;GCMinIdleTime=30000;GCInterval=10000;ShrinkMinIdleTime=30000"><br>
</MLET></code></p>
- <p>Note that the name specified in the first attribute tag
above ("MyConnectionPool" in this example) will be the name used to refer to
the data source in the <i>meta-inf/jboss.xml</i> (discussed later). The third argument
is the database connection url and should be in the standard JDBC url format for that
driver. Refer to the <a href="http://www.jboss.org">Minerva documentation</a> (select
the "Minerva" link at left) for a discussion of JDBC driver types and tag
formats.</p>
+ <p>Note that the name specified in the first attribute tag
above ("OracleDB" in this example) will be the name used to refer to the
data source in the <i>meta-inf/jboss.xml</i> (discussed later). The third argument is
the database connection url and should be in the standard JDBC url format for that
driver. Refer to the <a href="http://www.jboss.org">Minerva documentation</a> (select
the "Minerva" link at left) for a discussion of JDBC driver types and tag
formats.</p>
<p>An example <i>jboss.conf</i> file can be found <a
href="#jboss_conf_xml">here</a>.</p>
<li>
<p>Edit the <em>$JBOSS_ROOT/conf/jboss.properties</em> file.
You need to add any JDBC drivers you are using to the <i>jdbc.drivers</i> property.
Here is an example entry:</p>
@@ -58,19 +61,21 @@
<h3>EJB Deployment</h3>
<ol>
<li>Create a <i>jaws.xml</i> configuration file. This file
specifies details about the data source. It "imports" the data source into
the EJB application context. Immediately below the <code><jaws></code>
tag insert the following code:
-
<p><code><datasource>xa.MyConnectionPool</datasource><br>
+ <p><code><datasource>OracleDB</datasource><br>
<type-mapping>MyOracleTypeMapping</type-mapping>
</code></p>
- <p>Note that the <code>datasource</code> attribute
("MyConnectionPool" in this case) corresponds to the name attribute in the
<code><MLET></code> tag you added to the jboss.conf file. The
"<code>xa.</code>" is required. "MyOracleTypeMapping" is the
name of the type mapping configuration specified later in the same file.
See the example code for details.</p>
+ <p>Note that the <code>datasource</code> attribute
("OracleDB" in this case) corresponds to the name attribute in the
<code><MLET></code> tag you added to the jboss.conf file.
+<!-- outdated TF 2001/01/09 The "<code>xa.</code>" is required.
+--> "MyOracleTypeMapping" is the name of the type mapping
configuration specified later in the same file. See the example code
for details.</p>
<p>You should include datatype mappings (java to SQL) for the
datasource you are using (see the example file). In addition, you may optionally
include object-to-relational mapping information, such as the table name to use for a
specified entity bean, the entity field name to table column name mappings, etc. If
you don't provide these JBoss will use the ejb-name property as the table name and the
entity bean field names for column names. See the example jaws.xml file for
details.</p>
<p>An example <i>jaws.xml </i>file can be found <a
href="#jaws_xml">here</a>.</p>
<li>Create a <i>jboss.xml</i> deployment descriptor. This file
can be copied from a previous deployment, making some modifications. Immediately
below the <code><jboss></code> tag insert the following code:
<p><code><resource-managers><br>
<resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource"><br>
<res-name>MyDB</res-name><br>
-
<res-jndi-name>xa.MyConnectionPool</res-jndi-name><br>
+
<res-jndi-name>OracleDB</res-jndi-name><br>
</resource-manager><br>
</resource-managers> </code></p>
- <p>Note that the <code>res-jndi-name</code> attribute
("MyConnectionPool" in this case) corresponds to the name attribute in the
<code><MLET></code> tag you added to the jboss.conf file. The
"<code>xa.</code>" is required. Note also that the <code>res-name</code>
attribute ("MyDB") will be used by the entity specifiers in
<i>ejb-jar.xml</i> to refer to data source resources, as discussed below.<br>
+ <p>Note that the <code>res-jndi-name</code> attribute
("OracleDB" in this case) corresponds to the name attribute in the
<code><MLET></code> tag you added to the jboss.conf file. The
"<code>xa.</code>" is required. Note also that the <code>res-name</code>
attribute ("MyDB") will be used by the entity specifiers in
<i>ejb-jar.xml</i> to refer to data source resources, as discussed below.<br>
<br>
An example <i>jboss.xml </i>file can be found <a
href="#jboss_xml">here</a> .</p>
<li>Create an <i>ejb-jar.xml</i> deployment descriptor. This
should conform to EJB1.1 standards for this file type. Each entity bean that uses CMP
should have the following code within the <code><entity></code> tag:
@@ -101,7 +106,7 @@
<p>where "MyBeanJNDIName" is the JNDI name specified
in the <code><jndi-name></code> attribute in the <i>jboss.xml</i> file.
<p>The client application must have the following classes in
the VM classpath in order to run:</p>
<ul>
- <li><i>$JBOSS_ROOT/lib/ext/ejb.jar</i>
+ <li><i>$JBOSS_ROOT/client/ejb.jar</i>
<li><i>$JBOSS_ROOT/client/jnp-client.jar</i>
<li><i>$JBOSS_ROOT/client/jboss-client.jar</i>
</ul>
@@ -117,7 +122,7 @@
<h4>jaws.xml</h4>
<p><code><?xml version="1.0"
encoding="UTF-8"?><br>
<jaws></code></p>
- <p><code>
<datasource>xa.MyConnectionPool</datasource><br>
+ <p><code>
<datasource>OracleDB</datasource><br>
<type-mapping>MyOracleTypeMapping</type-mapping></code></p>
<p><code> <type-mappings><br>
<br>
@@ -229,7 +234,7 @@
<p><code> <resource-managers><br>
<resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource"><br>
<res-name>MovieDB</res-name><br>
-
<res-jndi-name>xa.MyConnectionPool</res-jndi-name><br>
+
<res-jndi-name>OracleDB</res-jndi-name><br>
</resource-manager><br>
</resource-managers></code></p>
<p><code> <enterprise-beans><br>