-
1. Re: Migrating to JBoss 2.3: can't look up data source
davidjencks Apr 18, 2003 9:43 AM (in response to kirillburyak)Maybe you have more than one copy of DataSource loaded somehow? I'd put some logging in to investigate the superclasses and classloaders of what you look up and the classloader of DataSource.
-
2. Re: Migrating to JBoss 2.3: can't look up data source
kirillburyak Apr 21, 2003 2:43 PM (in response to kirillburyak)Thanks for your help, David,
Yes, I did have a classloader problem, javax.sql.DataSource was being loaded from jdbc2_0-stdext.jar (which is a part of Struts distribution)
After I removed jdbc2_0-stdext.jar, the problem was resolved.
Kirill -
3. Re: Migrating to JBoss 2.3: can't look up data source
samirny Apr 23, 2003 10:15 PM (in response to kirillburyak)Hi,
I am newbie to Jboss.I am using jboss-3.2.0_tomcat-4.1.24. I got the same exception.I am not using any struts.jar..I am running with default jboss config.
I created OracleDS Pool as define in examples jca.
in the web.xml the following config:
<resource-ref>
Oracle Datasource example
<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In the jsp I am using the following code:
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("- No Context");
Context envContext = (Context)ctx.lookup("java:OracleDS");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Am I doing something wrong?
Please reply.
thanks. -
4. Re: Migrating to JBoss 2.3: can't look up data source
samirny Apr 24, 2003 11:53 AM (in response to kirillburyak)my mistake.
it is working ok now.
sorry.
Context ctx = new InitialContext();
DataSource ds= (DataSource)ctx.lookup("java:/OracleDS");
Connection conn = ds.getConnection();