Wednesday 19 August 2020

ADF application gives error while running it on the Production Server

Problem: Oracle ADF application is running fine when I am running it on my local system, but when i deploy the application on the Production Server then the application crashes.

Error log:

<Error> <org.apache.myfaces.trinidad.webapp.UIXComponentELTag> <BEA-000000> <Error when processing tag for component with id: "ot7". The scoped id of the parent component is ":r1:pc1:t1:c1".
javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'null' returned null
    at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1952)
    at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:447)
    at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
    at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.createComponent(UIXComponentELTag.java:225)
    at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:506)
    at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:744)
    at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1311)
    at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:115)
    at oracle.adfinternal.view.faces.unified.taglib.output.UnifiedOutputTextTag.doStartTag(UnifiedOutputTextTag.java:55)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:263)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:263)
    at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
    at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
    at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:263)

Possible solutions: There can be two possible reasons of this error. 

1. PPR (Partial Page Rendering) 

PPR stands for Partial Page Rendering and it as used in oracle ADF to refresh some particular part of the page if some data changes on the page or on trigger event. This helps in optimizing the performance of the application as for data refresh the whole page is not loaded, instead some part of the page which is required to be refreshed is loaded. But there are some bugs in ADF due to which this behaves in strange way. If this is the cause then you can resolve this issue by disabling PPR in the Page or in the Application. 

Caution: This may lead to another issues related to component refresh on the page as this disables the automatic refresh, you may have to write some code to refresh the page at certain point. While doing this it is must to check if all the functionality of the application is working as it is supposed to be or not. 

How to disable PPR?? 

PPR can be disabled from two levels.

  1. Application Level: By diabling PPR at Application level this is default properties of all the pages. This can be done in the adf-config file.



  2. Page Level: This can be done to the iterators of the in the pagedef of the page.

     

2. PageDef Filename conflict

If we are running an application is production environment and if two application has pageDef, page name, taskflow name, package name same then this error comes up. This majorly comes up due to same pageDef name.

So when you run you application then the clash doesn't happen, but when your is running it with all other applications then this conflict happens and the framework is confused which file to consider for the page. In that case this issue comes up.

Solution:

Rename the pageDef or page for which this issue is coming by clicking on the refactor in the JDeveloper.

How to avoid this??

Make sure that all the applications are having a different package name. This will avoid this condition.

I will try to update this post with actual error log which comes up in case of PageDef conflict..

Sunday 5 January 2020

CRUD operation on a Webpage in ADF Application

This is a followup post on how we can create an ADF Page based on the business components created in my last post. https://adfjavacodes.blogspot.com/2019/12/creating-first-oracle-adf-application.html

1. Create a page by using clicking on the new Page in the ViewController project.

Creating new JSPX Page

2. Enter the page name and select the Document type. The document type can be of two types
 a. Facelets (JSF Pages)
 b. JSP XML (JSP Pages).

Here we are using JSPX.

Adding page name in oracle ADF

3. From the data control Drag and drop the view object instance on the page.
4. Selecting Row navigation to create First, Next, Previous, Last buttons automatically.

5. Now as you can see the form is created with navigation buttons.


6. From the Data control Drag and drop Commit and Rollback buttons to Commit and rollback the transactions. 


 7. After that drag and drop the data control on the page in form of a table.


8. Select the highlighted options.
a. Enable Sorting (To enable inbuilt sorting in the table)
b. Enable Filtering (To enable inbuilt sorting in the table)
c. Read-only Table (To create a read-only table where editing in table cannot be done) 


9. Drag and drop the delete button from Data Control to delete the record.


10. Now run the Application.


11. The Application will open up in a browser. The Page contains two parts. Form view where the user will do the DML Operation and Table view to view the total records.


12. To create a record click on the createInsert button. It will create a blank record and insert into the view object.


13. A blank record will be created.


14. Fill the relevant values and commit the data.



15. The record is saved and can be viewed in the table.


16. Now we have to edit a record, here we select the Department IT for editing. After edit, we click on Submit Button to submit the record and click on commit to save the record.




16. Now we have to check deletion. So select the record and click on the delete button and then click on the commit button to save the record.



If you have any confusion please let me know :)