Monday, November 14, 2011

Unable to lookup Data Source at context java:comp/env/jdbc/DBName_DS



oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/PTS2DS
at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1453)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:329)

-----------------------------------------------------------------------------------------

Form Shay Shmeltzer's Common pitfalls when deploying from JDeveloper 11g to WebLogic 10.3


Data-sources - and not finding them
When you are building an ADF BC application, or any other Java EE application for that matter, you should take advantage of the data-sources capabilities of your server.

In ADF BC's application module configuration it is quite easy to edit the configuration and replace the connection to be based on a JDBC DataSource instead of direct JDBC connection - once you do that the JDBC data source name will be something like: java:comp/env/jdbc/scottDS (where scott is the name of the DB connection you defined for your application).

After you did this modification, the next step is to go into the WLS admin console and define a data source. The important thing here is to have the JNDI Name be: jdbc/scottDS
This way your JDBC connection will be found.

One more common overlooked thing here is that after you define the data source in WLS you need to give it a target. So click the Targets tab and assign the datasource to the server you are going to deploy to.
---------------------------------------------------------------------------------------


Problem was i needed to rebuild the projects in JDev. --  I was running the page off the application Navigator page so I needed to go to Build...
 - Build -> CleanAll
 // then //
 Build->MakeAll

This removed the problem....

1 comment: