Using an session bean to get a connection from a DataSource and execute an SELECT SEQ_NAME.nextval FROM DUAL query.
I get an exception like:
Table not found: DUAL in statement [SELECT ALRT_SEQ.nextval FROM DUAL]
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.invoke(Unknown Source)
I am connecting to an Oracle 8i DB
jboss.jcml:
oracle.jdbc.driver.OracleDriver, org.hsqldb.jdbcDriver
OracleDS
org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
jdbc:oracle:thin:@oracle-4:1521:saturnsring
1200000
USER_NAME
10
password
false
false
false
true
120000
1800000
false
false
1.0
2
In the EJB I am getting the DataSource using:
dataSource = (DataSource)getJndiContext().lookup("java:comp/env/jdbc/elogexPool");
I am getting the connection by:
Connection newConnection = getDataSource().getConnection();
the jboss.xml ref desc looks like:
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/elogexPool</res-ref-name>
<jndi-name>java:/OracleDS</jndi-name>
</resource-description>
</reference-descriptor>
the ejb-jar.xml ref desc looks like:
<resource-ref>
<res-ref-name>jdbc/elogexPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
I have an entity bean working correctly against that DataSource for finder methods.
Questions:
Is this right?
Should I be using an Oracle specific XADataSource instead of the JBoss wrapper?
oracle.jdbc.xa.OracleXADataSource - the DataSource would not start/deploy
oracle.jdbc.xa.client.OracleXADataSource - had same problem
If anyone has this working I would love to see their deploy descriptors (jboss, ejb-jar), lookups in the EJB, and XADataSource configuration from the jboss.jcml
Any help would be greatly appreciated.