Non-Serializable Parameter in client methods on an Application Module

Hello,
I want to create a client method which expects an java.io.InputStream as input parameter. Unfortunately all method parameters must be of a data type that implements the Serializable Interface. This might be good and reasonably for remote deployments as EJBs, but I want to use them local.
Is there any solution for this problem?
Thanks,
Christian

The use of our interface-based approach is for guaranteeing that your client layer is always separable from your middle-tier layer.
If you are implementing a project where you are making the assumption that you won't be separating the two, then you can:
(1) Make sure you're using Immediate sync mode, and
(2) Have your client downcast to your *Impl class to call your method with non-serializable parameter.
This isn't best practice in general, but given your constraints, it's the way to solve this problem.

Similar Messages

  • Binding Methods Exposed From Application Module

    Hi All,
    I am using JDeveloper 11.0.2. I have a method exposed on the Application Module that when invoked, it creates a row. I exposed AppModADImpl as a client interface. After doing this, I am now able to see the method under data control section. On my page, I when to bindings and tried to create a bind to this method, I am able to see the method but the OPERATIONS list is disabled, because of this, I am unable to create the bind to the page.
    The method I'm trying to bind is below
    public Row createSystemTypes() {
    ViewObjectImpl vo = getAdSystemTypes1();
    Row row = vo.createRow();
    vo.insertRow(row);
    return row;
    Because the Operations List if disabled, when I click OK, I get the Error "No Actiond defined for the selected Item"
    I would appreciate help to know why Im unable to bind the method to the page.

    As the method has been added to the client interface of the application module, you have to select the application module in the dialog, not a view object. After selecting the application module (or the data control or root node) you should see all methods which are part of the client interface.
    Still, I wold do like Joonas outlined: use drag and drop and if you don't like the button you get this way on the page, switch to source mode and remove it. This will keep hte generated binding in the page def. Removing the button in design view will remove both, button and binding.
    Timo

  • ADF Groovy call method in different application module

    Hi All,
    I have two different application modules(Say TestAM.xml and MyTestAM.xml). I have a method in second application module. I want to call that method from Entity object. Normally we use adf.object.applicationModule.getName()  if it is in the first application module
    So how do I call a method in second application module from Entity object?
    I am using JDev 11.1.1.5 and ADF BC.
    Thanks,
    Rajesh

    Hi,
    In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
    regards

  • Adding and Calling custom method to the application module or view object

    My project uses jheadstart 10.1.2.
    I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
    I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
    THANKS for your help

    Yes, method binding has been added to the page UI model.
    I have find some clue that When I darg and drop metod as a submitButton, the code "
    <SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
    is added to the uix page code. I change this code like this;
    <button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
    by adding onClick method and changed submitButton to button tag..
    Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

  • Two different ways to execute a custom method in an Application Module

    I have a custom method exposed in an Application Module's Client Interface, and i know two different ways of executing it from my ADF Faces project (both works fine):
    1) Calls the method directly through the Data Control:
    MyModule service = (MyModule)JSFUtils.resolveExpression("#{data.MyModuleDataControl.dataProvider}");
    service.myMethod();
    2) Adding a Method Action in the PageDef's file:
    <methodAction id="myMethod" InstanceName="MyModuleDataControl.dataProvider"
    DataControl="MyModuleDataControl" MethodName="myMethod"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"/>
    //Call the method from the binding container
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("myMethod");
    operationBinding.execute();
    Basically i want to know: what are the differences (pros & cons) of each approach ??

    Hi,
    In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
    regards

  • Calling custom methods from Nested Application Modules

    We are having a problem with passing parameters to our nested App Modules.
    We have a custom method in our nested app module and when we drag that method from our data control palette in our page everything seems to work just fine. We are binding our NamedData values to #{requestScope.<field>} where the fields are inputText controls. When we run it will execute the function but the parameters are null.
    It seems to me that the Nested App Module can not evaluate the EL expression, or in other words when it gets evaluated it returns a null.
    Can anyone help with this?
    Thanks,
    Peter

    If you use an EL expression of some hard-coded value instead of #{requestScope.XXX} does that value correctly get passed to the function?
    In other words, are you 100% sure that EL expression is not evaluating to null ?
    If you drop an AM method as a parameter form on a page, you'll see that by default it's NamedData elements use EL expressions that reference attribute bindings that are bound to local page-def variables, rather than to #{requestScope.something}

  • Grants for non-apps user to view APIs in oracle application module browser

    Hi,
    Im trying to make a connection with E-Business Suite using the Oracle Applications Adapter and the Enterprise Service Bus. I follow all the steps for creating the connection pools, connection data sources and connection factories using the standar apps user. After setting up the environment I can drag the oracle applications adapter to a ESB project and choose from all the modules available the especific functionality I want.
    The problem comes when I try to use a user different from apps. When I try to set the connection with other user no E-Business Suite modules are display in the Adapter wizard.
    Are there any specific privileges I should set up to this database user (non-apps) to give him acces to API, XML Gateways, Tables/views,Business Events, etc??.

    Could you let me know the procedure/steps to assign privileges and/or responsibilities for new oracle apps userI understand this is for an application user.
    when I am trying to import a journalAgain, you have to run this as an application user.
    Same import is working fine with default Oracle applications 11i "APPS" user.APPS is a database user (NOT an application user). So, the Application user you want to create and assign him responsibilities has nothing to do with the database user. If you assign the same responsibilities which the other user has (the one which you use to import journals) to the new application user, then you should be able to do the task successfully.

  • Making LOV off of an exposed method from second application module

    Hello,
    I am on JDev 11.1.1.4.0.
    My ADF project worked fine until the spec changed on how Lookups are going to be handled. Previuosly, all the lookup tables were in the same database as other tables. Change is that FND Lookups will be created in the "Oracle" and my ADF project should connect to "Oracle" to get appropriate lookup values to build LOVs while maintaining the main database connection intact.
    After some research, I now have 2 Application Modules, one my project and the other for Lookups to create LOVs. I went to Application Module configuration wizard to edit JDBC setting to point to "Oracle" database and created a read only view with the following SQL:
    SELECT LOOKUP_CODE, MEANING, DESCRIPTION FROM FND_LOOKUP_VALUES  
    WHERE LOOKUP_TYPE = 'MY_LOOKUP'
    AND ENABLED_FLAG = 'Y'
    AND LANGUAGE = 'US'I can run both AMs via "Oracle Business Component Browser" fine. However, I somehow have to set the lookup view object as data source to create LOV on the main updatable view object's attribute. If I set it the way I used to do treating the lookup view as a view object residing in the same AM I am getting "table or view does not exist" error. I guess it is something to do with the lookup view object, but I cannot seem to make any kind of progress on this.
    Any help would be greatly appreciated.
    Thank you
    Bones Jones
    Edited by: Bones Jones on May 19, 2011 10:40 AM

    Well, I think I have found a solution which I didn't have to write a single line of code. My mistake was to think that I have to write code to achieve this.
    Here is what I did:
    *I already have the main AM and View Objects created for my project.  The following steps are done on top of that to bring LOV to life
    1. Create a new, pretty empty AM, named LovAM.
    1.1 Right click on the newly created AM and select 'Configurations'
    1.2 Click JDBC Name value and click 'Edit'
    1.3 Select the second database source where Lookup is defined. If not listed, go back out and create a new Database connection and come back.
    2. Create a View Object with the following SQL:
    SELECT
        TO_NUMBER(LOOKUP_CODE) ID,
        MEANING NAME,
        DESCRIPTION
    FROM
        FND_LOOKUP_VALUES
    WHERE
        LOOKUP_TYPE = 'MY_LOOKUP' AND ENABLED_FLAG = 'Y' AND LANGUAGE = 'US'3. Notice you now have LovAMDataControl
    4. Create a jspx page and create a table with the main data control's binding (This was a part of the requirements).
    5. I create a read-only table with LovAMDataControl.LovLookUp1 binding (I think this creates/exposes correct binding in the pageDef).
    6. Now I drag-and-drop an attribute that I have been wanting to display LOV from the main binding.
    7. Selected single select listbox. You will be presented with 'Edit zlist Binding' screen.
    8. Base Data Source is the main data control binding.
    9. Select Dynamic List
    10. Select LovAM data control binding as List Data Source.
    11. (optional) Selected 'Name' as Display Attribute.
    11.1. (optional) I don't want to see the table created in step 5. On the jspx page, go to Source tab and delete the table from there. I think this keeps binding in pageDef while the UI component is deleted from the page.
    12. Save and Run
    Now, I didn't have to create Root Application Module in the code, but still achieved what I wanted.
    Thanks
    Bones Jones

  • Non-void return type for Application Module Clients Interface

    Hello, can anyone guide me on how will I solve my problem.
    first of all, I'm using JDeveloper 10.1.3, I use JSF, ADF Faces, ADF Model, ADF Business Components.
    I made a web page that has a Transactional Capabilities, all is going smoothly, all data's can be saved to oracle database. I created a Custom Method in my Application Module and can be used in Clients Interface, that method is for saving data's to database.
    My problem is I dont know how to create a custom method that returns a value in my Application Module. Which means if I set it to non-void return type, it is not visible to Client Interface. If you're going to ask me why I need it to return a value? Well since that method is for saving data's, if there's an Error Occured, I can return the Error Message and show it to my user interface.
    Please help. thanks

    If you want to return your own type then simply define it as serializable and you will find that it will appear in the Client Interface dialog of your AM.
    eg, you could return this type from your application module to progagate a meaningful message to your UI:
    package com.delexian.model;
    import java.io.Serializable;
    public class MyMessage implements Serializable {
        private String _severity;
        private String _message;
        public MyMessage() {
        public void setSeverity(String severity) {
            this._severity = severity;
        public String getSeverity() {
            return _severity;
        public void setMessage(String message) {
            this._message = message;
        public String getMessage() {
            return _message;
    }regards,
    Brenden

  • Accessing AM Client Interface from Web Application

    Hi,
    I am trying to access some client interface methods that I developed on my application module from a backing bean on my web application and have trouble doing so.
    Some background on the problem,
    Basically when logging into our application from the front-end, we have to authenticate the user against some custom security code. Part of this code is to validate the user against the Oracle database (i.e. valid oracle db user, and password is valid password to log onto Oracle database). To do this, I developed Client Interface methods on an Application Module. When using the BC Tester in jdev 11g (the latest release), these methods work 100% and validation occurs. On our logon page, I bound these methods to the page definition file. When I then try in the backing bean to call this method, using the code from the ADF 11g Dev guide as below, the DataControl on the action is null at point 3. It does seem to find the action find. I have also tried to actually use the "setParams" method on the action, and then tried the execute(), invoke() + getResult(), and doIt() + getResult() methods, of which none seems to work. All these go past the execute/invoke/do part, but the return value on the execute, as well as the return value from the getResult calls are null.
    public String commandButton_action() {
    // Example using an action binding to get the data control
    public String commandButton_action() {
    // 1. Access the binding container
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    // 2. Find a named action binding
    JUCtrlActionBinding action = (JUCtrlActionBinding)bc.findCtrlBinding("SomeActionBinding");
    // 3. Get the data control from the iterator binding (or method binding)
    DCDataControl dc = action.getDataControl();
    // 4. Access the data control's application module data provider
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    // 5. Cast the AM to call methods on the custom client interface
    StoreServiceAM service = (StoreServiceAM)am;
    // 6. Call a method on the client interface
    service.doSomethingInteresting();
    return "SomeNavigationRule";
    Can somebody perhaps tell me what I am doing wrong, or of a better approach to resolve this problem. If any more info is needed, please let me know.
    I did think about binding the action directly to the logon button on the jsf page, but unfortunately there is additional logic/code that is currently in the backing bean that I do not want to move down into the business components, and some code like the lines below that can not be moved.
    HttpSession session = (HttpSession)externalContext.getSession(true);
    session.setAttribute(SecurityFilter.SESSION_ATTR_USER, securityDto.getUsername());
    session.setAttribute(SecurityFilter.SESSION_ATTR_SECRET, securityDto.getPassword());
    session.setAttribute(SecurityFilter.SESSION_ATTR_ROLES, securityDto.getRoles());
    return "logonSuccess";
    Will really appreciate any help.
    Tx
    Drikus

    Hi,
    I managed to find some sort of work around.
    I actually dragged and dropped the Client Interface for the custom method from the datacontrol onto my jsf page and created an additional button. I then ran the application and everything worked. Afterwards I went back to my jsf page and removed the newly added button again and removed the newly added methods from my page definition file as well. When I run the application now, the exact same code that I used previously, now seems to work. I changed it to use the findDataControl method as Frank suggested, and that also works now.
    What i can not figure out though, is what exactly the the dropping of that dataControl method and removing it again changed on my application to make it work now. Can somebody please try this and see if they can find the answer. I have done a small little sample application where I can replicate the problem exactly which I can provide the steps to if needed.
    Drikus.

  • Execute application module method automatically from uix page

    Hi,
    We are developping an application using Jheadstart 10.1.2.2 (build 32) with UIX pages as a view.
    We have build a custom method on our application module class that creates and saves in a directory a chart in function of a parameter we pass to this method.
    We would like to execute this method every time we acces a form page since this pages has to show the chart that our method creates. We would like to know if it is possible to execute this method automatically every time we acces this form page without having to press a button each time.
    Thanks in advanced.
    Xavier

    Xavier,
    I am not sure UIX works as JSPX and JHS 10.1.2 as 10.1.3, but that is what I would do if I wanted to execute a method on page load:
    1. Create a new managed bean(MyBean) in your faces-config which implements oracle.adf.controller.v2.PagePhaseListener interface
    2. Go to the pagedef file of your page, right click it in structure pane and set the controller class to 'MyBean'
    3. in MyBean and in beforePhase() method access App Module and call your function [see 4]. I quote this from ADF Dev.Guide 10.1.3 for how you can get App Module and call your function on it:
    // 1. Access the FacesContext
    FacesContext fc = FacesContext.getCurrentInstance();
    // 2. Create value binding for the #{data} EL expression
    ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
    // 3. Evaluate the value binding, casting the result to BindingContext
    BindingContext bc = (BindingContext)vb.getValue(fc);
    // 4. Find the data control by name from the binding context
    DCDataControl dc = bc.findDataControl("SRServiceDataControl");
    // 5. Access the application module data provider
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    // 6. Cast the ApplicationModule to its client interface
    SRService service = (SRService)am;
    // 7. Call a method on the client interface
    service.doSomethingInteresting();
    4. Check the phase and call your function in beforePhase method of your MyBean (implementing PagePhaseListener)
    public void beforePhase(PagePhaseEvent event) {
    FacesPageLifecycleContext ctx =(FacesPageLifecycleContext)event.getLifecycleContext();
    if (event.getPhaseId() == MY_DESIRED_PHASE) service.doSomethingInteresting();
    Probably, there is a shortcut to all these, or an alternative approach, which I myself will be happy to know about.

  • Best practice for calling application module methods and plsql code

    In my application I am experiencing problems with connection pooling, I seem to be using a lot of connections in my application when only a few users are using the system. As part of our application we need to call database procedures for business logic.
    Our backing beans, call methods on the application module which in turn call a database procedure. For instance in the backing bean we have code like this to call the application module method.
    // Calling Module to generate new examination/test.
    CIGAppModuleImpl appMod = (CIGAppModuleImpl)Configuration.createRootApplicationModule("ky.gov.exam.model.CIGAppModule", "CIGAppModuleLocal");
    String testId = appMod.createTest( userId, examId, centerId).toString();
    AdfFacesContext.getCurrentInstance().getPageFlowScope().put("tid",testId);
    // Close the call
    System.out.println("Calling releaseRootApplicationModule remove");
    Configuration.releaseRootApplicationModule(appMod, true);
    System.out.println("Completed releaseRootApplicationModule remove");
    return returnResult;
    In the application module method we have the following code.
    System.out.println("CIGAppModuleImpl: Call the database and use the value from the iterator");
    CallableStatement cs = null;
    try{
    cs = getDBTransaction().createCallableStatement("begin ? := macilap.user_admin.new_test_init(?,?,?); end;", 0);
    cs.registerOutParameter(1, Types.NUMERIC);
    cs.setString(2, p_userId);
    cs.setString(3, p_examId);
    cs.setString(4, p_centerId);
    cs.executeUpdate();
    returnResult=cs.getInt(1);
    System.out.println("CIGAppModuleImpl.createTest: Return Result is " + returnResult);
    }catch (SQLException se){
    throw new JboException(se);
    finally {
    if (cs != null) {
    try {
    cs.close();
    catch (SQLException s) {
    throw new JboException(s);
    I have read in one of Steve Muench presentations (Oracle Fusion Applications Team' Best Practises) that calling the createRootApplicationModule method is a bad idea, and to call the method via the binding interface.
    I am assuming calling the createRootApplicationModule uses much more resources and database connections that calling the method through the binding interface such as
    BindingContainer bindings = getBindings();
    OperationBinding ob = bindings.getOperationBinding("customMethod");
    Object result = ob.execute()
    Is this the case? Also is using getDBTransaction().createCallableStatement the best way of calling database procedures. Would it be better to expose plsql packages as webservices and then call them from the applicationModule. Is this more efficient?
    Regards
    Orlando

    Thanks Shay, this is now working.
    I successfully got the binding to the application method in the pagedef.
    I used the following code in my backing bean.
    package view.backing;
    import oracle.binding.BindingContainer;
    import oracle.binding.OperationBinding;
    public class Testdatabase {
    private DCBindingContainer bindingContainer;
    public void setBindingContainer (DCBindingContainer bc) {this.bindingContainer = bc;}
    public DCBindingContainer getBindingContainer() {return bindingContainer;}
    public static String validateUser()
    // Calling Module to validate user and return user role details.
    System.out.println("Getting Binding Container from Home Backing Bean");
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    System.out.println("Obtain binding");
    OperationBinding operationBinding = bindings.getOperationBinding("calldatabase");
    System.out.println("Set username parameter");
    operationBinding.getParamsMap().put("p_userId",userId);
    System.out.println("Set password parameter");
    operationBinding.getParamsMap().put("p_testId",examId);
    Object result = operationBinding.execute();
    System.out.println("Obtain result");
    String userRole = result.toString();
    System.out.println("Result is "+userRole);
    }

  • Freeze JDeveloper10.1.3: Changing client interface on application module

    Hello,
    I could freeze JDeveloper 10.1.3.0.4.3673 build JDEVADF_10.1.3_NT_060125.0900.3673 3 times in a row with the following procedure:
    1) You need HR schema from oracle examples
    2) Create a new application workspace without any template (any name works)
    3) Create the empty project (any works as well)
    4) Set the project's technology scope to
    4.1) ADF Business Component
    4.2) Web Service
    4.3) XML
    4.4) Java will be added automatically
    5) Generate business components from table
    5.1) Generate component from table Employees only
    5.2) Generate an updatable view for the component
    5.3) Don't generate any read-only view object
    5.4) Generate an app module
    6) Add two methods to the application module class, here's are methods I'm using
    public Element getCurrentEmployee()
    ViewObject employeeView = getEmployeeView1();
    Row current = employeeView.getCurrentRow();
    if(current == null) {
    current = employeeView.next();
    Node employeeXml = current.writeXML(0, XMLInterface.XML_OPT_ALL_ROWS);
    return (Element)employeeXml;
    public void saveCurrentEmployee(Element xmlElement)
    getEmployeeView1().readXML(xmlElement, 0);
    getTransaction().commit();
    7) Go to the application module properties and add the first method (getCurrentEmployee in my example) to the client interface
    8) Click ok to confirm the change, some files will be generated
    9) Reopen the application module properties, go to remote section and add a J2EE Web Service support
    10) Click Ok, some files will be generated
    11) Go to the web service properties in the state section and make the service stateful on session scope
    12) Click Ok, some files are modified and a .deploy file is created
    13) Save All
    14) Go to application module properties and add the second method to the client interface
    15) Click Ok, JDeveloper will freeze.
    Anyone else can reproduce that or is it a strange bug from my environment?
    Regards,
    Simon Lessard

    Simon,
    I'm having a very similar problem except mine freezes at step 13. I click save all and jdeveloper freezes. Did you ever find a solution to this problem?
    -brian

  • Invoking custom methods in application modules

    Hi,
    I am absolutely new to oracle ADF.I was recently working with application module.My question is how do I call a custom method(say myCustomMeth(String str) ) residing inside my application module from my Managed bean?I saw one example where the operation(i.e. the method) was directly dragged and dropped onto the jspx page from the data control.Is it the right way of doing it?I also saw one example where operation binding was used to invoke a method inside the application module although I didn't understand the code fully.I am really confused now.Please help.
    Thanks in advance.

    user11930797 wrote:
    My question is how do I call a custom method(say myCustomMeth(String str) ) residing inside my application module from my Managed bean?You write the custom Application Module method and you expose it to the AM's client interface. By doing so, the custom operation becomes available in the AM Data Control and can be bound to your jspx page.
    I saw one example where the operation(i.e. the method) was directly dragged and dropped onto the jspx page from the data control.Is it the right way of doing it?I also saw one example where operation binding was used to invoke a method inside the application module although I didn't understand the code fully.Both of the methods that you are mentioning above are used:
    1. You can drag the custom method from the data control in JDeveloper and drop it in your page as a command button or link to create a method binding declaratively this way. The method binding is executed via some command button or link and your custom AM method is called, or
    2. You can create the method binding yourself in the bindings tab of you jspx page, add the command button in your page and define an action listener for it in your backing bean. In your backing bean action listener you can write the necessary code to execute the method binding, which will call your custom AM method.
    Hope it is clear.
    Nick

  • How to invoke Application Module method from entity object methods

    Hi,
    We have an existing Application Module which provides some validation logic. We are using OperatingBinding or getting the Application Module instance from the bindings and then invoking the app module methods in the view controller project.
    But in our current scenario, We need to invoke the application module method from the setAttribute method in the entity object when ever an entity attribute value is changed . I believe we can call createRootApplicationModule method to create application module instance. But this may lead to performance overhead.
    Can you please suggest, if there is any alternative to invoke the application module method inside the business components.
    What is the best way to create

    We have a pricing service, which was developed as a separate application. We need to invoke the pricing service with the change in certain attributes of the entity object and update some of the attributes of the current entity object. At present we are handling these calls to the pricing service in the ui layer in the valueChangeListener.
    But we would like to move this service call into setAttribute method as we are unable to prevent the call to the service if the model validations fail. I am looking for the best possible approach for invoking the service calls from the entity objects.
    Thanks and Regards,
    S R Prasad

Maybe you are looking for