-
1. Re: can not connect to oracle
ektarani Jan 10, 2002 4:02 AM (in response to sunhongfeng)I am facing the same problem. I am new to jboss. Was trying to configure oracle but could not. Can somebody let me know as how to go about it?
-
2. Re: can not connect to oracle
juergenheidak Jan 10, 2002 6:22 AM (in response to sunhongfeng)What do you mean by "it can not pick up oracle, nothing happen": errors or warnings or is jboss unable to start ... ???
Give more information, if useful add parts of the jboss output. -
3. Re: can not connect to oracle
markd Jan 10, 2002 9:00 AM (in response to sunhongfeng)Here are the lines from my jboss.jcml for Jboss-2.4.3 for Oracle. I did NOT add the OracleXid line to JBoss properties.
org.hsqldb.jdbcDriver,oracle.jdbc.driver.OracleDriver
<!-- code for oracle -->
OracleDB
org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
jdbc:oracle:thin:@localhost:1521:test1
userid
password
75
true
false
true
true
120000
4000
4000
true
false
1.0
5 -
4. Re: can not connect to oracle
otcons Jan 11, 2002 11:12 AM (in response to sunhongfeng)I did as Markd said, but I get the message in the message:
ERROR in getConnection or in executeQuery
and in the jbosserror the message
[ERROR,Default] SQLException: listaPool not bound
this is part of my jboss.jcml:
<!-- ======================= -->
<!-- JDBC -->
<!-- ================================= -->
org.hsqldb.jdbcDriver,oracle.jdbc.driver.OracleDriver
1476
true
default
false
listaPool
<!-- org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl -->
org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
jdbc:oracle:thin:@pippo:1521:ORCL
pluii
sssss
75
true
false
true
true
120000
4000
4000
true
false
1.0
5
This is my jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
false
<container-configurations />
<resource-managers>
<resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>jdbc/lista</res-name>
<res-jndi-name>java:/listaPool</res-jndi-name>
</resource-manager>
</resource-managers>
<enterprise-beans>
<ejb-name>Elencoiscritticognomi1</ejb-name>
<jndi-name>esame/Elencoiscritticognomi1</jndi-name>
<resource-ref>
<res-ref-name>jdbc/lista</res-ref-name>
<resource-name>jdbc/lista</resource-name>
</resource-ref>
</enterprise-beans>
this my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
Data Sample Application
<display-name>data EJB</display-name>
<enterprise-beans>
<ejb-name>Elencoiscritticognomi1</ejb-name>
esame.Elencoiscritticognomi1Home
esame.Elencoiscritticognomi1
<ejb-class>esame.Elencoiscritticognomi1Bean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
DataSource per Elencoiscritticognomi1
<res-ref-name>jdbc/lista</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<ejb-name>Elencoiscritticognomi1</ejb-name>
<method-name>*</method-name>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and in the Bean I use:
DataSource ds=(DataSource)jndiContext.lookup("java:comp/env/jdbc/lista"); -
5. Re: can not connect to oracle
markd Jan 11, 2002 1:17 PM (in response to sunhongfeng)Here is my ref in ejb-jar.xml:
<resource-ref>
<res-ref-name>java:/OracleDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
</resource-ref>
Here is the code to reference it in a SLSB:
Context sessionBeanContext = new InitialContext();
DataSource ds = (DataSource) sessionBeanContext.lookup("java:/OracleDB");
Is is possible that your datasource is not being created because you do not have classes12.zip in your classpath?
Very early in your log file your should see a message like this:
[OracleDB] XA Connection pool OracleDB bound to java:/OracleDB