Ok, I succeeded in getting JBoss 2.1 up and running,
although there were a few minor issues I had to address
in the JBoss 2.1 configuration. I copied the relevant
part out of the logbook I keep. It shows the
differences between JBoss 2.0 and JBoss 2.1 configuration
for setting it up to work with Interbase 6.0.
Note the use of "org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl"
in the jboss.jcml mbean for Interbase. These is another example around
in which it states it should be "org.jboss.minerva.xa.XADataSourceImpl".
This is not the case anymore as Aaron most kindly pointed out to me.
For Jboss 2.0 do the following:
o Edit the file jboss.properties
Find the propertye named: jdbc.drivers
Add to the end of this line: ",interbase.interclient.Driver"
Copy the interclient.jar to the %JBOSS_HOME%/lib/ext directory
o Edit the file jboss.jcml and add the code below:
<quote>
<mbean name="DefaultDomain:service=XADataSource,name=Interbase">
<attribute name="Properties"></attribute>
<attribute
name="URL">jdbc:interbase://localhost/h:/Interbases/Companion/SalesCompanion
.gdb</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="JDBCUser">salescompanion</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Password">guust</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean>
</quote>
Note that the h:/Interbases/Companion/SalesCompanion.gdb path must be
replaced
by the actual path of the applied Interbase database file.
The name attribute of the mbean tag must also be remembered, because we
will
use this name as a reference name within other configuration files as
well.
For JBoss 2.1 and further do the following:
o Edit the file jboss.jcml and modify the code below in such a way
that it contains the interbase.interclient.Driver name.
<quote>
<!-- JDBC -->
<mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
<attribute
name="Drivers">org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,inte
rbase.interclient.Driver</attribute>
</mbean>
</quote>
Copy the interclient.jar to the %JBOSS_HOME%/lib/ext directory
o Edit the file jboss.jcml and add the code below:
<quote>
<mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=Interbase">
<attribute name="PoolName">Interbase</attribute>
<attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp
l</attribute>
<attribute name="Properties"></attribute>
<attribute
name="URL">jdbc:interbase://localhost/h:/Interbases/Companion/SalesCompanion
.gdb</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="JDBCUser">salescompanion</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Password">guust</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean>
</quote>
Note that the h:/Interbases/Companion/SalesCompanion.gdb path must be
replaced
by the actual path of the applied Interbase database file.
The name attribute of the mbean tag must also be remembered, because we
will
use this name as a reference name within other configuration files as
well. To
be precise the jaws.xml
All the following is needed within JBoss 2.0 as well as in JBoss 2.1.
Create a jaws.xml which contains the following:
<quote>
<?xml version="1.0" encoding="UTF-8"?>
<jaws>
<datasource>Interbase</datasource>
<type-mapping>Interbase</type-mapping>
<default-entity>
<create-table>false</create-table>
<remove-table>false</remove-table>
<tuned-updates>false</tuned-updates>
<read-only>false</read-only>
<time-out>300</time-out>
</default-entity>
</type-mappings>
<type-mapping>
<name>InterBase</name>
<mapping>
<java-type>java.lang.Boolean</java-type>
<jdbc-type>BIT</jdbc-type>
<sql-type>SMALLINT</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Byte</java-type>
<jdbc-type>TINYINT</jdbc-type>
<sql-type>SMALLINT</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Short</java-type>
<jdbc-type>SMALLINT</jdbc-type>
<sql-type>SMALLINT</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Integer</java-type>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>INTEGER</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Long</java-type>
<jdbc-type>BIGINT</jdbc-type>
<sql-type>NUMERIC(18,0)</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Float</java-type>
<jdbc-type>REAL</jdbc-type>
<sql-type>FLOAT</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Double</java-type>
<jdbc-type>DOUBLE</jdbc-type>
<sql-type>DOUBLE PRECISION</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Character</java-type>
<jdbc-type>CHAR</jdbc-type>
<sql-type>CHAR</sql-type>
</mapping>
<mapping>
<java-type>java.lang.String</java-type>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(255)</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Date</java-type>
<jdbc-type>DATE</jdbc-type>
<sql-type>DATE</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Time</java-type>
<jdbc-type>TIME</jdbc-type>
<sql-type>TIME</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Timestamp</java-type>
<jdbc-type>TIMESTAMP</jdbc-type>
<sql-type>TIMESTAMP</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
<jdbc-type>JAVA_OBJECT</jdbc-type>
<sql-type>VARCHAR(2000)</sql-type>
</mapping>
</type-mapping>
</type-mappings>
</jaws>
</quote>
Next create a jboss.xml which contains the following:
<quote>
<jboss>
<resource-managers>
<resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>source1</res-name>
<res-jndi-name>Interbase</res-jndi-name>
</resource-manager>
</resource-managers>
</jboss>
</quote>
Note that we refer to the Interbase name here, which was defined in the
jboss.jcml!
The source1 name can be used in a BMP to establish a connection to the
Interbase
database. An example code fragment using "source1" is the following:
<quote>
DataSource ds =
(DataSource)ctxt.lookup("java:comp/env/source1");
Connection con = ds.getConnection();
final Statement statement = con.createStatement();
ResultSet results = statement.executeQuery("select
translationid from language where translationid = '" +
CompanionEJB.escapeSqlString(TranslationId) + "'");
results.close();
con.close();
</quote>
Also note that the jboss.xml file must also contain a description of the
beans that
are used. This is needed to indentify what type of container must be used
for which
bean. Examples are shown below.
<quote>
<enterprise-beans>
<entity>
<ejb-name>Country</ejb-name>
<jndi-name>Country</jndi-name>
<configuration-name>Standard BMP EntityBean</configuration-name>
</entity>
<session>
<ejb-name>CountrySession</ejb-name>
<jndi-name>CountrySession</jndi-name>
<configuration-name>Standard Stateless
SessionBean</configuration-name>
</session>
</enterprise-beans>
</quote>
An example of an entity bean and a session bean have been given. Note that
the
body of the configuration-name tag is not free to choose. Those are fixed
names
and are defined in the standardjboss.xml file within the
container-configurations
tag.
Regards,
Cor.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Cor Hofman
Sent: Saturday, February 03, 2001 18:18
To: jBoss
Subject: RE: [jBoss-User] Jboss PRE2.1 and CVS
Thanks,
I'll continue with those sources then and perform a build.
I'll update you on the results.
Cor.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Scott M Stark
Sent: Saturday, February 03, 2001 17:41
To: jBoss
Subject: Re: [jBoss-User] Jboss PRE2.1 and CVS
PRE2.1 is not a tagged release. Any cvs snapshot after Jan 10 2001 will work
.
The cvs checkout you just did should work.
----- Original Message -----
From: "Cor Hofman" <[EMAIL PROTECTED]>
To: "JBoss User list" <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 7:24 AM
Subject: [jBoss-User] Jboss PRE2.1 and CVS
> Hi,
>
> I am trying to get hold of the correct PRE2.1 version in
> order to get JAAS working.
> When I perform a "cvs checkout -P -f jboss" and perform a
> "cvs status -v" command on the sources I do not see any sources
> tagged PRE2.1. Obviously I lost the way :-(. Who can help me find
> te correct one?
>
> Thanx in advance.
>
> Cor Hofman
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]