Tuesday 31 March 2009

JNDI failure for WLS deployed ADF applications

One runtime error I've hit a few times now when setting up an ADF application to use a JNDI Data Source via WebLogic Server (WLS) is the following:

(I'll document this issue here to save myself grief later on and hopefully help a few other people out)


The specific error text:

JNDI failure. Unable to lookup Data Source at context jdbc/appDS
Unable to resolve 'jdbc.appDS'. Resolved 'jdbc'.

Note that the text "jdbc/appDS" or "jdbc.appDS" may differ in your specific case dependent on what you did in the following steps.

The error comes about as I've:

1) Modified my ADF BC Application Module AppModuleLocal configuration to use a JDBC DataSource connection type, specifying a datasource name of jdbc/appDS.


Accessed via Model project -> Application Module right click -> Configurations -> select AppModuleLocal then Edit button -> Application Module tab.

2) On the WebLogic Server I've created a data source as following:


This is accessed via opening your WLS console + logging in -> Domain Structure -> Services -> JDBC -> Data Sources.

First note the AppDataSource that I've created, then the JNDI Name that maps back to that specified in the previous step.

Then note that the Targets entry is empty for my configured data source. Effectively I've created the data source in WLS but forgotten to assign it to any WLS server and in this case is what's causing my problem.

To rectify this I click on the data source name -> Targets tab then assign the data source to each server I'm interested in (in this case just the JDev 11g integrated WLS DefaultServer):


On saving the changes and returning to the Data Sources page you should see:


And the problem should now be resolved.

1 comment:

marcelfalliere said...

I found another two mistakes to avoid for a such case (first or not experienced deployment).

See this article : http://easyadf.blogspot.com/2009/04/deploying-adf-application-to-weblogic.html

Regards
Fred-