Friday, October 29, 2021

JDeveloper 12c | IntegratedWebLogicServer | Error while building the default domain

I'm trying to run IntegratedWebLogicServer using JDeveloper Version 12.2.1.4.0, and I have the following message:


BuildDefaultDomain1.py      

cmd.exe /c ""C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin\wlst.cmd" "C:\Users\nauana.nonato\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py""
Cannot run program "cmd.exe" (in directory "C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin"): Malformed argument has embedded quote: "C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin\wlst.cmd" "C:\Users\nauana.nonato\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py"
java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin"): Malformed argument has embedded quote: "C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin\wlst.cmd" "C:\Users\nauana.nonato\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py"
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at oracle.jdevimpl.adrs.weblogic.wlst.ScriptRunnerImpl.runScript(ScriptRunnerImpl.java:106)
    at oracle.jdevimpl.adrs.weblogic.builder.DomainScriptRunnerImpl.runScript(DomainScriptRunnerImpl.java:146)
    at oracle.jdevimpl.adrs.weblogic.builder.DefaultDomainBuilder.createDomain(DefaultDomainBuilder.java:606)
    at oracle.jdevimpl.adrs.weblogic.builder.DefaultDomainBuilder.build(DefaultDomainBuilder.java:274)
    at oracle.jdevimpl.adrs.weblogic.builder.DefaultDomainBuilder$1.run(DefaultDomainBuilder.java:225)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Caused by: java.lang.IllegalArgumentException: Malformed argument has embedded quote: "C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin\wlst.cmd" "C:\Users\nauana.nonato\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py"
    at java.lang.ProcessImpl.needsEscaping(ProcessImpl.java:279)
    at java.lang.ProcessImpl.createCommandLine(ProcessImpl.java:202)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:436)
    at java.lang.ProcessImpl.start(ProcessImpl.java:140)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) 

    Solution:

Follow the following steps to fix this issues in 12.2.1.4

  1. Go to Oracle_Home\jdeveloper\ide\bin folder.
  2. Edit ide.conf file.
  3. Under # Other OSGi configuration options for locating bundles and boot delegation section (or any other section) add the following line
AddVMOption  -Djdk.lang.Process.allowAmbiguousCommands=true
  1. Restart JDeveloper.


Monday, January 15, 2018

BPM MDS Connection Error -BPM-80112: Generic Security Error. Cause: Invalid Token Error in Verification Service. - ORABPEL-30503

Hello ,


I faced the following issue while creating the MDS connection in Jdeveloper 11.1.1.7

Test Failed: BPM-80112: Generic Security Error. Cause: Invalid Token Error in Verification Service.
Invalid Token Error in Verification Service. Received invalid token in null.
Verify that correct token is passed.


ORABPEL-30503 : Invalid Token Error in Verification Service. Invalid Token Error in Verification Service. Received invalid token in getTokenType. Verify that correct token is passed
























Solution:

Copy the bpm-services.jar from the server Replace the bpm-services.jar on the client application with the one from the server Ensure that after any patches are applied that the jars on the server are replaced in the client application. This also applies to using jars within JDeveloper which can become out of sync due to patches not being applied on both dev and server machines. You may need to replace the bpm-services.jar located here JDeveloper/soa/modules/oracle.soa.workflow_11.1.1/bpm-services.jar with the one located here [soa_install_dir]/soa/modules/oracle.soa.workflow_11.1.1/bpm-services.jar.

Good Luck

Wednesday, March 18, 2015

ADF: Show / Hide Train ignored node programatically

Brief 

To create a train model for bounded task flows in ADF with train model option, set its Train property in the Behavior section of the Property Inspector to true. 
shows in the task flow visual diagrammer as shown below.
Now we have an ADF train with three node view1, view2 and view3.jsff
 By setting the TrainStop  "ignore" property of a view3 activity to true, or any expression evaluate to true in real practice the node will not be rendered.


Requirement

Actually the expression in ignore property will evaluate once by render train node and even if expression evaluates to false in any node step the ignored node render state will not changes  ,Now its required to show the ignored node "view3" without reenter the train

Environment

JDeveloper/ADF 11.1.1.7

Solution

