1. I wouldn't expect the cast to ConnectionPoolDataSource to work. I
think you need DataSource.
2. What thread is this code running in? Unless you have created a
thread yourself this ought to work as long as
3. Does the javaee component (war?) that calls this code have the
resource-ref for the datasource set up properly? Can you look up the
datasource from a servlet or jsp page?
If this doesn't help showing the entire stack trace would be the next
step.
thanks
david jencks
On Apr 16, 2008, at 6:21 AM, BenLeino wrote:
Hi,
I have googled a lot, but I can't figure out the solution myself.
Maybe I
have a understanding problem.
I have a web application (WAR) that calls several EJBs and so on.
Everything
works fine. This WAR includes a shared library within geronimos shared
library repository (I have written this library).
This library includes a validator (JSF) which needs database
access. The
method looks like this:
public void validate(FacesContext arg0, UIComponent arg1, Object arg2)
throws ValidatorException {
[...]
objConnection = (ConnectionPoolDataSource)
context.lookup("java:comp/env/jdbc/hbTest");
[...]
}
And hbTest is a well known and used connection pool in geronimo.
When doing
this I always get "javax.naming.NotContextException".
How can I get the lookup to work wthout having to deploy my shared
library
as an EJB library? Because the library is not stand alone, it is only
included by other EJB and WAR projects.
Thanks a lot in advance,
Tim
--
View this message in context: http://www.nabble.com/Accessing-
geronimo-connection-pool-from-shared-library-
tp16721707s134p16721707.html
Sent from the Apache Geronimo - Users mailing list archive at
Nabble.com.