Thursday, June 16, 2016

Shared Libraries - Wrong page displayed at runtime.

Problem :  While fixing a bug, one of the developers was changing the page to add a new attribute and some validation.  While running from local JDeveloper everything was fine, all the changes were replicated and the page was behaving properly, but as soon as we deploy it on the standalone weblogic server as a shared library the changes were not seen.

Solution: 

To investigate the solution, I have started looking at the problem.

1. Being deployed as shared libraries, the initial thought was the shared library is not built properly and hence the behaviour.

  - Cleared all the classes, deleted the shared libraries, re-generated the library and deployed again but still the same behaviour.

2. Now the next thought was the manifest version of the shared library was not correct and it is still taking the code from old version of shared library

 - Checked the manifest version on the server, everything looked fine, but still same behaviour.

3.  It was a random thought and started looking for the page name (in which developer was making the changes)eg., employee.jsff in the entire application.
 
  - Found instances of the same page name at the same path in a different application as of the page on which the developer is working.

Please find the path of the page fragments in both the applications.
 

Application 1

App1ViewController
-Applciation Sources
  - Fragments
      - EmployeePageDef.xml
-Web Content
  - Fragments
     - Employee.jsff


Application 2

App2ViewController
-Applciation Sources
  - Fragments
      - EmployeePageDef.xml
-Web Content
  - Fragments
     - Employee.jsff

Now I went to change the label of a attribute in the page of application 2 and redeployed the shared library.

And wonder what, the changes started to show up.

And finally the random thought was, if there are two similar pages at similar path in two different shared libraries, at runtime the page which was available first was displayed.

Finally the solution is to rename the pages and page def files simply to make the path different and everything was fine.