Create two buttons for the show / hide functionality. Which viewable property depend on a variable in pageFlowScope


 import java.util.HashMap;  
 import java.util.Iterator;  
 import oracle.adf.controller.ControllerContext;  
 import oracle.adf.controller.TaskFlowContext;  
 import oracle.adf.controller.TaskFlowId;  
 import oracle.adf.controller.ViewPortContext;  
 import oracle.adf.controller.metadata.ActivityId;  
 import oracle.adf.controller.metadata.MetadataService;  
 import oracle.adf.controller.metadata.model.Activity;  
 import oracle.adf.controller.metadata.model.TaskFlowDefinition;  
 import oracle.adf.controller.metadata.model.TrainStop;  
 import oracle.adf.controller.metadata.model.TrainStopContainer;  
 import oracle.adfinternal.controller.train.TrainModel;  
 import oracle.adfinternal.controller.train.TrainStopModel;  
 import oracle.adfinternal.controller.train.TrainUtils;  
 public class View2Bean {  
   public View2Bean() {  
   }  
   public String showView3Node() {  
     // Add event code here...  
     TrainModel trainModel = TrainUtils.findCurrentTrainModel();  
     ActivityId nodeActivityId = null;  
     ActivityId activityId;  
     Activity act;  
     for (Iterator it =  
        getTaskFlowDefinition(getTaskFlowId()).getActivities().values().iterator();  
        it.hasNext(); ) {  
       act = (Activity)it.next();  
       activityId = act.getId();  
       if (act.getIdAttribute().equals("view3")) {  
         System.out.println("Node");  
         System.out.println(act.getId());  
         nodeActivityId = activityId;  
       }  
     }  
     MetadataService metadataService = MetadataService.getInstance();  
     //Get activity and its train stop definition  
     Activity activity =  
       metadataService.getActivity((ActivityId)nodeActivityId);  
     TrainStopContainer stopContainer =  
       (TrainStopContainer)activity.getMetadataObject();  
     TrainStop ts = stopContainer.getTrainStop();  
     trainModel.getTrainStops().put((ActivityId)nodeActivityId,  
                     new TrainStopModel(ts,  
                              (ActivityId)nodeActivityId));  
     return null;  
   }  
   public String hideView3Node() {  
     // Add event code here...  
     TrainModel trainModel = TrainUtils.findCurrentTrainModel();  
     ActivityId nodeActivityId = null;  
     ActivityId activityId;  
     Activity act;  
     for (Iterator it =  
        getTaskFlowDefinition(getTaskFlowId()).getActivities().values().iterator();  
        it.hasNext(); ) {  
       act = (Activity)it.next();  
       activityId = act.getId();  
       if (act.getIdAttribute().equals("view3")) {  
         System.out.println("Node");  
         System.out.println(act.getId());  
         nodeActivityId = activityId;  
       }  
     }  
     MetadataService metadataService = MetadataService.getInstance();  
     //Get activity and its train stop definition  
     Activity activity =  
       metadataService.getActivity((ActivityId)nodeActivityId);  
     TrainStopContainer stopContainer =  
       (TrainStopContainer)activity.getMetadataObject();  
     TrainStop ts = stopContainer.getTrainStop();  
     trainModel.getTrainStops().remove((ActivityId)nodeActivityId);  
     return null;  
   }  
   public TaskFlowId getTaskFlowId() {  
     ControllerContext controllerContext = ControllerContext.getInstance();  
     ViewPortContext currentViewPort =  
       controllerContext.getCurrentViewPort();  
     TaskFlowContext taskFlowContext = currentViewPort.getTaskFlowContext();  
     TaskFlowId taskFlowId = taskFlowContext.getTaskFlowId();  
     return taskFlowId;  
   }  
   public TaskFlowDefinition getTaskFlowDefinition(TaskFlowId taskFlowId) {  
     assert taskFlowId != null;  
     MetadataService metadataService = MetadataService.getInstance();  
     TaskFlowDefinition taskFlowDefinition =  
       metadataService.getTaskFlowDefinition(taskFlowId);  
     return taskFlowDefinition;  
   }  
 }  

 the sample application can be downloaded from here

Friday, December 20, 2013

ADF - Calculate accumulative value of a Column in a Table

In this post I tried to show how to calculate the accumulative value of salary column in Employee table of oracle HR schema for example, where you can use it in specific scenario
As shown in the images below, Having  AccumulativeSalary transient attribute which it's value represent the sum of salaries of above rows.
1. add transient attribute and generate Employee ViewObjectImpl and ViewObjectRowImp
2.write the following code of get method of AccumulativeSalary transient attribute as the following:-
    /**
     * Gets the attribute value for the calculated attribute AccumulativeSalary.
     * @return the AccumulativeSalary
     */
    public Number getAccumulativeSalary() {
        if (getAttributeInternal(ACCUMULATIVESALARY) == null) {
            EmployeesViewImpl empVo = (EmployeesViewImpl)getViewObject();
//create separate RowSetIterator  of employee viewObject where you can iterate
            RowSetIterator rsi = empVo.createRowSetIterator(null);
            Number temp = getSalary();
            while (rsi.hasNext()) {
                EmployeesViewRowImpl r = (EmployeesViewRowImpl)rsi.next();
                if (r == this) {
                    setAttributeInternal(ACCUMULATIVESALARY, temp);
                    break;
                } else {
                    temp = temp.add(r.getSalary());                        
                }
            }            
            return temp;  
        }
        return (Number)getAttributeInternal(ACCUMULATIVESALARY);
    }
The JDeveloper 11.1.1.7.0 workspace of the sample application can be downloaded from here

Sunday, November 3, 2013

ADF Tree based on self join case, 3 functionality.(drag & drop, delete & move children, delete & delete multiple level children)

