ViewObject is null ?

I’m developing a jsp application with bc4j using jdev 10g. I have a problem with viewobjects in the application module suddenly becoming null. It doesn't happen every time and it seems to depend on the computer environment as well. It works fine in the development environment, but when I transfer the application to my clients environment I am getting the error. The error happens in dataAction class. I have tried to place the code in findForward method and prepareModel method but the result is the same. Debugging the application I found that mViewObjects and mViewLinks in the application module become null at some point. The action gets executed a couple times and it works fine and then it breaks down.
I can't see what is causing the problem. Below is the code of the dataAction. 'bindContainer' and 'module' in the prepareModel method are not null, but 'view' becomes null. It is also interesting that the data on the page (from the same view) is displayed correctly.
public class FindSredstvaViewPageAction extends DataAction
String page;
protected void findForward(DataActionContext actionContext) throws Exception
//Postavi page attribute tako da se otvori stranica na kojoj je current row, SredstvaView
actionContext.getHttpServletRequest().setAttribute(MyGlobals.PAGE, page);
// TODO: Override this oracle.adf.controller.struts.actions.DataAction method
super.findForward(actionContext);
private String getPage(int index)
int rows_per_page = MyGlobals.ROWS_PER_PAGE;
int page = 0;
while(true)
if(index < 0) break;
if(index == 0) // prvi red na strani
page ++;
break;
index = index - rows_per_page;
page ++;
return String.valueOf(page);
protected void prepareModel(DataActionContext actionContext) throws Exception
DCBindingContainer bindContainer = actionContext.getBindingContainer();
StalnaSredstvaModuleImpl module = ((StalnaSredstvaModuleImpl)actionContext.getBindingContainer().getApplicationModule());
SredstvaViewImpl view = module.getSredstvaView();
page = getPage(view.getCurrentRowIndex());
// TODO: Override this oracle.adf.controller.struts.actions.DataAction method
super.prepareModel(actionContext);

Hi,
Please use DCDataControl.getDataProvider() to acquire an AM reference. Because your logic is implemented before prepareModel DCBindingContainer may reference an uninitialized AM reference from a previous request (I filed bug 3829746 to resolve this issue).
Also, it is not recommended that you downcast to an AM "Impl" class in client side code. This will prevent your code from being redeployed in different configurations (immediate vs. batch). Instead of downcasting to the "Impl" class you may export the VO getter to a remote AM interface using the AM wizard and then downcast to the AM interface or use findViewObject(String) on the base ApplicationModule interface.
Hope this helps,
JR

