Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

FacesContext.getCurrentInstance() returns null

Salman5Apr 29 2014 — edited Apr 30 2014

I am building application using Jdeveloper 11.1.1.7.0. This application will run by a scheduler based on the time interval specified in the application. The main purpose of this application is to do online transaction using Online Web Services.

  1.             FacesContext context = FacesContext.getCurrentInstance(); 
  2.             ValueExpression ve = context.getApplication().getExpressionFactory().createValueExpression(context.getELContext(), "#{data}", BindingContext.class); 
  3.             BindingContext bc = (BindingContext) ve.getValue(context.getELContext()); 
  4.             DCDataControl dc  = bc.findDataControl("someAppDataControl"); 
  5.             someAppImpl someApp= (someAppImpl )dc.getDataProvider(); 

But I am getting Null value for context. Basically, there is no JSF pages at all since the application is not built for user interaction and most likely that's why I am getting Null Pointer Exception. But how to solve this issue?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2014
Added on Apr 29 2014
3 comments
1,686 views