You have to setup the resource reference in ejb-jar.xml and jboss.xml file.
Normally you should lookup JDBC DataSource under java:/comp/env/jdbc/...
The following configuration was for Jboss 2.2. The new version has remove
the extra indirection. See docs for details.
In ejb-jar.xml
...
<resource-ref>
<res-ref-name>jdbc/ipdomainMySQL</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...
In jboss.xml
<resource-ref>
<res-ref-name>jdbc/ipdomainMySQL</res-ref-name>
<resource-name>ipdomainMySQL</resource-name>
</resource-ref>
</session>
</enterprise-beans>
<resource-managers>
<resource-manager res-class="javax.sql.DataSource">
<res-name>ipdomainMySQL</res-name>
<res-jndi-name>java:/ipdomainMySQL</res-jndi-name>
</resource-manager>
</resource-managers>
Let me know if it works.
Phong.
----- Original Message -----
From: "Daniel Ferrante" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 29, 2001 6:29 AM
Subject: RE: [JBoss-user] mysql and jboss
try without the default comp/env/ in the call lookup the datasourse so
use:
"java:ipdomainMySQL" . This worked for me.
Dan
-----Original Message-----
From: Mir S Islam [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 28, 2001 6:41 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] mysql and jboss
I am trying to use mysql with jboss as described in the documentation
but
ran into some problem.
During the initialization I see the following messages on console/server
log.
[Configuration] DataSourceClass set to
org.jboss.pool.jdbc.xa.wrapper.XADataSour
ceImpl in DefaultDomain:service=XADataSource,name=ipdomainMySQL^M
[Configuration] PoolName set to ipdomainMySQL in
DefaultDomain:service=XADataSou
rce,name=ipdomainMySQL^M
[Configuration] URL set to jdbc:mysql://jupiter:3306/ipdomain in
DefaultDomain:s
ervice=XADataSource,name=ipdomainMySQL^M
[Configuration] JDBCUser set to mislam in
DefaultDomain:service=XADataSource,nam
e=ipdomainMySQL^M
[Configuration] Password set to mir in
DefaultDomain:service=XADataSource,name=i
pdomainMySQL^M
So it seems like the driver was loaded properly and a datasource called
ipdomainMySQL was setup. Later on the server log following message
confirms
(?) that ipdomainMySQL was bound to the server.
[XADataSourceLoader] Starting^M
[ipdomainMySQL] XA Connection pool ipdomainMySQL bound to
java:/ipdomainMySQL^M
[XADataSourceLoader] Started^M
[ServerDataCollector] Starting^M
[ServerDataCollector] JBoss Management Service 'servercollector' bound
to
server
collector^M
But when I invoke my ejb I get an error message on the server that:
[Default] Entering TestMysql.ejbCreate()
[Default] Error: javax.naming.NameNotFoundException: ipdomainMySQL not
bound
[Default] Leaving TestMysql.ejbCreate()
Here is relevant code from my EJB class file. Any pointer/examples will
be
appreciated. Thanks
public void ejbCreate() {
System.out.println("Entering TestMysql.ejbCreate()");
Context c = null;
if (this.jdbcFactory == null) {
try {
c = new InitialContext();
this.jdbcFactory =
(javax.sql.DataSource)c.lookup("java:comp/env/ipdomainMySQL");
} catch (Exception e){ System.out.println("Error: " + e); }
}
System.out.println("Leaving TestMysql.ejbCreate()");
}
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user