Similar Messages

  • GetUserRoles in viewobject throws null pointer exception

    Hello,
    I've set up security for our jsf-adf-bc4j application.
    I now want to get the user role in our viewobject.
    I use the following code :
    SessionImpl session = (SessionImpl) this.getDBTransaction().getSession();
    String[] roles = session.getUserRoles();
    for (String role : roles){
    System.out.println(role);
    This throws a null pointer exception at the"System.out.println(role);" line .
    The user has a role (I can read the role in the viewcontroller project)
    In the view object i can also get the session.getUserPrincipalName(). This works fine.
    Can anybody help me with this problem ?

    You define a local ArrayList here:public MonthlySchedule()
    ArrayList<Request> monthlyschedule= new ArrayList<Request>() ;
    }Just instanciate the instance variable.

  • Cannot set selectOneChoice value during reload (value auto become null)

    Dear all,
    I have a problem that getting null value in the SelectOneChoice field in a table binded to
    a view object. If I change that SelectOneChoice to inputText, it works perfectly. The details
    of the situation is described as follows:
    I've binded a view objects with 8 attributes to a af:table, then I manually change
    2 of the inputText fields inside 'Column' fields of the table to inputlistofvalue and
    selectOneChoice. The code is as follow:
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.AcNo.name}"
    sortable="false"
    headerText="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
    id="c1" width="180"
    inlineStyle="font-family:'Times New Roman', 'Arial Black', times, Serif; font-size:medium;">
         <af:inputListOfValues value="#{row.bindings.AcNo.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
              required="#{bindings.OpenBalanceVO1.hints.AcNo.mandatory}"
              columns="#{bindings.OpenBalanceVO1.hints.AcNo.displayWidth}"
              maximumLength="#{bindings.OpenBalanceVO1.hints.AcNo.precision}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.AcNo.tooltip}"
              id="it1"
              model="#{bindings.AcNo2.listOfValuesModel}"
              autoSubmit="false"
              returnPopupListener="#{backingBeanScope.backing_ImportOpenBalance.returnListener}">
              <f:validator binding="#{row.bindings.AcNo.validator}"/>
         </af:inputListOfValues>
    </af:column>
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.CurrencyCode.name}"
         sortable="false"
         headerText="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
         id="c2">
         <af:selectOneChoice value="#{row.bindings.CurrencyCode.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.CurrencyCode.tooltip}"
              id="it2" autoSubmit="false"
              partialTriggers="cb1 cb2">
              <f:selectItems value="#{loginInfo.activeCurrencies}" id="currenciesList"/>
         </af:selectOneChoice>
    </af:column>
    And I have binded the returnPopupListener to returnListerner event handler to automatically
    set the Currency field (2nd field) after the user chose the Account field (1st field) from
    the input list of value:
    public void returnListener(ReturnPopupEvent returnPopupEvent) {
         RichInputListOfValues lovField = (RichInputListOfValues)returnPopupEvent.getSource();
         ListOfValuesModel lovModel = lovField.getModel();
         CollectionModel collectionModel = lovModel.getTableModel().getCollectionModel();
         JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
         RowKeySet rks = (RowKeySet)returnPopupEvent.getReturnValue();
         List tableRowKey = (List)rks.iterator().next();
         DCIteratorBinding dciter = treeBinding.getDCIteratorBinding();
         Key key = (Key)tableRowKey.get(0);
         Row row = dciter.findRowByKeyString(key.toStringFormat(true));
         DCBindingContainer bc = getBindingContainer();
         DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
         OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
         FacesContext fctx = FacesContext.getCurrentInstance();
         ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();
         ValueExpression ve = elFactory.createValueExpression(fctx.getELContext(), "#{loginInfo}", LoginInfo.class);
         LoginInfo loginInfo = (LoginInfo)ve.getValue(fctx.getELContext());
         System.out.println("Return place: search date:" + loginInfo.getSearchDate());
         Row newRow = viewObject.createRow();
         String selectedAcNo = row.getAttribute("AcNo").toString();
         String selectedCurrency = row.getAttribute("CurrencyCode").toString();
         newRow.setAttribute("AcNo", selectedAcNo);
         newRow.setAttribute("CurrencyCode",selectedCurrency);
         newRow.setAttribute("OpenBal", 300);
         newRow.setAttribute("AvailBal", 200);
         newRow.setAttribute("CreateDate", new Date());
         newRow.setAttribute("EffectiveDate", loginInfo.getSearchDate());
         newRow.setAttribute("LockStatus", "N");
         viewObject.insertRowAtRangeIndex(rowIndex, newRow);
    The problem occurs when I use a 'createInsert' button to create a new row in the table,
    and then choose a value from the inputListOfValues. The new row refresh and get the value
    I chose in the first column in the new row. But the second column (currency field) is left
    as empty (null value). If I change the second column frmo selectOneChoice to inputText,
    the correct Currency value (e.g. "HKD" or "USD") can be shown. So I wonder if there is any
    additional tricks in order to set the selectOneChoice value during refresh.
    Additionally I have tried to check the state of the view object attributes during the refresh
    lifecycle and found that the following reload method (else place) is being reached 3 times after I click
    the 'ok' button in the popup up in the inputListOfValue.
    public void beforePhase(PagePhaseEvent event) {
         //System.out.println("i am here inside backing bean : before phrase 1 phrase ID:" + event.getPhaseId());
         if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
              if (!isPostback()) {
              } else {
                   System.out.println("Post Back on Page Load!");
                   DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
                   OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
                   RowSetIterator iterator = viewObject.createRowSetIterator(null);
                   iterator.reset();
                   while (iterator.hasNext()) {
                        //Row row = viewObject.getCurrentRow();
                        Row row = iterator.next();
                        System.out.print("Account:" + row.getAttribute("AcNo"));
                        System.out.print(",AvailBal:" + row.getAttribute("AvailBal"));
                        System.out.print(",OpenBal:" + row.getAttribute("OpenBal"));
                        System.out.print(",CurrencyCode:" + row.getAttribute("CurrencyCode"));
                        System.out.print(",EffectiveDate:" + row.getAttribute("EffectiveDate"));
                        System.out.print(",UserCreate:" + row.getAttribute("UserCreate"));
                        System.out.println("");
                        if (row.getAttribute("UserCreate").toString().equals("<current user>")) {
                             System.out.println("Match <current user> in preload");
                             //row.setAttribute("CurrencyCode", "USD");
                   System.out.println("end of reload");
    During the 1st time, the CurrencyCode field was set currently, but then in the 2nd and 3rd
    times, it's value suddenly changed to 'null'. If I use inputText, all the 3 times currencyCode
    field is showing correctly without the null issue.
    Anyone can kindly give me some hints? Thanks a lot!!!

    Dear all,
    I have a problem that getting null value in the SelectOneChoice field in a table binded to
    a view object. If I change that SelectOneChoice to inputText, it works perfectly. The details
    of the situation is described as follows:
    I've binded a view objects with 8 attributes to a af:table, then I manually change
    2 of the inputText fields inside 'Column' fields of the table to inputlistofvalue and
    selectOneChoice. The code is as follow:
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.AcNo.name}"
    sortable="false"
    headerText="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
    id="c1" width="180"
    inlineStyle="font-family:'Times New Roman', 'Arial Black', times, Serif; font-size:medium;">
         <af:inputListOfValues value="#{row.bindings.AcNo.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
              required="#{bindings.OpenBalanceVO1.hints.AcNo.mandatory}"
              columns="#{bindings.OpenBalanceVO1.hints.AcNo.displayWidth}"
              maximumLength="#{bindings.OpenBalanceVO1.hints.AcNo.precision}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.AcNo.tooltip}"
              id="it1"
              model="#{bindings.AcNo2.listOfValuesModel}"
              autoSubmit="false"
              returnPopupListener="#{backingBeanScope.backing_ImportOpenBalance.returnListener}">
              <f:validator binding="#{row.bindings.AcNo.validator}"/>
         </af:inputListOfValues>
    </af:column>
    <af:column sortProperty="#{bindings.OpenBalanceVO1.hints.CurrencyCode.name}"
         sortable="false"
         headerText="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
         id="c2">
         <af:selectOneChoice value="#{row.bindings.CurrencyCode.inputValue}"
              label="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
              shortDesc="#{bindings.OpenBalanceVO1.hints.CurrencyCode.tooltip}"
              id="it2" autoSubmit="false"
              partialTriggers="cb1 cb2">
              <f:selectItems value="#{loginInfo.activeCurrencies}" id="currenciesList"/>
         </af:selectOneChoice>
    </af:column>
    And I have binded the returnPopupListener to returnListerner event handler to automatically
    set the Currency field (2nd field) after the user chose the Account field (1st field) from
    the input list of value:
    public void returnListener(ReturnPopupEvent returnPopupEvent) {
         RichInputListOfValues lovField = (RichInputListOfValues)returnPopupEvent.getSource();
         ListOfValuesModel lovModel = lovField.getModel();
         CollectionModel collectionModel = lovModel.getTableModel().getCollectionModel();
         JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
         RowKeySet rks = (RowKeySet)returnPopupEvent.getReturnValue();
         List tableRowKey = (List)rks.iterator().next();
         DCIteratorBinding dciter = treeBinding.getDCIteratorBinding();
         Key key = (Key)tableRowKey.get(0);
         Row row = dciter.findRowByKeyString(key.toStringFormat(true));
         DCBindingContainer bc = getBindingContainer();
         DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
         OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
         FacesContext fctx = FacesContext.getCurrentInstance();
         ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();
         ValueExpression ve = elFactory.createValueExpression(fctx.getELContext(), "#{loginInfo}", LoginInfo.class);
         LoginInfo loginInfo = (LoginInfo)ve.getValue(fctx.getELContext());
         System.out.println("Return place: search date:" + loginInfo.getSearchDate());
         Row newRow = viewObject.createRow();
         String selectedAcNo = row.getAttribute("AcNo").toString();
         String selectedCurrency = row.getAttribute("CurrencyCode").toString();
         newRow.setAttribute("AcNo", selectedAcNo);
         newRow.setAttribute("CurrencyCode",selectedCurrency);
         newRow.setAttribute("OpenBal", 300);
         newRow.setAttribute("AvailBal", 200);
         newRow.setAttribute("CreateDate", new Date());
         newRow.setAttribute("EffectiveDate", loginInfo.getSearchDate());
         newRow.setAttribute("LockStatus", "N");
         viewObject.insertRowAtRangeIndex(rowIndex, newRow);
    The problem occurs when I use a 'createInsert' button to create a new row in the table,
    and then choose a value from the inputListOfValues. The new row refresh and get the value
    I chose in the first column in the new row. But the second column (currency field) is left
    as empty (null value). If I change the second column frmo selectOneChoice to inputText,
    the correct Currency value (e.g. "HKD" or "USD") can be shown. So I wonder if there is any
    additional tricks in order to set the selectOneChoice value during refresh.
    Additionally I have tried to check the state of the view object attributes during the refresh
    lifecycle and found that the following reload method (else place) is being reached 3 times after I click
    the 'ok' button in the popup up in the inputListOfValue.
    public void beforePhase(PagePhaseEvent event) {
         //System.out.println("i am here inside backing bean : before phrase 1 phrase ID:" + event.getPhaseId());
         if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
              if (!isPostback()) {
              } else {
                   System.out.println("Post Back on Page Load!");
                   DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
                   OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
                   RowSetIterator iterator = viewObject.createRowSetIterator(null);
                   iterator.reset();
                   while (iterator.hasNext()) {
                        //Row row = viewObject.getCurrentRow();
                        Row row = iterator.next();
                        System.out.print("Account:" + row.getAttribute("AcNo"));
                        System.out.print(",AvailBal:" + row.getAttribute("AvailBal"));
                        System.out.print(",OpenBal:" + row.getAttribute("OpenBal"));
                        System.out.print(",CurrencyCode:" + row.getAttribute("CurrencyCode"));
                        System.out.print(",EffectiveDate:" + row.getAttribute("EffectiveDate"));
                        System.out.print(",UserCreate:" + row.getAttribute("UserCreate"));
                        System.out.println("");
                        if (row.getAttribute("UserCreate").toString().equals("<current user>")) {
                             System.out.println("Match <current user> in preload");
                             //row.setAttribute("CurrencyCode", "USD");
                   System.out.println("end of reload");
    During the 1st time, the CurrencyCode field was set currently, but then in the 2nd and 3rd
    times, it's value suddenly changed to 'null'. If I use inputText, all the 3 times currencyCode
    field is showing correctly without the null issue.
    Anyone can kindly give me some hints? Thanks a lot!!!

  • Testing ViewObject from ApplicationModule

    Hi all,
    I am trying to test the ViewObject from the ApplicationModule, but the ViewObject is null, what is the proper way to initialize it? Here is my code:
    public static void main(String[] args) {
    MyAppModuleImpl impl = new MyAppModuleImpl ();
    MyClazzViewObjectImpl vpl = new getMyClazzViewObjectImpl1();
    vpl.executeQuery(); //NULL POINTER OCCURS UPON REFERENCE TO vpl
    System.out.println(vpl.getAllRowsInRange().length);
    Can someone point me to the right direction? Thanks very much in advance.

    Thanks John for the quick response, I should of been a bit more detail in my original post. After doing a bit more digging around here is the solution I found:
    public static void main(String[] args) {
    try
    ApplicationModule am = Configuration.createRootApplicationModule("model.MyAppModule", "MyAppModuleLocal");
    System.out.println(am.getTransaction().isConnected()); //should print true.
    ViewObject vo =am.findViewObject("MyClazzView1"); //This string should correspond to the accessor definition inside your Application Module.
    vo.executeQuery();
    am.getTransaction().commit();
    Row[] rows = vo.getAllRowsInRange();
    System.out.println("Rows in range: " + rows.length); //Should print out a number if you defined your VO correctly.
    catch (Exception ex) {
    ex.printStackTrace();
    -W

  • Is there a way to force a View Object to query the database always?

    Dear All,
    Is there a way to force a view object to always scan the database table to read the latest data?
    Here's my use case.
    I have a page that loads data then I have a button which executes the following code.
    viewObject.setApplyViewCriteriaName("SampleCriteria");
    viewObject.setNamedWhereClauseParam("arg1", "test");
    viewObject.executeQuery();
    RowSetIterator it = viewObject.createRowSetIterator(null); 
    while(it.hasNext()) {
         /* More Code */
    }Suppose after page load, I edited some row in the table and then I clicked the button. I notice that my edited row
    was not reflected in the query.
    I am not sure but is there some configuration to check so that when the viewobject executes it will always query the data
    from the table?
    I am thinking that there is some level of caching and I want to disable it. If I restart my application, I notice that it is able to read the latest data.
    JDEV 11.1.1.5

    By default a view object performs its query against the database to retrieve the rows in its resulting row set. However, you can also use view objects to perform in-memory searches and sorting to avoid unnecessary trips to the database.
    The view object's query mode controls the source used to retrieve rows to populate its row set. For more details please refer: http://docs.oracle.com/cd/B31017_01/web.1013/b25947/bcadvvo005.htm
    Also, see if this helps: setQueryMode for secondary rowSet not working

  • What is best practice to iterator  VO ?

    Hi,
    Please Let me know what is the best approach to iterator the VO.i used to do like following --
    ViewObject viewObject=getTestObject();
    Row[] row=viewObject.getAllRowsInRange();
    for(int i=;i<row.lenght;i++)
         //operation logic
    }Is this correct way or the following why which was suggest by my friends yesterday night
    ViewObject viewObject=getTestObject();
    RowSetIterator iterator = viewObject.createRowSetIterator(null);
    iterator.reset();
    while (iterator.hasNext()) {
       Row row = iterator.next();
    // process the row here
    iterator.closeRowSetIterator();Thanks

    Hi,
    Check following
    http://adfbugs.blogspot.com/2009/07/iterating-through-view-object.html

  • JDev 11g-Multiple Row Selection Table-Ctrl+A error

    Hello All,
    Jdeveloper : Studio Edition Version 11.1.1.2.0, Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    ADF Business Components : 11.1.1.55.36
    Java(TM) Platform : 1.6.0_11
    Oracle IDE: 11.1.1.2.36.55.36
    SOA Composite Editor: 11.1.1.2.0.12.16
    Versioning Support: 11.1.1.2.36.55.36
    I am trying to remove the selected rows from the table with RowSelection property set to Multiple. I am able to select the rows using by holding key board Ctrl key and click on the rows. The following code in backing bean successfully deletes the rows selected using this step.
    public void removeGeoSpecs(ActionEvent actionEvent)
    RowKeySet rowKeySet = getGmemTbl().getSelectedRowKeys();
    CollectionModel collectionModel =
    (CollectionModel) getGmemTbl().getValue();
    for (Object facesTreeRowKey: rowKeySet)
    collectionModel.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding) collectionModel.getRowData();
    rowData.getRow().remove();
    But when i select all the rows in the table using Ctrl+A, all the rows got selected. I hit the Remove button, then after deleting the first row, getting the following error.
    javax.servlet.ServletException: ADFv: Could not find row: USA 548 with key: oracle.jbo.Key[] inside parent: GeoSpecTVOIterator with key: null.
    Caused by: java.lang.IllegalStateException: ADFv: Could not find row: USA 548 with key: oracle.jbo.Key[] inside parent: GeoSpecTVOIterator with key: null.
    Here USA 548 is my first row's data. Please let me know if you want complete error stack.
    During design time, While drag and drop the table i have not selected Row Selection check box as it sets property for single row selection. Table is inside the <af:panelCollection> . Here is the table source.
    <af:table value="#{bindings.GeoSpecTVO.collectionModel}" var="row"
    rows="#{bindings.GeoSpecTVO.rangeSize}"
    emptyText="#{bindings.GeoSpecTVO.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.GeoSpecTVO.rangeSize}"
    rowBandingInterval="0" id="GmemTbl"
    partialTriggers=":::AddRowsBtn :::AddRangeBtn ::RemoveBtn :::SaveBtn"
    rowSelection="multiple"
    binding="#{backingBeanScope.GeoGrpSpecBean.gmemTbl}">
    Here GeoSpecTVO is a transient view object which is not having query and not attached with EO.
    I tried to fix this issue by myself and also searched for similar issues in the FORUM and google. But no luck... I very much appreciate all your inputs/pointers. Kindly let me know if you need additional information.
    Thanks
    Annadurai.

    Hi Annadurai
    I tried the same work around but still i am facing the issue, could you please help me.
    public void deleteRec(ActionEvent actionEvent) {
    // Add event code here...
    RowKeySet rowKeySet = (RowKeySet)this.embossTB.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.embossTB.getValue();
    Row specRow = null;
    ArrayList rowList = new ArrayList();
    int listLength = 0;
    ArrayList<Number> printReqLST=new ArrayList<Number>();
    ViewObject vo1=null;
    boolean flag=false;
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    specRow = rowData.getRow();
    rowList.add(specRow);
    listLength++;
    for (int index = 0; index < listLength; index++){
    specRow = (Row)rowList.get(index);
    Number printReqID = (Number)specRow.getAttribute("PrintRequestId");
    String PrintState = specRow.getAttribute("PrintState").toString();
    if (PrintState.equalsIgnoreCase("PRINTED")) {
    System.out.println("cann't delete");
    FacesContext fctx = FacesContext.getCurrentInstance();
    FacesMessage message =
    new FacesMessage("Cann't Delete the selected row:" + printReqID);
    message.setSeverity(FacesMessage.SEVERITY_ERROR);
    fctx.addMessage(null, message);
    } else {
    System.out.println("delete");
    flag=true;
    specRow.remove();
    if(flag){
    System.out.println("before commit");
    commitRows();
    }

  • BLOB image not shows in JSP page!!

    Hi Dear all,
    I had tried to configure how to show BLOB image to jsp page . The code are works fine and servlet works ok but image can not show only. can you help me that what need to be added. Please help me.
    Can any experts help me? BLOB image not shows in JSP page. I am using ADF11g/DB 10gR2.
    My as Code follows:
    _1. Servlet Config_
        <servlet>
            <servlet-name>images</servlet-name>
            <servlet-class>his.model.ClsImage</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>images</servlet-name>
            <url-pattern>/render_images</url-pattern>
        </servlet-mapping>
      3. class code
    package his.model;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.util.Map;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ClsImage extends HttpServlet
      //private static final Log LOG = LogFactory.getLog(ImageServlet.class);
      private static final Log LOG = LogFactory.getLog(ClsImage.class);
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        System.out.println("GET---From servlet============= !!!");
        String appModuleName = "his.model.ModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleName");
        String appModuleConfig = "TempModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleConfig");
        String voQuery ="select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = 'P1000000000006'" ;// 'P1000000000006' this.getServletConfig().getInitParameter("ImageViewObjectQuery");
        String mimeType = "jpg";//this.getServletConfig().getInitParameter("gif");
        //?IMAGE_NO='P1000000000006'
        //TODO: throw exception if mandatory parameter not set
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName, appModuleConfig);
          ViewObject vo =  am.createViewObjectFromQueryStmt("TempView2", voQuery);
        Map paramMap = request.getParameterMap();
        Iterator paramValues = paramMap.values().iterator();
        int i=0;
        while (paramValues.hasNext())
          // Only one value for a parameter is expected.
          // TODO: If more then 1 parameter is supplied make sure the value is bound to the right bind  
          // variable in the query! Maybe use named variables instead.
          String[] paramValue = (String[])paramValues.next();
          vo.setWhereClauseParam(i, paramValue[0]);
          i++;
       System.out.println("before run============= !!!");
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        System.out.println("after run============= !!!");
        Row product = vo.first();
        //System.out.println("============"+(BlobDomain)product.getAttribute(0));
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null)
          System.out.println("onside product============= !!!");
           // We assume the Blob to be the first a field
           image = (BlobDomain) product.getAttribute(0);
           //System.out.println("onside  run product============= !!!"+image.toString() +"======="+image );
           // Check if there are more fields returned. If so, the second one
           // is considered to hold the mime type
           if ( product.getAttributeCount()> 1 )
              mimeType = (String)product.getAttribute(1);       
        else
          //LOG.warn("No row found to get image from !!!");
          LOG.warn("No row found to get image from !!!");
          return;
        System.out.println("Set Image============= !!!");
        // Set the content-type. Only images are taken into account
        response.setContentType("image/"+ mimeType+ "; charset=windows-1252");
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[4096];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
          //System.out.println("Set Image============= loop!!!"+(is.read(buffer)));
        os.close();
        // Remove the temporary viewobject
        vo.remove();
        // Release the appModule
        Configuration.releaseRootApplicationModule(am, false);
    } 3 . Jsp Tag
    <af:image source="/render_images" shortDesc="Item"/>  Thanks.
    zakir
    ====
    Edited by: Zakir Hossain on Apr 23, 2009 11:19 AM

    Hi here is solution,
    later I will put a project for this solution, right now I am really busy with ADF implementation.
    core changes is to solve my problem:
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        }All code as below:
    Servlet Code*
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException,
                                                             IOException {
        String appModuleName =
          "his.model.ModuleAssetMgt";
        String appModuleConfig =
          "TempModuleAssetMgt";
      String imgno = request.getParameter("imgno");
        if (imgno == null || imgno.equals(""))
          return;
        String voQuery =
          "select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = '" + imgno + "'";
        String mimeType = "gif";
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName,
                                                    appModuleConfig);
        am.clearVOCaches("TempView2", true);
        ViewObject vo = null;
        String s;
          vo = am.createViewObjectFromQueryStmt("TempView2", voQuery);
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        Row product = vo.first();
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null) {
          // We assume the Blob to be the first a field
          image = (BlobDomain)product.getAttribute(0);
          // Check if there are more fields returned. If so, the second one
          // is considered to hold the mime type
          if (product.getAttributeCount() > 1) {
            mimeType = (String)product.getAttribute(1);
        } else {
          LOG.warn("No row found to get image from !!!");
          return;
        // Set the content-type. Only images are taken into account
        response.setContentType("image/" + mimeType);
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        is.close();
        os.close();
        // Release the appModule
    Configuration.releaseRootApplicationModule(am, true);
    }Jsp Tag
    <h:graphicImage url="/render_images?imgno=#{bindings.ImageNo.inputValue}"
                                                        height="168" width="224"/>

  • Page not displayed on server but works fine locally in Jdeveloper

    Hi,
    The page works fine locally when run from Jdeveloper.
    But when the page is imported to server and when the page is called....it trys to load the page for long time and times out and displays the IE error 'The Page cannot be displayed'.
    Do I have to do anything specific in server after importing a page?

    In the CO of the table region:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ApplicationModuleImpl am1 = (ApplicationModuleImpl) pageContext.getRootApplicationModule();
    SalesOrderHeaders2VOImpl VO1 = (SalesOrderHeaders2VOImpl) am1.findViewObject("SalesOrderHeaders2VO");
    String HeaderId = (VO1.first().getAttribute("HeaderId")).toString();
    if (HeaderId != null)
    Serializable[] params = {HeaderId};
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransactionImpl DBTrans = (OADBTransactionImpl)am.getOADBTransaction();
    boolean log = DBTrans.loggingEnabled() ;
    // Write Diagnostic message...
    if(pageContext.isLoggingEnabled(1))
    pageContext.writeDiagnostics(this," am : "+am ,1);
    if(am != null)
    OAViewObject viewObject = (OAViewObject)am.findViewObject("InterfaceSummVO");
    if(viewObject != null)
    viewObject.setWhereClauseParams(null);
    viewObject.setWhereClause("header_id = :1");
    viewObject.setWhereClauseParam(0, HeaderId );
    viewObject.executeQuery();
    }

  • Passivate issue while applying viewCriteria on runtime

    Hello,
    (ADF BC on jDev 11.1.2.2.0)
    Hoping someone can shed some light on this. (the issue is not how to do this, but why doing it like this is not working)
    Here goes :
    Supose, you need to list all employees from departmant 60 (considering HR schema) while at the same time, i need to know wich one of them has a sallary > some_value.
    (Again, i'm sure there are lots of ways to do this, but the issue is not how to do it, but why doing it like this raises some passivation issues.)
    So, i created the Department and Employee viewObjects (linked together). And created a viewCriteria for salary > vc_salary inside EmplyeeView.
    Now on the view, consider the approach: I created the following, simple, action method:
        public void apply1VC(ActionEvent actionEvent) {
           // will set the current row of departments so i the depat 60 employees.
            ADFUtils.findIterator("DepartmentsViewIterator").setCurrentRowWithKeyValue("60");
            // for some reason, i need to know how many employess there are with a salary > 5000, belonging top department 60.
            // So, ill apply a view criteria, do my business logic, and then remove it:
            //apply vc
            ViewObject viewObject = ADFUtils.findIterator("EmployeesViewIterator").getViewObject();
            ViewCriteriaManager vcm = viewObject.getViewCriteriaManager();
            ViewCriteria vc = vcm.getViewCriteria("bySalary");
            VariableValueManager vm = vc.ensureVariableManager();
            vm.setVariableValue("vc_salary", new BigDecimal(5000));
            viewObject.applyViewCriteria(vc);
            //execute query
            viewObject.executeQuery();
            //do the business logic here to the employees with salary > 5000
            //remove the viewcriteria
            vcm.removeApplyViewCriteriaName("bySalary");
            // force executeQuery on my terms to list all employees of dept 50
            viewObject.executeQuery();
        }This executes perfectly and does its job as expected. But! If after this method is executed, a passivate/activate occurs,the application will blow up on the next activation (easely checked with AM pooling turned off):
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    +
    <MethodExpressionActionListener> <processAction> oracle.jbo.SQLStmtException: JBO-27122: Erro de SQL durante a preparação da instrução. Instrução: SELECT Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.EMAIL, Employees.PHONE_NUMBER, Employees.HIRE_DATE, Employees.JOB_ID, Employees.SALARY, Employees.COMMISSION_PCT, Employees.MANAGER_ID, Employees.DEPARTMENT_ID FROM EMPLOYEES Employees WHERE ( ( (Employees.SALARY > :vc_salary ) ) ) AND Employees.DEPARTMENT_ID = :Bind_DepartmentId
    Like as if the view object is beeing passivate with the viewCriteria still applied and while activating trys to insert a parameter that already does not exist.
    Am i missing something? Is there any reason for this implementation to raise such a problem?
    If any of you kind souls is interested enough, here is the application i did to reproduce this issue. (you just have to do 3 clicks and the only code inside is the one on the post):
    https://dl.dropbox.com/u/198190/PassivateIssue.zip
    Thank you!
    Tiago Braz
    Edited by: Tiago Braz on 5/Dez/2012 11:09

    Hi,
    Even replacing the vcm.removeApplyViewCriteriaName("bySalary"); for the viewObject.applyViewCriteria(null); as referenced on "42.4.2 Removing All Applied Named View Criteria", i get the same behavior.
    This is how de bind parameter is defined:
      <Variable
        Name="vc_salary"
        Kind="viewcriteria"
        Type="java.math.BigDecimal"/>If the bind variables are not persisted for passivation, what happens after activation of a VO with a viewcriteria having a value from a binding parameter? Or if i use the executeQuery immediatly after that activation? Do i have to override the passivation method to assure it stores that value?
    Anyways, i believe that on particular case thats not the issue. I believe the EmployeeView viewObject should not have the "WHERE ( ( (Employees.SALARY > :vc_salary ) )" on activation since i made sure to remove it before the passivation with the "viewObject.applyViewCriteria(null) and for that reason im not expecting to read that variable. But the framework, for some reason expects it to be there.
    Edited by: Tiago Braz on 6/Dez/2012 2:56

  • Dynamic tab not showing data

    JDev 11.1.1.4, JHS 11.1.1.3
    I have a table with a groupLink field that opens another group in a dynamic tab. When I put in some debug output I can see that the underlying view for the new dynamic tab is querying up the correct data, but when the tab opens up it says "No rows found". I have a couple of other groupLinks on other pages, one of which works, one of which gives the same result as this one. They are all setup according to the directions in the JHS developer's guide. Any insight anyone has would be appreciated.
    Here's the output from the JDev console (lines beginning with "Debug" are my output inserted into executeQuery method):
    <BreadcrumbManager> <processBreadcrumbs> Executing processBreadcrumbs for null
    <BreadcrumbManager> <loadBreadcrumbConfig> loadBreadcrumbConfig: pagePath is null
    <SetCurrentRowBean> <execute> Calling queryByKeyValue on app module with voUsage MyView1 and rowKeyValue 1028
    <JhsApplicationModuleImpl> <queryByKeyValueInternal> executing queryByKeyValueInternal(value=1028) for MyView1
    <JhsApplicationModuleImpl> <queryByKeyValueInternal> executing queryByKeyValueInternal(key=Id, value=1028) for MyView1
    Debug - execute query
    Debug - [SQL Statement]
    Debug - 1 rows found
    Debug - id of found row = 1028
    <JhsPageLifecycle> <validateRegion> Executing validateRegion for region com_pq_tracs_view_pageDefs_AccountsPageDef_WEB_INF_adfc_config_Accounts_xml_AccountsTaskFlow
    <JhsPageLifecycle> <refreshRegion> Executing refreshRegion for region com_pq_tracs_view_pageDefs_AccountsPageDef_WEB_INF_adfc_config_Accounts_xml_AccountsTaskFlow current page fragment: /AccountsTaskFlow/Accounts
    <JhsApplicationModuleImpl> <applyBindParams> Executing applyBindParams for Lookup1
    <JhsApplicationModuleImpl> <applyBindParams> ViewObject Lookup1: bind parameter values have not changed, NO Requery performed
    <JhsApplicationModuleImpl> <applyBindParams> Executing applyBindParams for Lookup2
    <JhsApplicationModuleImpl> <applyBindParams> ViewObject Lookup2: bind parameter values have not changed, NO Requery performed
    <JhsApplicationModuleImpl> <applyBindParams> Executing applyBindParams for Lookup3
    <JhsApplicationModuleImpl> <applyBindParams> No query Bind parameters passed into applyBindParams for Lookup3, do nothing
    <JhsApplicationModuleImpl> <applyBindParams> Executing applyBindParams for Lookup4
    <JhsApplicationModuleImpl> <applyBindParams> ViewObject Lookup4: bind parameter values have not changed, NO Requery performed
    <BreadcrumbManager> <processBreadcrumbs> Executing processBreadcrumbs for /AccountsTaskFlow/Accounts
    <BreadcrumbStack> <add> Adding breadcrumb to stack: "null" (/AccountsTaskFlow/Accounts)
    <BreadcrumbManager> <processBreadcrumbs> Executing processBreadcrumbs for /UIShell

    Steve,
    I think you are hitting an issue we solved in the upcoming release.
    Can you try replacing the GROUP_HAS_ROW and PARENT_GROUP_HAS_ROW macros in common.vm with the code below?
    #macro (GROUP_HAS_ROW)
    ## we need to get current row through viewObject instead of directly from iter binding
    ## otherwise a full-table query will still be performed when auto query switched off!
    ## but we only do this when auto-query switched off, otherwise in form alyout, the
    ## switcher element shows "no rows"!
    #if ($JHS.current.group.databound) #if ($JHS.current.group.autoQuery)#ITERATOR().currentRow!=null #else(#ITERATOR().viewObject!=null and #ITERATOR().viewObject.currentRow!=null)#end#else(true)#end#end
    #macro (PARENT_GROUP_HAS_ROW)
    #if ($JHS.current.group.databound && $JHS.page.group!=$JHS.current.group)#if (${JHS.current.group.parentGroup} && ${JHS.current.group.parentGroup.databound})#if ($JHS.current.group.parentGroup.autoQuery) #PARENT_ITERATOR().currentRow!=null #else (#PARENT_ITERATOR().viewObject!=null and #PARENT_ITERATOR().viewObject.currentRow!=null)#end#else true#end#else(true)#end#end
    Steven Davelaar,
    Jheadstart team.

  • Infinite calls to rowUpdated()

    Hi,
    I have created a table binding using a view object (say VO). There is a listener on that view object(VO) and in rowUpdated( ) method I called the executeQuery() of the view object(VO).
    After I update any value in the table and press enter, it goes into infinite loop.
    Following is the sample java client file --
    package pro;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import oracle.jbo.*;
    import oracle.jbo.client.*;
    import oracle.jbo.uicli.binding.*;
    import oracle.jbo.uicli.jui.*;
    public class Client extends JFrame
            private BorderLayout _mainLayout = new BorderLayout();
            private JPanel _panelCenter = new JPanel();
            private JUPanelBinding _panelBinding;
            private static String V_EMP = "VEmp";
            private ViewObject _vEmp = null;
            private JTable _table = new JTable();
            private String[] EMP_ATTRIBUTES = {"Empno", "Ename", "Job"};
            public Client()
                    try
                            jbInit();
                    } catch (Exception e)
                            e.printStackTrace();
            private void jbInit() throws Exception
                    this.setSize(350, 210);
                    this.setBounds( new Rectangle(100, 80, 400, 250));
                    this.setTitle( "Frame Title" );
                    ApplicationModule appModule =
                    Configuration.createRootApplicationModule(
                    "pro.AM12414", "AM12414Local");
                    JUApplication app = new JUApplication(appModule);
                    _panelBinding = new JUPanelBinding(app.getName(), null);
                    _panelBinding.setApplication(app);
                    _panelCenter.setLayout(_mainLayout);
                    customJbInit();
                    this.getContentPane().add("Center",_panelCenter);
                    _panelBinding.executeIfNeeded();
            private void customJbInit()
                    _vEmp = _panelBinding.getDataControl().getApplicationModule().findViewObject(V_EMP);
                    _table.setModel(JUTableBinding.createAttributeListBinding(_panelBinding, _table, V_EMP, null, V_EMP + "IterBinding", EMP_ATTRIBUTES));
                    JUIteratorBinding bankMutationIterBinding = _panelBinding.getRowIterBinding(V_EMP, null,V_EMP+"IterBinding");
                    bankMutationIterBinding.getRowSetIterator().addListener(new EmpRowSetListener());
                    _panelCenter.add(_table);
            public static void main(String[] args)
                    Client frame = new Client();
                    frame.addWindowListener(
                            new WindowAdapter()
                                    public void windowClosing(WindowEvent evnt)
                                            System.exit(0);
                    frame.setSize(new Dimension(400, 280));
                    frame.pack();
                    frame.setVisible(true);
            private class EmpRowSetListener implements RowSetListener {
                    public void navigated(NavigationEvent e) {}
                    public void rowInserted(InsertEvent e) {}
                    public void rowDeleted(DeleteEvent e) {}
                    public void rowUpdated(UpdateEvent e) {
                            _vEmp.executeQuery();
                    public void rangeRefreshed(RangeRefreshEvent e) {}
                    public void rangeScrolled(ScrollEvent e){}
    }I think after calling the executeQuery() method of a view object, it should not invoke rowUpdated( ) method as the row does not get updated just by calling the executeQuery().
    Can anyone please verify this?
    Thanks.

    Hi Frank,
    This was just a prototype for reproducing the issue :)
    The actual reason behind invoking the executeQuery() is --
    We are updating the database table (which is underlying the VO) through database procedures in the rowUpdated() and to reflect those changes back again in the view object (VO) we need to call executeQuery().
    You can consider the rowUpdated() method as follows:
    public void rowUpdated(UpdateEvent e)
      // Call the database procedure
      dbProc.updateTable(); 
      _vEmp.executeQuery();
    }Thanks.

  • False sequence of ViewLinks "firing"

    Hi!
    We're still stuck with 9.03 Preview. But I hope it's more like a general question.
    The structure of one of our AppModules looks very much like this:
    AppModule
       |
       |- WorklistView
              |
              |- WorklistProxyView (via ViewLink)
                       |
                       |- ContextView (via ViewLink)
                       |
                       |- ImageView (via ViewLink)
                       |
                       |- RecipientsView (via ViewLink)
                       |
                       |- DemoView (via ViewLink)That's basically it.
    The proxy was introduced so that during normal operation, the WorklistView has control over the other ViewObjects, and so that during a demo, a different ViewObject can take control. We do that by deleting the old ViewLink and creating a new one. This works fine.
    The problem is this:
    When I perform a search on the WorklistView, then (judging from the debug output) the sequence of "updates" is like this:
    1. WorklistView
    2. ContextView
    3. ImageView
    4. RecipientsView
    5. DemoView
    6. WorklistProxyView
    7. ContextView
    8. ImageView
    9. RecipientsView
    10. DemoView
    I would have expected:
    1. WorklistView
    2. WorklistProxyView
    3. ContextView
    4. ImageView
    5. RecipientsView
    6. DemoView
    The problem is that some ViewObjects are executed more than once which basically wrecks other functions that are using TableModelListeners to determine any changes. It seems that some ViewObjects do not wait for the proxy to update. When the proxy finally updates, all depending ViewObjects do an update again.
    What could be the cause for such a behaviour?
    That's how I perform the search:
    public void performSearch()
      if (!systemDescription.isSearchableTable())
       return;
      System.out.println( "Searching" );
      ViewCriteria viewCriteria = viewObject.createViewCriteria();
      searchTable.fillViewCriteria( viewCriteria );
      if (viewCriteria.isEmpty())
        viewCriteria = null;
      if (viewObject != null)
        viewObject.applyViewCriteria( viewCriteria );
        viewObject.executeQuery();
        viewObject.setCurrentRowAtRangeIndex( 0 );
        panelBinding.executeIfNeeded();
    }Where's the mistake?
    Thanks in advance!
    Sascha Herrmann
    GE Medical Systems

    Thanks for your help, but our performSearch() does (almost) nothing else than executing the top-level VO. The JUPanelBinding is never set to find mode, since there's no user input. We create the ViewCriteriaRows programmatically.
    The structure of our ViewObjects and ViewLinks is described above.
    We use a single JUPanelBinding right now.
    WorklistView: 4 JTables bound using JClient JUTableBindings + 2 JUActionBindings (for next/prev buttons).
    ProxyView: 1 dummy JTextField bound using JUTextFieldBinding. This text field is never displayed. We just use it to "pin" the VO to the JUPanelBinding.
    ContextView: some JULabelBindings.
    ImageView: a JUTreeBinding.
    The remaining VOs: one JTable each, using JUTableBindings.
    Let me add the debug log created during a search. I removed some EntityCache warnings.
    2002-11-26 13:21:13,486 [AWT-EventQueue-0] DEBUG - ENTERING SearchableTablePanel.performSearch
    <3>[771] (7781) QueryCollection.createColumnList(1431) Column count: 39
    <3>[772] (0) ViewObjectImpl.closeStatements(6545) ViewObject close prepared statements...
    <3>[773] (0) ViewObjectImpl.getPreparedStatement(6450) ViewObject : Created new QUERY statement
    <3>[774] (15) ViewObjectImpl.buildQuery(1468) SELECT PerformedProcedure.PERFORMED_PROCEDURE_ID, .....       
    WorklistView: executeQueryForCollection
    <3>[775] (1172) EntityCache.add(220) EntityCache:add WARNING - ignoring row with no primary key
    ..... (several more, still unknown where they come from)
    <3>[938] (0) EntityCache.add(220) EntityCache:add WARNING - ignoring row with no primary key
    WorklistView: first!
    ProxyView: executeQueryForCollection
    ProxyView: first!
    RecipientsView: executeQueryForCollection
    RecipientsView: first!
    ImageView: executeQueryForCollection
    ImageView: first!
    DemoView: executeQueryForCollection
    DemoView: first!
    ContextView: executeQueryForCollection
    ContextView: first!
    <3>[939] (31) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[940] (0) QueryCollection.createColumnList(1431) Column count: 20
    <3>[941] (15) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[942] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 65662
    RecipientsView: executeQueryForCollection
    RecipientsView: first!
    <3>[945] (0) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[946] (16) QueryCollection.createColumnList(1431) Column count: 11
    <3>[947] (15) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[948] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 65662
    ImageView: executeQueryForCollection
    ImageView: first!
    <3>[949] (16) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[950] (0) QueryCollection.createColumnList(1431) Column count: 26
    <3>[951] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[952] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 144523
    DemoView: executeQueryForCollection
    DemoView: first!
    <3>[955] (0) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[956] (0) QueryCollection.createColumnList(1431) Column count: 21
    <3>[957] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[958] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 144523
    ContextView: executeQueryForCollection
    ContextView: first!
    <3>[959] (16) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[960] (0) QueryCollection.createColumnList(1431) Column count: 6
    <3>[961] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[962] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 144523
    ProxyView: executeQueryForCollection
    ProxyView: first!
    RecipientsView: executeQueryForCollection
    RecipientsView: first!
    ImageView: executeQueryForCollection
    ImageView: first!
    DemoView: executeQueryForCollection
    DemoView: first!
    ContextView: executeQueryForCollection
    ContextView: first!
    <3>[963] (15) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[964] (0) QueryCollection.createColumnList(1431) Column count: 20
    <3>[965] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[966] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 65662
    RecipientsView: executeQueryForCollection
    RecipientsView: first!
    <3>[969] (16) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[970] (0) QueryCollection.createColumnList(1431) Column count: 11
    <3>[971] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[972] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 65662
    ImageView: executeQueryForCollection
    ImageView: first!
    <3>[973] (15) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[974] (16) QueryCollection.createColumnList(1431) Column count: 26
    <3>[975] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[976] (0) ViewRowSetImpl.bindParameters(1306) Binding param 1: 144523
    DemoView: executeQueryForCollection
    DemoView: first!
    <3>[979] (0) ViewObjectImpl.clearQueryCollectionCache(3623) Clear QueryCollection in cache...
    <3>[980] (0) QueryCollection.createColumnList(1431) Column count: 21
    <3>[981] (0) ViewObjectImpl.getPreparedStatement(6436) ViewObject : Reusing defined prepared Statement
    <3>[982] (781) ViewRowSetImpl.bindParameters(1306) Binding param 1: 144523
    ContextView: executeQueryForCollection
    ContextView: first!
    2002-11-26 13:21:16,111 [AWT-EventQueue-0] DEBUG - LEAVING SearchableTablePanel.performSearchSo that's it.
    I hope that helps. We also made the following observation:
    When the user conducts the search immediately after another search (with the first row in WorklistView selected), then the error occurs.
    If the user conducts a search, navigates to a row (other than the first!) in WorklistView (our top-level VO) and then presses our search button, then the problem is gone.
    If the user conducts a search, navigates to a row (other than the first!) in WorklistView, navigates back to the first row and then conducts the search, then the problem is back.
    The only obvious difference I can see is: when it works, there are
    "JUTableBinding$JUTableModel.updateNavigated(686) Navigating to 0"
    messages in the debug log after WorklistView.first(). These do not appear, when it doesn't work.
    Strange, isn't it? What's so special with the first row?
    Sascha Herrmann

  • Query on VO's parameter

    Hi everyone,
    I've created a VO similar to script below. Problem is I just can't execute the query.
    SELECT xx.full_name
          ,xx.employee_number
          ,xx.person_id
    From xx
    START WITH xx.person_id       = :1
    CONNECT BY PRIOR xx.person_id = xx.supervisor_idAn oaexception occured saying not all variables bound when I try to use it as LOV.
    Thanks for any assistance,
    Elmer

    Hi Elmer,
    I don't find any error in it. However i tried to do the same on my system and I am able to execute the query and getting no error at all.
    Here is what I did in process request of the controller by creating VO at runtime and setting its whereclause dynamically.
    ViewObject viewobject = pageContext.getApplicationModule(webBean).findViewObject("ObtainScoDetails");
    if(viewobject == null)
    String s14 = " SELECT papf.full_name, papf.employee_number, papf.person_id From per_all_people_f papf START WITH papf.person_id =:1 CONNECT BY PRIOR papf.employee_number = papf.person_id";
    viewobject = am.createViewObjectFromQueryStmt("ObtainScoDetails", s14);
    String person_id ="21";
    viewobject.setWhereClauseParams(null);
    viewobject.setWhereClauseParam(0, person_id);
    pageContext.writeDiagnostics("Anil", "Above Query Executed of New VO", 1);
    viewobject.executeQuery();
    viewobject.reset();
    viewobject.next();
    pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getQuery(), 1);
    pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getCurrentRow().getAttribute(0), 1);
    pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getCurrentRow().getAttribute(1), 1);
    pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getCurrentRow().getAttribute(2), 1);
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • BC4J smarter way to:   select sysdate from dual  ????

    Our architecture uses the DB server's date/time as the application's single
    place to get date / time. So our UI's / business logic needs sysdate in several
    places through screen flow and VO/Entities called by the business logic.
    I'll create a SQLView at design time to package calling select sysdate from dual.
    We're currently using Dynamic unnamed Views which are more expensive than just
    getting sysdate deserves and also are a memory leak if you don't
    call vo.remove() after you're done with the result set.
    But is there a simplier or smarter way to get sysdate from the DB than the more
    heavy weight than seems necessary step of instantiating a VO and creating a
    result set to get the String sysdate???
    Thanks,
    curt

    I cache viewObjects in the MT using some ViewObjectManager and had no
    problems till now (more then 6 months of production). Any AM that
    serve dynamic requests should have own ViewObjectManager-object.
    import oracle.jbo.*;
    import java.util.Hashtable;
    import java.util.Enumeration;
    public class ViewObjectManager {
    private ApplicationModule _appMod;
    private Hashtable _viewObjectNames;
    public ViewObjectManager(ApplicationModule am) {
    _appMod = am;
    _viewObjectNames = new Hashtable();
    public ViewObject getViewObject( String selectClause_,
    String fromClause_,
    String whereClause_ ) {
    ViewObject vo_ = null;
    String sqlStmt_ = _getSQLStmtFromClauses
    ( selectClause_, fromClause_, whereClause_ );
    String key_ = sqlStmt_;
    String voName_ = (String)_viewObjectNames.get(key_);
    boolean isNew_ = ( voName_ == null );
    if ( !isNew_ ) {
    vo_ = appMod.findViewObject(voName);
    if ( vo_ == null ) {
    viewObjectNames.remove(key);
    isNew_ = true;
    if ( isNew_ ) {
    vo_ = appMod.createViewObjectFromQueryStmt( null, sqlStmt );
    viewObjectNames.put( key, vo_.getName() );
    return vo_;
    private String getSQLStmtFromClauses( String selectClause,
    String fromClause_,
    String whereClause_ ) {
    return
    "SELECT "+selectClause_
    +" FROM "+fromClause_
    +( whereClause_ == null || whereClause_.equals("")
    ? "" : " WHERE "+whereClause_ ) ;
    Client method in this case looks like that:
    public static synchronized BigDecimal getNewId
    ( RequestOnNewId request__,
    QueryableApplicationModule am__ ) {
    String viewObjectName_ = request__.viewObjectName,
    sequenceName_ = request__.sequenceName,
    fromClause_ = request__.fromClause;
    BigDecimal new_id_ = null;
    ViewObject vo_;
    Row row_;
    Object obj_;
    vo_ = am__.getViewObjectManager()
    .getViewObject( sequenceName_+".NEXTVAL AS \"NEWID\"",
    "DUAL",
    null );
    vo_.executeQuery();
    row_ = vo_.first();
    obj_ = row_.getAttribute("NEWID");
    new_id_ = (obj_ == null) ? null : ((Number)obj_).bigDecimalValue();
    return new_id_;
    Hope this helps.
    Arkadi Ganov
    [email protected]

Maybe you are looking for