Tuesday 8 September 2015

Jsp cannot be accessed after installing RPS3 patch for Oracle EBS 12.1.3

 

After installing RPS3 (Recommended patch set) for Oracle EBS 12.1.3 (Patch number 20203366) , some JSP files no longer can be accessed from browser.

We are talking mostly about custom JSP files.

After logs investigation I found the following error 

JspServlet: unable to dispatch to requested page: Exception:java.lang.IllegalStateException: Writer already retrieved

I opened the JSP file and found that there is a code :

response.getWriter()

I suspected that it may be the root cause of the problem. So instead of using  response.getWriter() I just used out variable that you get for “free” in JSP.

I mean instead of:

response.getWriter().println(“Hello”)

just use

out.println(“Hello”)

Recompile the JSP, restart adoacore.ctl and the problem is gone

 

Monday 10 August 2015

Oracle ADF dynamic tabs shell doesn’t work on 12c - SOLVED

 

Oracle ADF allows to create a page with a template in which you can open tabs dynamically (it is not really dynamically, but we will ignore it for now). The guide by Oracle can be found here Oracle dynamic Tabs UI shell

If you follow the guide you will find very interesting and frustrating fact. It doesn’t work.

And the reason is because Jdeveloper doesn’t create the binding for the template.

If I just create the page and specify the Tabs template I will see.

image

And the bindings is empty. To make it work we need to define the binding and make the template use it.

image

Now go to the page source and modify af:pageTemplate tag to be

 <af:pageTemplate   viewId="/oracle/ui/pattern/dynamicShell/dynamicTabShell.jspx" id="pt1"
value="#{bindings.pageTemplateBinding}">

 


Now your application will work

 
 

Extending the ADF Controller exception handler

 

There is a good article by Frank Nimphius explaining how to create custom exception handler for ADF application .Frank's blog

But I noticed that it is missing an important details. It is common when someone that KNOWS takes things as obvious and just don’t mention something important.

In this case I am talking about this step

Create a textfile with the name “oracle.adf.view.rich.context.ExceptionHandler” (without the quotes) and store it in .adf\META-INF\services (you need to create the “services” folder)

I opened my project and did exactly as instructed. Created the folder and placed the file. And…. nothing happened

image

Eventually after digging another 20 minutes in Google I eventually found that the actual place I need to put the file is .adf\META-INF directory which is located in the main application directory

image

Details… pay attention to details.

Tuesday 31 March 2015

Oracle ERP – customizing Po Requisition Approval WF Notification

 

The request is to modify Po Requisition Approval Notification that is sent by an email. Erp is 12.1.3

By default it looks like this

image

First of all we need to understand how does the message is generated

We will search for the Workflow in the workflow status monitor and click on the “Workflow Details”

image

We will see a lot of information. We need to scroll down until we find the value of Req Lines Framework Region.

In my case it will be

JSP:/OA_HTML/OA.jsp?OAFunc=ICX_POR_REQLINES_NTFN&reqHdrId=-&DOCUMENT_ID-&contReqFlag=-&CONTRACTOR_REQUISITION_FLAG-&funcCurr=-&FUNCTIONAL_CURRENCY-&contStatus=-&CONTRACTOR_STATUS-&supplEmailNotAvail=-&IS_SUPPLIER_EMAIL_NOT_AVAIL-&vendor=-&VENDOR_DISPLAY_NAME-&contAssignReqd=-&CONTRACTOR_ASSIGNMENT_REQD-

image

What do we understand from this string. We understand that the message content is generated by a call to ICX_POR_REQLINES_NTFN function. Lets open function definition under “Application Developer” responsibility

Under “Web HTML” tab we will see that the function actually calls a OAF region.

image

 

So it is clear that if we replace the region by a custom region, it will display our custom content.

I created a very simple OAF project that has a region with a label “Hello” . (OA region is the only OA component in the project. No VO or AM are needed)

image

 

If you also want to preserve original content of the email, add a region that extends the original region

image 

 

Deploy the new region to the server and change function definition to point to your region

image

Restart OC4J server.

We are done.

Now, after creating the requisition I get my customized email

image