Did
you add <resource-ref> in ejb-jar.xml and jboss.xml ?
If
not, you should.
-----Original Message-----Hi all,
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Darius Davidavicius
Sent: Monday, November 06, 2000 5:13 PM
To: [EMAIL PROTECTED]
Subject: [jBoss-User] Transaction rolled back:javax/sql/DataSource ?
I hope someone can save my time and gives some sollution for my problem.
I using jBoss-2.0_BETA_PROD_02.zip JBoss, Windows Nt4, Oracle 8i
I trying to run Beans (they works fine for Weblogic) using JBoss Application server.
JBoss Application logs:
...
[JDBC] Loaded JDBC-driver:oracle.jdbc.driver.OracleDriver
...
[XADataSource] Starting
[XADataSource] XA Connection pool OraclePool bound to OraclePool
[XADataSource] Started
...
Beans deployed without problems.
Oracle connection description:
<mbean name="DefaultDomain:service=XADataSource,name=OraclePool">
<attribute name="Properties"></attribute>
<attribute name="URL">jdbc:oracle:thin:@DARIUS:1521:darius</attribute>
<attribute name="Password">xxxxxxx</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="JDBCUser">DDD</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Blocking">false</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
<attribute name="TimestampUsed">false</attribute>
</mbean>
In my source code i do trying do get pracle connection:
/**
*/
protected Connection getConnection()
throws SQLException
{
InitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/OraclePool"); // <---- i think Exception goes here
return ds.getConnection();
} catch(NamingException ne) {
log("UNABLE to get a connection from oraclePool!", theLogLevel);
log("Please make sure that you have setup the connection pool properly",theLogLevel);
throw new EJBException(ne);
} finally {
try {
if(initCtx != null) initCtx.close();
} catch(NamingException ne) {
log("Error closing context: " + ne, theLogLevel);
throw new EJBException(ne);
}
}
}
Client takes home of the Session bean and tries to oracle connection. I get Exception:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is: java.rmi.ServerException: Transaction rolled back:javax/sql/DataSource
Thans in advance for any replays,
D&D
