Sunday, 18 June 2017

ADF CONTEXT LEAK SOLUTION

ADF CONTEXT LEAK -

 Hi Guys, today I face a issue while running my application on production.
I was trying to login my application and it was showing Oracle JSP Error:oracle.jsp.parse.JavaCodeExpression.

I opened my Errorlog And saw the message "ADF Detected an ADFContext leak."

Solution -
Step1- open your em(Oracle Enterprise Manager) .
Step2- web logic Domain --> Manage Server(WC_Spaces)
Step3- Click log --> Log Configuration -- > Select ADF in search Drop Down

Step4- Select TRACE:32(FINEST) in oracle.adf.share.ADFContext 

Step5- Click on Apply button and run the application.

So your application will run and not to show ADFContext leak again.

Cheers Guys :)


Tuesday, 28 March 2017

Some Common Errors and Solutions in ADF

Hi All ,Today i'll explain some common errors in ADF which I have faced.
  • 500 Internal Error - I used the URL in the below format https://test.com/test/adf/ I got 500 internal error.  Want to know how to restrict such errors what should be the best approach. Here the context root is test/ but when I add /adf after the context root I get the 500 internal server error. Please let me know if any approaches to avoid such errors.
  • Solution - 'faces' is routed to a special servlet which is defined in the web.xml and it's mapping. the 'adf' is normally mapped to the resources servlet which reads resources from the application.In general you can't prevent the user to input something which doesn't make sense. Such errors (http 404, 500,...) and be routed to error pages which you design to show to the user. This is done in the web.xml in the pages section:



You can add html error codes and use one or more pages to show hte user a 'friendly' error page.

  • When i run the JDeveloper and use ADF framework to create a web application, i create a business components and use the data control to drag and drop table from database, but when i run the application the web-logic give me this error (Error 500--Internal Server Error).
  • Solution - I was updated java, and i found two versions in my laptop (Java 7 update 13, Java 8 update 45), i delete the newer version(Java 8 update 45) and the project started normally.

  • For 500 Error there could be below reasons-
  1. Binding issues.
  2. Data source Issue
  3. root context not matching
  4. services are not up
  5. data base connection issue
  6. bc components issues
  7. run time memory issues
  8. servlet issue
  9. timezone issue
Reason will be mention in log file .

Thanks guys :)

Tuesday, 22 November 2016

Method call on page Load in ADF -

Hi All ,Today i'll show how we can call a method before page load in adf.

I have an requirement After registration I have to send a Activation Url to User's Account.
Once User will click on url he will land into login page and init method will load before login Page.

Step1- Once user registered will get the url like below below screen shot.



Step2- once user will click on url he will land to login page,before landing to login page init() method will call below is the method in login bean class.

    @PostConstruct
       public void init() {
            AdfFacesContext adfCtx = AdfFacesContext.getCurrentInstance();
            Map vmap = adfCtx.getViewScope();
       
            loginId = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("loginId");
            if(loginId != null && vmap.get("loginId") == null ) {
                vmap.put("loginId", loginId);
                userAction = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("ulmsg");
             
                    DCBindingContainer dbc = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
                    OperationBinding op = dbc.getOperationBinding("userLoginMsg");
                    op.getParamsMap().put("loginId", loginId);
                    op.getParamsMap().put("type", userAction);
                    vmap.put("wmsg", op.execute());
            }
         
        }
this method gets the id and ulmsg from the request parameter.

  please make a note that java EE @PostConstruct bean is called once for each bean instantiation. In the managed bean case, the bean is instantiated once per application or session and so is the method executed once. 

Step3- After loading the method login page will appear like below screen shot.



Step4- Once User will success logged in he/she will redirect to payment page,below is the screen shot.



so if any body need to load method before loading the page he/she can use @PostConstruct or use the phase listener in the page like.


<f:view beforePhase="#{ManagedBean.onBeforePhase}">
implements PagePhaseListener and override two method.
public void beforePhase(PagePhaseEvent pagePhaseEvent) {
// write your code which needs to load before page load
}
public void afterPhase(PagePhaseEvent pagePhaseEvent) {
}
Thanks to here me :)

Eclipse With Python

Hi Guys, Today i'll share how to start python project in eclipse IDE. to start Py development in eclipse we need to add Py Dev plugi...