0

I am facing a class cast exception while doing lookup for datasource .we have recently migrated to weblogic 12c from weblogic 11. Below is the code via which I am looking up for Datasource .

        ds = (javax.sql.DataSource) ctx.lookup("my_data_source_name");

this code is giving class cast exception

Caused by: java.lang.ClassCastException: weblogic.jndi.internal.WLEventContextImpl cannot be cast to javax.sql.DataSource

we have weblogic.jar in our class path .. i am not sure why it is returning the object of type WLEventContextImpl instead of Datasource . Can someone suggest something?

1 Answer 1

1

I had this problem and in my case I created a datasource without associate with a target, in the last page of datasource configuration you can see:

Select Targets:

Servers

[ ] AdminServer

After I check the AdminServer checkbox, I could use the datasource.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.