It's all about the answers!

Ask a question

Howto use Websphere datasource on operation advisor

Paco Rossell├│ (1112) | asked Apr 30 '11, 2:39 p.m.
I try to use java.sql.Connection to connect to db2 database in an operation advisor . I have defined on Websphere one Datasource and it works fine in web context, but when I try to use in operation advisor I get this exception :
00000012 SystemErr R javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable {java.naming.provider.url=corbaloc:rir:/NameServiceServerRoot,}

Does anyone knows how to acces to a Datasource defined in Websphere from an operation advisor? Is it possible?

I also tried to make a direct connection to db2 using Class.forName() but then I got java.lang.ClassNotFoundException:

Is there any way to make available db2 jars to my advisor?


Bests regards.

Paco Rossell

2 answers

permanent link
Nils M├╝ller-Sheffer (1136) | answered Sep 07 '12, 4:46 a.m.
Hi Paco,

have you ever solved this? I am facing the exact same problem.

I even need to make it work in a generic way on both Tomcat and WebSphere.

I think the (somewhat hacky) solution is to temporarily change the ContextClassLoader to the classloader that loads the jazzbridgeservlet oder (equinox) bridgeservlet, because only the Web Container classloader will have those JNDI contexts.

Still, I am struggeling and could not yet make it work. Would be grateful for any pointers / example config.

ClassLoader origCL = Thread.currentThread().getContextClassLoader();
        try {
        } finally {

permanent link
Jose Miguel Ordax Cassa (2.4k4126100) | answered Jan 30 '14, 9:02 a.m.
I posted a solution that worked for me in this other thread:

Hope it helps,


Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.