9 Replies Latest reply: Jun 24, 2014 5:10 AM by rohanwalia RSS

    DataSource NameNotFoundException when using a custom ADF application in spaces


      Hi All,


      I am using Webcenter Spaces

      I have an ADF application which contains a bounded taskflow with jsff.

      I have created a jar of View Controller and added the same in another generic application and deployed it on Spaces as shared library.

      I have made an entry of this shared library in weblogic.xml of extension project of spaces.


      Now I can see the taskflow and ui is coming up. But I am getting exceptions like:

      javax.naming.NameNotFoundException: DataSourceContext could not locate a DataSource for the name

      Now in bc4j.xfg I changed the data source name from java:comp/env/jdbc/testDS to jdbc/testDS. And this issue is resolved and the page is working fine.

      But in that page we have an image getting displayed from a servlet. Still I am getting the same NameNotFoundException for that servlet.

      Servlet Code:


                  Context ctx = new InitialContext();

                  DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/testDS");


      I also have tried with DataSource ds = (DataSource)ctx.lookup("jdbc/testDS");

      But still same issue.



      Please suggest if I am missing something.

      Do i need to have an entry(<res-ref-name>) in weblogic.xml or web.xml somewhere for datasource? In extension project or in ADF application or in Shared Library Generic Project?