Please disable your adblock and script blockers to view this page

Search this blog

Saturday 29 June 2013

Target Unreachable -identifier 'row' resolved to null ADF_FACES-60097- Oracle ADF

"row resolved to null" in ADF Faces- is one of the most harassing bug , and still there is no proper reason or solution for it.
recently i was working in an ADF application and this error occurs. I was not able to find root cause . see this crash-

and log on console-

<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase APPLY_REQUEST_VALUES 2
javax.el.PropertyNotFoundException: Target Unreachable, identifier 'row' resolved to null
 at com.sun.el.parser.AstValue.getTarget(Unknown Source)
 at com.sun.el.parser.AstValue.isReadOnly(Unknown Source)
 at com.sun.el.ValueExpressionImpl.isReadOnly(Unknown Source)
 at org.apache.myfaces.trinidad.render.CoreRenderer.decode(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.decode(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(
 at org.apache.myfaces.trinidad.component.UIXEditableValue.processDecodes(
 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$ApplyRequestValuesCallback.invokeContextCallback(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXCollection.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(
 at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(
 at org.apache.myfaces.trinidad.component.UIXDocument.invokeOnComponent(
 at javax.faces.component.UIComponent.invokeOnComponent(
 at javax.faces.component.UIComponentBase.invokeOnComponent(
 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(
 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(
 at javax.faces.webapp.FacesServlet.service(
 at weblogic.servlet.internal.StubSecurityHelper$
 at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
 at weblogic.servlet.internal.ServletStubImpl.execute(
 at weblogic.servlet.internal.TailFilter.doFilter(
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(
 at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(
 at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at oracle.adf.library.webapp.LibraryFilter.doFilter(
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at Method)
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at oracle.dms.servlet.DMSServletFilter.doFilter(
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at weblogic.servlet.internal.RequestEventsFilter.doFilter(
 at weblogic.servlet.internal.FilterChainImpl.doFilter(
 at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(
 at weblogic.servlet.internal.WebAppServletContext$
 at weblogic.servlet.internal.WebAppServletContext.securedExecute(
 at weblogic.servlet.internal.WebAppServletContext.execute(
<RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
javax.el.PropertyNotFoundException: Target Unreachable, identifier 'row' resolved to null 

after lot of probing- finally i have fixed it, and sharing same .

Possible Causes-
  • Mainly occurs in editable af:table
  • Problem with Primary Key
  • af:column's component's property is being used in any EL, inside or outside of table
        Exp- #{} 
  • Updateable primary key, and autosubmit true

Possible Solution -
  • Never use primary key as updateable column in af:table, if you have to use then remove primary key from Entity Object
  • Try to validate in RowImpl instead of Expression of Table
  • Surrogate Primary Key
  • Avoid LOV (List of Values) on primary key
  • Change Event Policy of af:table and iterator to none
    these solutions are not rules or conventions, you can only try , and may one of it will work for you

Thursday 27 June 2013

Using af:poll to refresh and push data in page and databound table in ADF

Poll component delivers poll event to server at fixed intervals, we use poll in adf as an alternative of ADS (Active Data Service), this is very simple example of pushing data to page at some fix interval.
Basically af:poll component push data to UI from server.

  • This example contains a page with an af:table binded to Department VO, and I have used a poll component to refresh table periodically.

  • and defined pollListener on af:poll component that sends request to server in every 4 sec, and table get refreshed

  • Other approach to actively push data is ADS, but af:poll is still in use , to refresh table i have written in poll listener

  •         AppModuleAMImpl am = (AppModuleAMImpl)resolvElDC("AppModuleAMDataControl");
            ViewObject vo = am.getDepartment1();
            i = i + 1;
            this.refreshInfo = "Data Reloaded-" + i+"  Total Row-->"+vo.getRowCount();

  • See the jspx page source code-

  • <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="" version="2.1" xmlns:f=""
        < contentType="text/html;charset=UTF-8"/>
            <af:document title="activePushing.jspx" id="d1">
                <af:messages id="m1"/>
                <af:form id="f1">
                    <af:panelBox id="pb1" showDisclosure="false" text="Active Data Pushing">
                        <f:facet name="toolbar">
                            <af:activeOutputText value="#{ActiveDataPushing.refreshInfo}" id="aot1"
                        <af:table value="#{bindings.Department1.collectionModel}" var="row"
                                  emptyText="#{bindings.Department1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                  fetchSize="#{bindings.Department1.rangeSize}" rowBandingInterval="1"
                                  rowSelection="single" id="t1" styleClass="AFStretchWidth" contentDelivery="immediate">
                            <af:column sortProperty="#{}" sortable="true"
                                       headerText="#{bindings.Department1.hints.DepartmentId.label}" id="c1" width="103">
                                <af:inputText value="#{row.bindings.DepartmentId.inputValue}"
                                              shortDesc="#{bindings.Department1.hints.DepartmentId.tooltip}" id="it1"
                                    <f:validator binding="#{row.bindings.DepartmentId.validator}"/>
                                    <af:convertNumber groupingUsed="false"
                            <af:column sortProperty="#{}" sortable="true"
                                       headerText="#{bindings.Department1.hints.DepartmentName.label}" id="c2" width="107">
                                <af:inputText value="#{row.bindings.DepartmentName.inputValue}"
                                              shortDesc="#{bindings.Department1.hints.DepartmentName.tooltip}" id="it2"
                                    <f:validator binding="#{row.bindings.DepartmentName.validator}"/>
                            <af:column sortProperty="#{}" sortable="true"
                                       headerText="#{bindings.Department1.hints.ManagerId.label}" id="c3" width="105">
                                <af:inputText value="#{row.bindings.ManagerId.inputValue}"
                                              shortDesc="#{bindings.Department1.hints.ManagerId.tooltip}" id="it3"
                                    <f:validator binding="#{row.bindings.ManagerId.validator}"/>
                                    <af:convertNumber groupingUsed="false"
                            <af:column sortProperty="#{}" sortable="true"
                                       headerText="#{bindings.Department1.hints.LocationId.label}" id="c4" width="105">
                                <af:inputText value="#{row.bindings.LocationId.inputValue}"
                                              shortDesc="#{bindings.Department1.hints.LocationId.tooltip}" id="it4"
                                    <f:validator binding="#{row.bindings.LocationId.validator}"/>
                                    <af:convertNumber groupingUsed="false"
                        <af:poll id="p1" pollListener="#{ActiveDataPushing.pollListenerActive}" interval="4000"

  • Run your application, and do changes from Database and see updated UI at every 4 sec. :-)
 Reloading- 26th times-
 Reloading- 33th times-
 Reloading- 40th times-

Tuesday 25 June 2013

Conditional Execution of Model (EO) level Validation- Oracle ADF

You all know about ADF model level validation , we can apply variety of validation on model (Entity Object), as for length, compare, key, regular expression, script and unique key etc.

I am not going to describe whole process for model layer validation, for detailed tutorial on EO level validation see -Dynamic (parameterize) model level validation using message token
Now see how we can execute these validation conditionally -

  • When we apply unique key validation on Entity Object- this window appears-
  • Now go to Validation Execution and write your condition in given box for that you want to execute validation

  • Now go to Failure Handling tab and write your failure handling message, and you are done

  • Now run your application and see how validation executes for your condition
  • this functionality is really helpful and sometimes avoids writing lot of managed bean code

Thursday 20 June 2013

Bing language Translation API integration with Java- microsoft-translator-java-api

Google Translation is very popular and widely used for language translation as it is now paid service,
so i  came to know about Microsoft Translator (Bing Translator), it is providing free API up to 2000,000 character/Month to translate.

Key features and point-
  • Provides java wrapper around microsoft translator (Bing Translator)
  • Developed as alternative of Google Translator
  • Follow coding standard, naming, functionality and usage patterns of widely used google translation API
This is very very simple to use -Follow steps

  • First Download JAR for API-  with all dependencies
  • Now obtain client secret key and client id in order to access API , see this
  • After this create a simple java class and just write this code-
  • Don't forget to add JAR in your project's class path

  • package translation;
    import com.memetix.mst.language.Language;
    import com.memetix.mst.translate.Translate;
    public class MicrosoftTranslator {
        public static void main(String[] args) throws Exception {
            Translate.setClientId("secret client id");
            Translate.setClientSecret("secret key");
            String translatedText = Translate.execute("hello", Language.ENGLISH, Language.FRENCH);

  • Enter your key and id in code, you can change language with available list, and run this code
  • To use this in web application , you must handle SSL certificate

Sunday 16 June 2013

Using Java API for getting Weather information in Oracle ADF-wunderground-core

hello everyone, here is nice tutorial for all ADF techies-
i have developed an application in ADF that retrieves weather information of a country's weather stations.
as-temperature, humidity, dew, rain rate, wind speed etc using wunderground-core 
API . This API fetch weather data for a weater station by given month and year or data for all the stations of a country.

Feature of this wunderground-core-
  1. Very simple to use
  2. Date Listener support
  3. Fetch weather data for all stations of country
  4. can be used with desktop or web application
  5. Ajax supported
  6. Real Time weather values
 Change Country-

and download jar distribution with all dependencies

  • Now start , create a fusion web application and add jar file to  classpath
  • Now create a bounded taskflow and a .jsff page inside this , now see the simple code to get all weather station of acountry and their weather data

  •         /*  create an instance of WeatherStationService */
            WeatherStationService weatherStationService = new WeatherStationService();
            /*  find all weather stations */
            List<WeatherStation> stations = weatherStationService.findAllWeatherStationsByCountry("INDIA");
            for (WeatherStation weatherStation : stations) {
                System.out.println(weatherStation.getStationId() + "\t" + "\t" + weatherStation.getCity() + "\t" +
                HttpDataReaderService dataReader = new HttpDataReaderService();
                DataSet current = dataReader.getCurrentData();
                System.out.println(current.getDateTime() + "Temperature- " + current.getTemperature() + "Humidity-" +

  • I have used this code on my af:commandButton for getting weather data, and a table on page to show this information on page using list (arrayList) , rest is same and simple like other ADF Application
  • Download Sample Application and see it, you will also learn that how to show a table using List(Java) Sample ADF Application

  • See source of .jsff page for tables'use and values-

  • <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="" version="2.1" xmlns:af=""
        <af:panelBox text="Weather Report" id="pb1" showDisclosure="false">
            <f:facet name="toolbar"/>
            <af:panelFormLayout id="pfl1">
                <af:inputText label="Country Name" id="it1"
                <af:commandButton text="Get Report" id="cb1" actionListener="#{WeatherReportBean.getWeatherReportButton}"
            <af:popup childCreation="deferred" autoCancel="disabled" id="p1">
                <af:dialog id="d1" title="User-User4" type="none">
                    <f:facet name="buttonBar"/>
                    <af:message id="m1" message="You are not authorize to make an order of 25000, your limit is 20000 !!!"
            <af:panelGroupLayout id="pgl1" layout="horizontal">
                <af:table var="row" rowBandingInterval="1" id="t1" value="#{WeatherReportBean.stations}"
                          partialTriggers="::cb1" contentDelivery="immediate" width="500">
                    <af:column sortable="false" headerText="Country" id="c3">
                        <af:spacer width="10" height="10" id="s2"/>
                        <af:outputText value="#{}" id="ot3" inlineStyle="font-weight:bold;color:red;"/>
                        <af:spacer width="10" height="10" id="s1"/>
                    <af:column sortable="false" headerText="Locality" id="c4" width="150">
                        <af:outputText value="#{row.neighborhood}" id="ot4"/>
                    <af:column sortable="false" headerText="City" id="c2">
                        <af:outputText value="#{}" id="ot2" inlineStyle="font-weight:bold;color:darkgreen;"/>
                    <af:column sortable="false" headerText="Station Id" id="c1">
                        <af:outputText value="#{row.stationId}" id="ot1" inlineStyle="font-weight:bold;color:darkblue;"/>
                <af:table value="#{WeatherReportBean.reportL}" var="row" rowBandingInterval="1" id="t2"
                          contentDelivery="immediate" partialTriggers="::t1 ::cb1" styleClass="AFStretchWidth" width="800">
                    <af:column sortable="false" headerText="Date" align="start" id="c5">
                        <af:spacer width="10" height="10" id="s4"/>
                        <af:outputText value="#{row.currDate}" id="ot5" inlineStyle="font-weight:bold;">
                            <af:convertDateTime pattern="dd/MMM/yyyy"/>
                        <af:spacer width="10" height="10" id="s3"/>
                    <af:column sortable="false" headerText="Temperature" align="end" id="c6" width="70">
                        <af:outputText value="#{row.temp} C" id="ot6" inlineStyle="font-weight:bold;color:teal;"/>
                    <af:column id="c7" headerText="Humidity" align="right" width="70">
                        <af:outputText value="#{row.humid}" id="ot7" inlineStyle="font-weight:bold;color:orange;"/>
                    <af:column id="c8" headerText="Dew Point" align="right" width="70">
                        <af:outputText value="#{row.dewR}" id="ot8" inlineStyle="font-weight:bold;color:green;"/>
                    <af:column id="c9" headerText="Wind Direction" align="right" width="70">
                        <af:outputText value="#{row.windDirec}" id="ot9" inlineStyle="font-weight:bold; color:Olive;"/>
                    <af:column id="c10" headerText="Wind Speed (Km/H)" align="right">
                        <af:outputText value="#{row.windSpd}" id="ot10"
                    <af:column id="c11" headerText="Rain Rate" align="right" width="70">
                        <af:outputText value="#{row.rainRt}" id="ot11" inlineStyle="font-weight:bold;color:maroon;"/>
                    <af:column id="c12">
                        <af:image shortDesc="Weather" id="i1"
                                  source="#{row.temp >35 ? resource['images:sun.png'] : resource['images:sun_slush.png']}"/>

  • And see managed bean code to populate data in tables on page, other than manged bean i have used a java bean to populate value in list and then in table

  • package weather.view.bean;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.event.ActionEvent;
    import oracle.jbo.domain.Date;
    public class WeatherReportBean implements Serializable {
        private RichInputText cntryNameBind;
        public WeatherReportBean() {
        WeatherStationService weatherStationService = new WeatherStationService();
        List<WeatherStation> stations;
        List<Report> reportL;
        public void getWeatherReportButton(ActionEvent actionEvent) throws SQLException {
            if (cntryNameBind.getValue() != null) {
                String cntryName = cntryNameBind.getValue().toString();
                stations = weatherStationService.findAllWeatherStationsByCountry(cntryName);
                reportL = new ArrayList<Report>(50);
                for (WeatherStation weatherStation : stations) {
                    HttpDataReaderService dataReader = new HttpDataReaderService();
                    DataSet current = dataReader.getCurrentData();
                    java.util.Date b = new java.util.Date();
                    Double c = new Double(0);
                    Integer humidity = 0;
                    Double dew = new Double(0);
                    String windDir = "";
                    Double windSp = new Double(0);
                    Double rainRate = new Double(0);
                    if (current != null) {
                        if (current.getDateTime() != null) {
                            b = current.getDateTime();
                            c = current.getTemperature();
                            humidity = current.getHumidity();
                            dew = current.getDewPoint();
                            windDir = current.getWindDirection();
                            windSp = current.getWindSpeedKmh();
                            rainRate = current.getRainRateHourlyMm();
                            System.out.println("Humidity is-->" + current.getHumidity() + "dew point-->" +
                                               current.getDewPoint() + "wind -->" + current.getWindDirection() +
                                               "speed--" + current.getWindSpeedKmh());
                    reportL.add(new Report(b, c, humidity, dew, windDir, windSp, rainRate));
        public void setStations(List<WeatherStation> stations) {
            this.stations = stations;
        public List<WeatherStation> getStations() {
            return stations;
        public void setReportL(List<Report> reportL) {
            this.reportL = reportL;
        public List<Report> getReportL() {
            return reportL;
        public void setCntryNameBind(RichInputText cntryNameBind) {
            this.cntryNameBind = cntryNameBind;
        public RichInputText getCntryNameBind() {
            return cntryNameBind;

  • bean class to populate list

  • package weather.view.bean;
    import java.util.Date;
    public class Report {
        private Date CurrDate;
        private double temp;
        Integer humid;
        Double dewR;
        String windDirec;
        Double windSpd;
        Double rainRt;
        public Report(Date date, Double double1, Integer hum, Double de, String windD, Double windS, Double Rain) {
            System.out.println("date is-->" + date + "and temp is-->" + double1);
            this.CurrDate = date;
            this.humid = hum;
            this.dewR = de;
            this.windDirec = windD;
            this.windSpd = windS;
            this.rainRt = Rain;
        public void setCurrDate(Date CurrDate) {
            this.CurrDate = CurrDate;
        public Date getCurrDate() {
            return CurrDate;
        public void setTemp(double temp) {
            this.temp = temp;
        public double getTemp() {
            return temp;
        public void setHumid(Integer humid) {
            this.humid = humid;
        public Integer getHumid() {
            return humid;
        public void setDewR(Double dewR) {
            this.dewR = dewR;
        public Double getDewR() {
            return dewR;
        public void setWindDirec(String windDirec) {
            this.windDirec = windDirec;
        public String getWindDirec() {
            return windDirec;
        public void setWindSpd(Double windSpd) {
            this.windSpd = windSpd;
        public Double getWindSpd() {
            return windSpd;
        public void setRainRt(Double rainRt) {
            this.rainRt = rainRt;
        public Double getRainRt() {
            return rainRt;