This is how I got it working...


Bean Code:
      InitialContext context = new InitialContext();
      Datasource ds = (DataSource)
context.lookup("java:comp/env/jdbc/OracleDB");

jboss.jcml has the following:
<mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=OracleDB">
  <attribute name="PoolName">OracleDB</attribute>
  <attribute
name="DataSourceClass">oracle.jdbc.xa.client.OracleXADataSource</attribute>
  <attribute name="URL">jdbc:oracle:thin:@localhost:1521:ORCL</attribute>
  <attribute name="JDBCUser">scott</attribute>
  <attribute name="Password">tiger</attribute>
</mbean>

ejb-jar.xml is the following:
<ejb-jar>
  <enterprise-beans>
    <session>
      <ejb-name>JBossTestBeano</ejb-name>
      <home>jbosstest.TestDBHome</home>
      <remote>jbosstest.TestDB</remote>
      <ejb-class>jbosstest.TestDBBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      <resource-ref>
        <res-ref-name>jdbc/OracleDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    </session>
  </enterprise-beans>
</ejb-jar>

jboss.xml is the following:
<jboss>
  <resource-managers>
    <resource-manager>
      <res-jndi-name>OracleDB</res-jndi-name>
      <res-name>jdbc/OracleDB</res-name>
    </resource-manager>
  </resource-managers>
</jboss>

Michael...



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Todd Bowker
Sent: Friday, March 16, 2001 2:21 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [jBoss-User] installing ORACLE JDBC,


Here is a more complete list of everything I've done.

I have jboss 2.1 binary distribution.
I have my oracle jar file in lib/ext directory.
No changes for jboss.conf.

Two changes for jboss.jcml:

One for the JdbcProvider. I took out the hypersonic driver because I don't
start it and I added the oracle driver.

<!-- JDBC -->
  <mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
     <attribute
name="Drivers">oracle.jdbc.driver.OracleDriver,org.enhydra.instantdb.jdbc.id
bDriver</attribute>
  </mbean>



Other change is for Oracle DataSource:

<!-- Oracle Database -->

  <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=OracleDB">
       <attribute name="PoolName">OracleDB</attribute>
       <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp
l</attribute>
       <attribute name="Properties"></attribute>
       <attribute
name="URL">jdbc:oracle:thin:@domain:1521:instance</attribute>
       <attribute name="GCMinIdleTime">1200000</attribute>
       <attribute name="JDBCUser">user</attribute>
       <attribute name="MaxSize">2</attribute>
       <attribute name="Password">pass</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">1</attribute>
     </mbean>

I don't get any errors when I start the server and the console tells me it
started OracleDB.


good luck




-----Original Message-----
From: Reynir Hübner [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 11:17 AM
To: JBoss-User
Subject: RE: [jBoss-User] installing ORACLE JDBC,


thank you,
I´ve tried this but still get the same error...

so any other ideas ?

-r



-----Original Message-----
From: Todd Bowker [mailto:[EMAIL PROTECTED]]
Sent: 16. mars 2001 17:05
To: JBoss-User
Subject: RE: [jBoss-User] installing ORACLE JDBC,


The DataSourceClass attribute doesn't look right.
This is how I have mine configured, and I'm also using oracle:

 <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourc
eImp
l</attribute>



-----Original Message-----
From: Reynir Hübner [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 8:54 AM
To: [EMAIL PROTECTED]
Subject: [jBoss-User] installing ORACLE JDBC,


Hello,

I´m very new to jBoss and I´m trying to connect jBoss 2.1 to Oracle 8i
with the JDBC thin client.
I´m getting an error like this, and I´m wondering how to understand it:

[isdb] Starting
[isdb] XA Connection pool isdb bound to java:/isdb
[isdb] Stopped
[isdb] java.lang.NullPointerException
[isdb]  at
org.opentools.minerva.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataS
ource.java:165)
... etc

this is what I have in the jboss.jcml file :

 <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=isdb">
   <attribute name="PoolName">isdb</attribute>
   <attribute
name="DataSourceClass">oracle.jdbc.xa.client.OracleXADataSource</attribu
te>
   <attribute
name="URL">jdbc:oracle:thin:@computer.domain.com:1521:isdb</attribute>
   <attribute name="JDBCUser">system</attribute>
   <attribute name="Password">xxxxxxxx</attribute>
 </mbean>

and I also specify the driver jboss.jcml,
all according to the message :
http://www.mail-archive.com/jboss-user@list.working-dogs.com/msg12921.ht
ml


ok, please tell me what I´m doing wrong.
regards,


Reynir Hübner
[EMAIL PROTECTED]







--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to