Exporting Application Module Methods to Clients?

Hi,
I would like to export a method in my AppModuleImpl to a client.
My method throws an exception NOT derived from JboException.
The JboExceptions are RuntimeExceptions and I need a non RuntimeException.
e.g.
public void doit throws Exception{}
My method does not appear in the "Client Methods" register "Available" methods (in the AppModule Wizard)?
In the Help I found the following
Available:
"A list of generated methods available for export (only public methods implementing the Serializable interface will be included in the list). You can export methods by moving methods from the Available list to the Selected list: select one or more methods, and click the left arrow (>). Or click the double left arrow (>>) to move all methods."
The doc is confusing me a little bit - what does "public methods implementing the Serializable interface" mean?
Is it possible to throw an exception which is not derived from JboException?
Many Thanks for any help
Guenther

Is it possible to throw an exception which is not derived from JboException?
Not presently. Exceptions on remoteable methods must be an instanceof oracle.jbo.JboException.

Similar Messages

  • How do I call an Application Module method from a EntityImpl class?

    Guys and Gals,
    Using Studio Edition Version 11.1.1.3.0.
    I've got a price update form, that when submitted, takes the part numbers and prices in the form and updates the corresponding Parts' price in the Parts table. Anytime this Parts view object's ReplacementPrice attribute is changed, an application module method needs to be called which updates a whole slew of related view objects. I know you can modify view objects via associations (How do I call an Application Module method from a ViewObjectImpl class? but that's not what I'm trying to do. These AppModuleImpl methods are the hub for all price updates, as many different operations may affect related pricing (base price lists, price buckets, etc) and hence, call the updatePartPricing(key) method.
    For some reason, the below code does not call / run / activate the application module's method. The AppModuleDataControl exists and recordPartHistory(key) is registered and public. At runtime, the am.<method> code is simply ignored, and as a weird side-effect, I cannot navigate out of my current page flow.
      public void setReplacementPrice(Number value)
        setAttributeInternal(REPLACEMENTPRICE, value);
        AppModuleImpl am = (AppModuleImpl)this.getDBTransaction().findApplicationModule("AppModuleDataControl");
        Key key = new Key(new Object[]
            { getPartNumber() });
        am.recordPartHistory(key);  // AppModuleImpl method which records pricing history
        am.updatePartPricing(key); // AppModuleImpl method which updates a whole slew of related pricing tables
      }Any ideas?

    Thanks Timo.
    Turns out the code provided was correct, but the AppModuleImpl method being called was not. A dependent ViewObject wasn't returning the row I was expecting. I then tried to perform some operations on that row, which in turn ... just stopped everything, but didn't give me an error.
    It was the lack of the error that threw me off. I had never messed with calling an AppModuleImpl method from the EntityImpl so I assumed that's what was messing up.
    You are correct. It is available from the ViewRow, but I thought it better to put it in the EntityImpl. This method will be called every time the replacement cost is modified. If I didn't put it in the EntityImpl, I'd have to remember to call it every time a replacement cost changed.

  • 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);
    }

  • 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

  • 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.

  • Calling PL SQL Procedure in Application Module Method

    Hi Experts,
    I want to know how can i call a plsql procedure in Application Module and get the value of the OUT parameter of procedure . if possible please provide some example
    Thanks in advance.

    Have a look at this sample code from one of our projects:
        CallableStatement cstmt = this.getDBTransaction().createCallableStatement(
          "{ call Expand_Message( ?, ?, ? )}", DBTransaction.DEFAULT);
        try
          cstmt.setString(1, arg1 );
          cstmt.setString(2, arg2 );
          cstmt.registerOutParameter(3, Types.VARCHAR);     
          cstmt.execute();
          result = cstmt.getString(3);
        catch (SQLException e) {
          // Process eventual SQL exception here
        finally {
          try {
            cstmt.close(); }
          catch (Exception e) {;}
        }This code is part of a method in a custom ApplicationModuleImpl class (defined for one of the ApplicationModules) and the 3rd parameter of the Expand_Message procedure is an OUT-parameter.
    Dimitar

  • Exception while exposing Application Module Methods as Web Service

    Hello Everyone,
    I am working on Jdeveloper 11.1.1.3.0 version and tried to expose one method of application module as web service. To do this, i used "Service Interface" tab of Application module within Jdeveloper and Jdeveloper had generated all interfaces, stubs, code for the Session bean required for web service. I am now trying to "Test Web Service" from the implementation class generated then i am getting this error in Weblogic deployment. Any help/pointers would be highly appreciated.
    I used another installation of Jdeveloper same version at my collegues desktop but getting the same error. Not sure, if this version of Jdeveloper is having issue in exposing application module as web service. I think that database related exception can be ignored as no database call is being made by the application.
    [Running application SalaryControlService on Server Instance IntegratedWebLogicServer...]
    [10:41:26 AM] ---- Deployment started. ----
    [10:41:26 AM] Target platform is (Weblogic 10.3).
    [10:41:27 AM] Retrieving existing application information
    [10:41:27 AM] Running dependency analysis...
    [10:41:27 AM] Deploying 2 profiles...
    [10:41:27 AM] Wrote EJB Module to C:\Documents and Settings\sacggupt\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\SalaryControlService\ModelEJB.jar
    [10:41:28 AM] Wrote Enterprise Application Module to C:\Documents and Settings\sacggupt\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\SalaryControlService
    [10:41:29 AM] java.lang.NullPointerException
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.jaxws.AssemblerProcessor.getClassNamesFromEjb(AssemblerProcessor.java:180)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.jaxws.AssemblerProcessor.processEjb(AssemblerProcessor.java:149)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsEjbAssembler.processEjb(JaxwsEjbAssembler.java:182)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsEjbAssembler.ejbAssemble(JaxwsEjbAssembler.java:152)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.cli.Processor.jaxwsEjbAssemble(Processor.java:630)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.cli.Processor.execute(Processor.java:327)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.cli.Processor.execute(Processor.java:230)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.Main.mainNoSystemExit(Main.java:84)
    [10:41:29 AM]      at oracle.j2ee.ws.tools.wsa.Main.main(Main.java:49)
    [10:41:29 AM] WARNING: Error while processing ejb-jar.xml for ejb module at "C:\Documents and Settings\sacggupt\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\SalaryControlService\ModelEJB.jar".
    [10:41:29 AM] INFO: Unable to load annotation weblogic.javaee.CallByReference for parsing. The annotation is ignored.
    [10:41:29 AM] INFO: Unable to load annotation weblogic.javaee.CallByReference for parsing. The annotation is ignored.
    [10:41:29 AM] INFO: GenericWSWarAnnotationListener.parseAnnotatedClass Adding Servlet Mapping with URL pattern /HrModuleService for annotated WebService class lt.andrejusb.model.server.serviceinterface.HrModuleServiceImpl
    [10:41:30 AM] WSA process exited with code 0
    [10:41:30 AM] Deploying Application...
    <Jan 3, 2011 10:41:31 AM IST> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application SalaryControlService is not versioned.>
    <ServerMessages><warningMBeanRegisterError> Failed to register the web service Config MBeans for application: SalaryControlService endpoint: SalaryControlService the error is: oracle.as.jmx.framework.util.MissingConfigurationFileException: The configuration at URI "WEB-INF\oracle-webservices.xml" cannot be loaded.
    [10:41:36 AM] Application Deployed Successfully.
    [10:41:36 AM] The following URL context root(s) were defined and can be used as a starting point to test your application:
    [10:41:36 AM] http://10.176.162.16:7101/SalaryControlService
    [10:41:36 AM] Elapsed time for deployment: 9 seconds
    [10:41:36 AM] ---- Deployment finished. ----
    Run startup time: 9391 ms.
    [Application SalaryControlService deployed to Server Instance IntegratedWebLogicServer]
    Target URL -- http://localhost:7101/SalaryControlService/HrModuleService
    Edited by: LearningToFly on Jan 2, 2011 9:13 PM

    Hello,
    Is this resolved yet? The reason I am asking is that I'm getting the same error as yours. I am trying to run the StoreFront tutorial in JDeveloper 11.1.1.3 and here's what I got:
    [04:21:31 PM] ---- Deployment started. ----
    [04:21:31 PM] Target platform is (Weblogic 10.3).
    [04:21:32 PM] Retrieving existing application information
    [04:21:32 PM] Running dependency analysis...
    [04:21:32 PM] Deploying 4 profiles...
    [04:21:32 PM] Wrote MAR file to C:\Documents and Settings\ylin\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\StoreFrontModule\metadata1.mar
    [04:21:33 PM] Wrote Web Application Module to C:\Documents and Settings\ylin\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\StoreFrontModule\StoreFrontUIWebApp.war
    [04:21:38 PM] Wrote EJB Module to C:\Documents and Settings\ylin\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\StoreFrontModule\StoreFrontServiceEJB.jar
    [04:21:40 PM] Wrote Enterprise Application Module to C:\Documents and Settings\ylin\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\StoreFrontModule
    [04:21:41 PM] java.lang.NullPointerException
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.jaxws.AssemblerProcessor.getClassNamesFromEjb(AssemblerProcessor.java:180)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.jaxws.AssemblerProcessor.processEjb(AssemblerProcessor.java:149)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsEjbAssembler.processEjb(JaxwsEjbAssembler.java:182)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsEjbAssembler.ejbAssemble(JaxwsEjbAssembler.java:152)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.cli.Processor.jaxwsEjbAssemble(Processor.java:630)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.cli.Processor.execute(Processor.java:327)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.cli.Processor.execute(Processor.java:230)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.Main.mainNoSystemExit(Main.java:84)
    [04:21:41 PM]      at oracle.j2ee.ws.tools.wsa.Main.main(Main.java:49)
    [04:21:41 PM] WARNING: Error while processing ejb-jar.xml for ejb module at "C:\Documents and Settings\ylin\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\StoreFrontModule\StoreFrontServiceEJB.jar".
    [04:21:41 PM] INFO: Unable to load annotation weblogic.javaee.CallByReference for parsing. The annotation is ignored.
    [04:21:41 PM] INFO: Unable to load annotation javax.interceptor.Interceptors for parsing. The annotation is ignored.
    [04:21:41 PM] INFO: Unable to load annotation weblogic.javaee.CallByReference for parsing. The annotation is ignored.
    [04:21:41 PM] INFO: Unable to load annotation javax.interceptor.Interceptors for parsing. The annotation is ignored.
    [04:21:41 PM] INFO: GenericWSWarAnnotationListener.parseAnnotatedClass Adding Servlet Mapping with URL pattern /StoreFron
    Can someone help with this? Thank you in advance!
    Edited by: 834077 on Mar 5, 2011 6:28 AM

  • Call Application Module method(Function) from maanged bean

    Hi Experts,
    JDEV 11.1.2
    I created method in application module which access two parameters and returns a string value, then binded in pagedefinition file as method action.
    Now i wisht to call from a managed bean by passing two parameters , give me a sample code of it..
    Thankz in advance
    PMS
    Edited by: pms on Feb 18, 2012 11:56 AM

    am code
    public void checkLoginCredentials(String ename,String pwd_form)
    System.out.println(ename + " " + pwd_form);
    EmpLoginViewObjImpl vo = (EmpLoginViewObjImpl)getEmpLoginViewObj1();
    //set the bind variable value to last name
    vo.setNamedWhereClauseParam("LastName",pwd_form);
    vo.executeQuery();
    int rowCount=vo.getEstimatedRangePageCount();
    System.out.println("rowCount="+rowCount);
    if(rowCount==0) {
    throw new JboException("Password doesn't match");
    bean code
    public String commandButton_action() ()
    String returnStr="error";
    System.out.println("Inside loginBtn_action");
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("checkLoginCredentails");
    Object result = operationBinding.execute();
    System.out.println(result);
    if (operationBinding.getErrors().isEmpty()) {
    returnStr= "success";
    System.out.println("returnStr= " + returnStr);
    return returnStr;
    }

  • Manage bean methods not able to call application module methods

    Hi,
    I have an ADF application where in my managed bean method needs to call AppModuleImpl methods. I use the code as below:
    public void getSummary() {
    DCBindingContainer binding = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding op = binding.getOperationBinding("getVOData");
    op.execute();
    The code works fine when I run the application in my IntegratedWeblogicServer and I am able to get the data on my .jsp pages.
    I have installed weblogic server on another machine and I need to deploy and run my application on that server. But when I try doing that, the above code is not able to call the AppModule method and I see no data on my page (Also there is no error or exceptin thrown). Seems that the ViewController project is not able to interact with the Model project.
    Is there any extra configuration to be done on the newly installed weblogic server to get this work? Or will some change in the application code help?
    Please suggest.
    Thanks and regards,
    Ansh

    Hi,
    While creating the weblogic domain, we had the following checkboxes checked:
    1. Basic weblogic server domain [wlserver_10.3]
    2. Oracle JRF [oracle_common]
    I hope this is what we need.
    Yes, I also have the adf runtime installed.

  • ADFBC Where to define labels for custom Application Module method arguments

    I was wondering if there was a "good place" to define these labels in ADF Business Components. I can just change them for the UI for my current project, but I thinking there might be a better way.
    Thanks,
    Brian

    Hi,
    I think you can't in BC, but you can in ADF. If you drag a method onto the client then it creates a method binding with argument itemes below. In addition, look in the executable section, it creates variables for each. This is where you can define labels so that they can be translated
    Frank

  • How to pass calculated value to Application Module method?

    I am a newbie to ADF. Ithink I am missing something very basic:
    In JDeveloper 10.1.3.3 using ADF, I am trying to pass the session ID to a method in my App Mod, but the method receives a null value. I think I a getting the session ID too late in the process, but do not know where else to get it.
    Here are the details:
    I am passing 3 argument to a method called ProcessReport:
    public String ProcessReport(Number reportNumber, Double caratWeight, String sessionID)
    In my PageDef I have:
    <p>
    &lt;executables&gt;
    &lt;variableIterator id="variables"&gt;
    &lt;variable Type="oracle.jbo.domain.Number"
    Name="ProcessReport_reportNumber" IsQueriable="false"/&gt;
    &lt;variable Type="java.lang.Double" Name="ProcessReport_caratWeight"
    IsQueriable="false"/&gt;
    &lt;variable Type="java.lang.String" Name="ProcessReport_sessionID"
    IsQueriable="false"/&gt;
    &lt;/variableIterator&gt;
    &lt;/executables&gt;
    &lt;bindings&gt;
    </p>
    <p>
    &lt;methodAction id="ProcessReport" MethodName="ProcessReport"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false" DataControl="RC2DataControl"
    InstanceName="RC2DataControl.dataProvider"
    ReturnName="RC2DataControl.methodResults.RC2DataControl_dataProvider_ProcessReport_result"&gt;
    &lt;NamedData NDName="reportNumber" NDType="oracle.jbo.domain.Number"
    NDValue="${bindings.ProcessReport_reportNumber}"/&gt;
    &lt;NamedData NDName="caratWeight" NDType="java.lang.Double"
    NDValue="${bindings.ProcessReport_caratWeight}"/&gt;
    &lt;NamedData NDName="sessionID" NDType="java.lang.String"
    NDValue="${bindings.ProcessReport_sessionID}"/&gt;
    &lt;/methodAction&gt;
    &lt;attributeValues id="reportNumber" IterBinding="variables"&gt;
    &lt;AttrNames&gt;
    &lt;Item Value="ProcessReport_reportNumber"/&gt;
    &lt;/AttrNames&gt;
    &lt;/attributeValues&gt;
    &lt;attributeValues id="caratWeight" IterBinding="variables"&gt;
    &lt;AttrNames&gt;
    &lt;Item Value="ProcessReport_caratWeight"/&gt;
    &lt;/AttrNames&gt;
    &lt;/attributeValues&gt;
    &lt;attributeValues id="sessionID" IterBinding="variables"&gt;
    &lt;AttrNames&gt;
    &lt;Item Value="ProcessReport_sessionID"/&gt;
    &lt;/AttrNames&gt;
    &lt;/attributeValues&gt;
    &lt;/bindings&gt;
    </p>
    On my page I have added an outputText control called sessionID to hold the session ID.
    In my command Button to submit the page I have and action to call a method in my backing bean:
    The code is:
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext ectx = ctx.getExternalContext();
    HttpSession mySession = (HttpSession) ectx.getSession(false);
    String theSessionID = mySession.getId();
    sessionID.setValue(theSessoinID) // I hope it populates the outputText control and is added to the binding to be passed to the ProcessReport method
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("ProcessReport");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    String resultStr = (String) result;
    return resultStr;
    No luck! I think I should get the sesson ID earlier, when the page loads, but I do not know where to put the code.
    Any suggestions would be appreciated.
    John

    Hi,
    here's what I would do
    1. Create a managed bean as follows
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class HTTPSessionAccessBean {
        public HTTPSessionAccessBean() {
        public void setHttpSessionId(String httpSessionId) {
        public String getHttpSessionId() {
            FacesContext ctx = FacesContext.getCurrentInstance();
            ExternalContext ectx = ctx.getExternalContext();
            HttpSession mySession = (HttpSession) ectx.getSession(false);
            String sessionId = mySession.getId();
            return sessionId;
    }2. In the ApplicationModule Impl class create the following method and expose it as a clientInterface
        public void setSession(String sessionId){
           ((SessionImpl)this.getSession()).getEnvironment().put("http_session",sessionId);
        }3) In the pageDef File create a method binding as
    <methodAction id="setSession"
                      InstanceName="AppModuleDataControl.dataProvider"
                      DataControl="AppModuleDataControl" MethodName="setSession"
                      RequiresUpdateModel="true" Action="999"
                      IsViewObjectMethod="false">
          <NamedData NDName="sessionId"
                     NDValue="${HttpSession.httpSessionId}"
                     NDType="java.lang.String"/>4) In the same pageDef file create an invokeAction
        <invokeAction id="setSessionInAM" Binds="setSession"
                      RefreshCondition="#{!adfFacesContext.postback}"/>The session ID is now accessible from the ApplicationModule as
            Hashtable env = ((SessionImpl)this.getSession()).getEnvironment();
            String sessonId =(String) env.get("session);
            }This maintains the separation of model/view layer
    Frank

  • JDev 323, Application module exportable client methods

    Hello all,
    Can anyone tell what is the exact set of rules for an application module method to be "exportable"?
    From what I have seen, the method must be public, and its parameters and return type must be either basic types or Serializable objects.
    It seems also that, if a parameter or the return value is an array of Serializable objects (such as String[]), then the method is still "exportable".
    Strangely though, if a parameter or the return value is an array of a basic type (say int[]), then the method no longer appears as exportable in the Application Module wizard...
    I know I could use various workarounds, such as replacing int[] with Number[], to achieve the same goal, but I'd really like to know if this is the expected behaviour or just a little flaw in the wizard.
    In the latter case, is there a possibility to fix this issue?
    Thanks for any help, Remi
    null

    This is a bug in 3.2.3 and will be fixed for the next release.
    null

  • Client interface methods in application module editor get unselected

    Hello everybody,
    I have a problem with my application module client interface.
    Every time I edit source of application module methods that are exposed as a client interface, they get unselected in application module editor (they are not exposed anymore).
    Then I have to shift them from left (available) to the right (selected) manually.
    Has anyone experienced such problem?
    I'm using JDev 10.1.2.

    Strange, the same question here {thread:id=2187487}
    Timo
    Edited by: Timo Hahn on 08.03.2011 12:02
    @john You beat me agian

  • 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 get the application module instance in backing bean.

    This is Ramesh, I am new to JDeveloper world.
    In my current application I have change password screen which allows user to change there password.
    Here this is a pop-up page. Here I don't have the view object and pagadef for this changepassword.jspx file.
    My aim is to call the Application Module method which takes the user name, old password and new password.
    In backing bean I am trying to call this method by using
    MyProjAM obj = _binding.getDataControl().getApplicationModule();  //throw null pointer exception.
    _binding is the object of DCBindingContainer. 
    ( I have created the parameter called "binding" as my managed bean property and values as #{binding})
    But the above line is throwing the NullPointerException.
    Could you please help me to come out of this problem.
    Thanks and Regards,
    Ramesh Biradar.

    If your page has no page definition, then #{bindings} will be null during the request for that page.
    If you need your page to invoke a data control method when you press a button, the simplest (and declarative) way is publish your AM method on the AM's client interface, then drop the method as a button from the data control palette onto your page. You don't even need a backing bean to accomplish this.
    That said, you can refer to a data control in a backing bean using the expression #{data.[i]YourAppModuleNameDataControl.dataProvider}
    So, assuming you have a helper method like this:
      public static Object EL(String expression) {
        FacesContext ctx = getFacesContext();
        Application app = ctx.getApplication();
        ValueBinding bind = app.createValueBinding(expression);
        return bind.getValue(ctx);
      }and assuming that your application module is named SRService
    and assuming that you have correctly nominated any Application Module custom methods as being available to clients by selecting them on the "Client Interface" panel of the application module editor, then in a backing bean you can acquire an instance.
    Then, the ADF design time will have automatically generated you a custom AM client interface named SRService and you can reference that service interface in your backing bean by using code like this:
            SRService svc = (SRService)EL("#{data.SRService.dataProvider}");
            svc.yourCustomMethod(your,args);

Maybe you are looking for