I have followed one of the answer here :
How to access JNDI data source defined in weblogic 10.3.6
Hashtable<String, String> h = new Hashtable<String, String>(7);
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");//add ur url
h.put(Context.SECURITY_PRINCIPAL, "weblogic");//add username
h.put(Context.SECURITY_CREDENTIALS, "abc#12345");//add password
InitialContext ctx = new InitialContext(h);
DataSource dataSource = ((DataSource) ctx.lookup("jndiDS"));
when running it i got this error :
java.lang.NoSuchMethodError: org.glassfish.hk2.utilities.ClasspathDescriptorFileFinder.(Ljava/lang/ClassLoader;[Ljava/lang/String;)V
and try running it again it gives different error:
java.lang.NoClassDefFoundError: Could not initialize class weblogic.corba.j2ee.naming.ORBHelper
what could be the problem here? i have added wlclient.jar to maven dependency