Well, I´m spanish and I´m sure that my english it´s no perfect, so be patient please.
 
Let´s begin. This is my configuration :
 
- JDK 1.3
- JBoss 2.2.1(running in my PC)
- Oracle 8.1.6 (running in other machine)
- Oracle XA JDBC drivers
 
I´m running JBoss under Windows 2K. I have installed  the Oracle drivers following the documentation. In fact, my steps were exactly the same,
and the same sentences. I modified these sentences in the "jboss.jcml" file :
 
<!-- JDBC -->
  <mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
    <attribute name="Drivers">org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,oracle.jdbc.driver.OracleDriver</attribute>  
</mbean>
 
and I added these :
 
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=OracleDS">
    <attribute name="PoolName">jdbc/OracleDS</attribute>
    <attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
    <attribute name="URL">jdbc:oracle:thin:@aifsrvpruebas:1521:sflw</attribute>
    <attribute name="JDBCUser">U605</attribute>
    <attribute name="Password">U605</attribute>
  </mbean>
 
 
When I start JBoss , it prints  this :
 
[JDBC provider] Loaded JDBC-driver:oracle.jdbc.driver.OracleDriver
[JDBC provider] Initialized
 
and about the dataStore :
 
[jdbc/OracleDS] Starting
[jdbc/OracleDS] XA Connection pool jdbc/OracleDS bound to java:/jdbc/OracleDS
[jdbc/OracleDS] Started
 
So I suppose that all is correct.
 
I have included the ejb and the client application I´m testing. The ejb (ItemEJB file) is a BMP entity bean that manage the item table. The client application
 ( ItemClient file ) inserts two rows in the table and get the price of the items. This is the code :
 
"Item item1 = home.create("01", "00000000000127", "Puleva", 120.00);
double price = item1.getPrice();
System.out.println("price = " + String.valueOf(price));
// item1.remove();
Item item2 = home.create("01", "00000000000840", "Atun", 100.00);
price = item2.getPrice();
System.out.println("price = " + String.valueOf(price));"
 
And here is the little problem. When I run the client program, and the rows exist in the table , I get the next error :

"Caught an exception.

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: ejbCreate: ORA-00001: restricción única (U604.I6198010) violada; nested exception is: javax.ejb.EJBException: ejbCreate: ORA-00001: restricción única (U604.I6198010) violadajavax.transaction.TransactionRolledbackException: ejbCreate: ORA-00001: restricción única (U604.I6198010) violada; nested exception is: javax.ejb.EJBException: ejbCreate: ORA-00001: restricción única (U604.I6198010) violada javax.ejb.EJBException: ejbCreate: ORA-00001: restricción única (U604.I6198010) violadaat sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source) at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:248) at $Proxy0.create(Unknown Source) at com.web_tomorrow.item.ItemClient.main(ItemClient.java:35) "

That´s Ok. I get the same result in the Sun EJB container and in JBoss. Well, if I repeat the execution of the program in the reference Sun EJB container , I always get the same result (above),  but when I do the same in JBoss, the result is diferent :

"java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: ejbCreate: Connection has been closed!; nested exception is: javax.ejb.EJBException: ejbCreate: Connection has been closed! javax.transaction.TransactionRolledbackException: ejbCreate: Connection has been closed!; nested exception is: javax.ejb.EJBException: ejbCreate: Connection has been closed! javax.ejb.EJBException: ejbCreate: Connection has been closed! at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source) at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:248) at $Proxy0.create(Unknown Source) at com.web_tomorrow.item.ItemClient.main(ItemClient.java:35) "

I can´t understand what´s happend, but I think that JBoss has closed the connection. The behavior is diferent . From that moment It´s impossible to connect to Oracle from JBoss, I have to stop JBoss an start again. Perhaps It could be a configuration error, I don´t know.

 

Please , I need help. Could anybody help me ?

Thanks in advanced.

ItemKey.java

Item.java

ItemClient.java

ItemEJB.java

ItemHome.java

EJBLog.java

Reply via email to