Thursday, March 3, 2016

Data Source Not Found

While developing a web application i often come across following exceptions:

javax.naming.NameNotFoundException: Unable to resolve '<Data_Source_Name>'. Resolved ''; remaining name '<Data_Source_Name>'

at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:411)



oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context HppConnNonXA
at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1491)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:335)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:620)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:425)
at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9316)
at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4530)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2460)





Reason:
Application Module is configured (App Mod -- > Configurations -- > App Module -->Connection Type)to connect to DB using data source defined in Weblogic(WL Console --> Service -->Data Source). The Data source is unavailable for the application


Where to Look for solution:

If you get the above mentioned error look for following :

1. Make sure the data source is targeted for the default server(in local) or the designated server you are running the application.

Go to WL Console --> Service -->Data Sources --- > Select Data source ---> Targets:




2. This might happen more often then you think. In most of the cases (atleast with me) you might have been disconnected to vpn or the data base might not be reachable due to some circumstance.

Make sure the database connection is up. quickest way to check the same is :

Go to WL Console --> Service -->Data Sources --- > Select Data source -- > Configuration --> Connection Pool and click on save.

If the data base is reachable, you would get all green in case of issue you will find it





The issue mentioned above may sound silly but believe me its occurs more often then you think.

Hope its is useful



No comments:

Post a Comment