In this post I tried to show 3 operation for ADF tree using simple solution.   the drag and drop , delete node and move it's children to up level and delete node and delete multiple level children. 
the drag and drop
As shown in the images below, Having a two level tree. Expanding a node will make all detail nodes appear. drag  node from one level and drop him to another.


In the Model project we just need the  view objects  should be updatable connected with a viewLink based on common attribute ParentId. In the view object we need a bind variable which we also add to the query so that we can execute-with-params.



About delete and node and move it's children node to level up 
through application module method I get select node and update its children parent value by the value of selected root node parent value then delete value
About  delete node and delete multiple level children
  I used the power of sql to get all children for selected root node though customize the query of another updatable view object get multi level children, In the view object we need a bind variable which we also add to the query so that we can execute-with-params
And through application module method I get selected node and delete its multi level children then delete root node


The JDeveloper 11.1.1.7.0 workspace of the sample application and script file for this post can be downloaded from here

Thursday, October 31, 2013

Reorder rows in an ADF table

Reorder rows in an ADF table. As shown in the images below, applying the code in this post will allow you to re-arrange rows within a table using "up and down" buttons Its simply and change rank attribute value of swiped rows and change in the indexing of the iterator. 


Selecting a row and move it to a step up or down ,then will  show it in its new position within the table
and you may commit later


Note that reordering the rows in the table will only have an effect to the DCIteratorBinding (more precise, its an effect to the RowSetIterator it decorates) in the Pagedef file. 

Managed Bean

    /**  The selected row takes the position of the previous row.
     *   synchronize the underlying ADF model I needed to accept a
     *   "flicker" of the table after the action *
     *   @param actionEvent Event passed in from ADF Faces at the end of the action
     *  */

    public void upButton(ActionEvent actionEvent) {
        // Add event code here...
        Row currentRow;
        Row previousRow;
        currentRow =
                ADFUtils.findIterator("TreeTableView1Iterator").getCurrentRow();

        Number tRank = new Number();
        try {
            tRank = (Number)currentRow.getAttribute("Rank");
        } catch (Exception e) {
        }

        if (ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().hasPrevious()) {
            previousRow =
                    ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().previous();

            currentRow.setAttribute("Rank", previousRow.getAttribute("Rank"));
            previousRow.setAttribute("Rank", tRank);
            int indexOfPreviousRow =                ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().getRangeIndexOf(previousRow);
            //remove selected row from collection so it can be added back
            currentRow.removeAndRetain();
            ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().insertRowAtRangeIndex(indexOfPreviousRow,currentRow);
            //make row current in ADF iterator.
            ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().setCurrentRowAtRangeIndex(indexOfPreviousRow);

        }
    }

    /**  The selected row takes the position of the next row.
     *   synchronize the underlying ADF model I needed to accept a
     *   "flicker" of the table after the action *
     *   @param actionEvent Event passed in from ADF Faces at the end of the action
     *  */

    public void downButton(ActionEvent actionEvent) {
        Row currentRow;
        Row nextRow;
        currentRow =
                ADFUtils.findIterator("TreeTableView1Iterator").getCurrentRow();
        System.out.println(currentRow.getAttribute("Rank"));
        Number tRank = new Number();
        try {
            tRank = (Number)currentRow.getAttribute("Rank");
        } catch (Exception e) {
        }

        if (ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().hasNext()) {
            nextRow =
                    ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().next();

            currentRow.setAttribute("Rank", nextRow.getAttribute("Rank"));
            nextRow.setAttribute("Rank", tRank);
            int indexOfSelectedRow =
                ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().getRangeIndexOf(currentRow);
            //remove  selected row from collection so it can be added back
            nextRow.removeAndRetain();
            ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().insertRowAtRangeIndex(indexOfSelectedRow, nextRow);
            //make row current in ADF iterator.
            ADFUtils.findIterator("TreeTableView1Iterator").getViewObject().setCurrentRowAtRangeIndex(indexOfSelectedRow + 1);

        }
    }

The JDeveloper 11.1.1.7.0 workspace of the sample application and script file for this post can be downloaded from here

Thursday, June 2, 2011

Generate dynamic report in ADF App

DynamicJasperReport fusion web sample application implemented using JDeveloper 11.1.1.5.0 and built on HR schema included Jasper and DynamicJasper lib can be downloaded from HERE.
This example show you how to use DynamicJasper in ADF application, it help you to design, build and export as pdf your jasper report at run time.
You may use it in application which you let end user to add some properties for element in run time to generate it’s report without redeployment, where you can display different metadata and data each time you run it
DynamicJasper (DJ) is an open source free library that hides the complexity of Jasper Reports, it helps developers to save time when designing simple/medium complexity reports generating the layout of the report elements automatically.
DJ creates reports dynamically, defining at runtime the columns, column width (auto width), groups, variables, fonts, charts, crosstabs, sub reports (that can also be dynamic), page size and everything else that you can define at design time
For more information about DynamicJasper
Regards
Karim Hasan