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.

Similar Messages

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

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

  • 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

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

  • Java access to view objects from uix page provider

    I have a java method called from a uix page as follows:
    <dataScope>
       <provider>
           <data name="frameworkTableData">
              <method class="smart.FrameworkAspects"
                      method="getFrameworkStudyAspects"/>
           </data>
       </provider>
    I want the java program to be able to access the bc4j view objects defined on the page. These are:
    <bc4j:registryDef>
      <bc4j:rootAppModuleDef name="SmAspectsBrowseAppModule"
                             definition="smart.Smartbc4jModule"
                             releaseMode="stateful" > 
       <bc4j:viewObjectDef name="SmFrameworksBrowse"
                        rangeSize="0"  />                       
      <bc4j:viewObjectDef name="SmAspectsBrowse"
                          rangeSize="10" />                       
      <bc4j:viewObjectDef name="SmStudyMembersAspectsEdit" />
      </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    I've read through several of the threads on using Configuration.createRootApplicationModule(amDef, config) and it is not clear what it is looking for in the arguments.  It appears that "config" is the name of the app module. I don't know what the amDef relates to.
    Anyway, I can't get it to work.  All I'm trying to do is get at 3 view objects I have defined in my bc4j section and am having trouble getting this to work.
    Any ideas on how to approch this would be much appreciated.
    Thanks, Steve
    Does anyone                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Can you explain how you solved the problem? I have the same. Thanks.

  • 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

  • Accessing application module instances directly from the AMPool

    Hi!
    I´m want to create an Application Module Pool Monitor, actually I need to know how many fetched rows an Application Module instance has.
    I made a jsp, that do the following:
    ApplicationPool pool = (ApplicationPool)poolMgr.getResourcePool(poolname);
    int instanceCount = pool.getInstanceCount();
    for (int i = 0; i < instanceCount; i++){       
    ApplicationModule am = pool.getInstance(i);
    and then works with the am instances, calculating the rows that each VO has fetched.
    Now, It is not yet clear to me if, when I use "pool.getInstance(i)",
    I'm locking the instance that is being use by another session (an user session), or trying to get a lock,
    and possibly creating a deadlock. Or the AMPool administrates the lock and I don´t need to worry about it.
    Thank in advance, and sorry for my bad english!
    (i forgot to mention, I´m using adf - bc 10.1.2 )
    Message was edited by:
    user506477

    Sure, we are having RAM problems, sometimes, and for reasons that are still unclear, a process begins to consume memory.
    What we need rigth now, is a tool that tell us how many rows in memory has each user, and which ViewObject is creating them. The idea is to make some kind of monitor that shows that, the AM that each user has, an the state of their VOs.
    I used the JSP in this page as a reference:
    http://radio.weblogs.com/0118231/stories/2004/05/10/gettingApplicationModulePoolStatisticsToAidWithSizeTuning.html
    I´m not trying to create a new AM management mechanism, simply a tool that shows the status of the application (and perhaps allows me, for instance, to clear the cache of a VO that has to many rows fetched).
    In my JSP I obtain an instance of the AMs using "pool.getInstance(i)", and access then the associated VOs. But I don´t know if accesing the AMs this way could create problems with users that have an AM assigned to them, for example, a deadlock.
    Thanks!

  • Executing code modules (seperate jars) from main program (main.jar)

    Hi all
    Sorry if i am crossposting, but i dont think that is the case.
    I have a main program ( in a jar ) and some modules to be executed and run in the main program.
    Theese components are packed a module in a single jar, and all theese jars are located in the same folder as the main program.
    The main classes in the module jars implement a interface known to the main tool, so that i can use them.
    My problem are, how to load the modules?
    I know i can use JarFile to get the manifests, and thereby get the name of the main class in each jar (they get obfuscated before launch, so no hardcoding of names).
    But how do i instanciate the mainclasses in the modules from the main tool ?
    hope you can help out.
    -Anders

    You can't. I understand the module approach as many others have similar designs. The first problem is that you need to add all the JARs to your classpath so that these JARs are known during starttime. There is no other solution to this if you don't write your own classloader that fetches classes during runtime and work peacefully with the other classloaders of the VM (it's a pain in the ass!). So, your main application needs to know the JAR files. Then it's a small step to also register the modules that your main app should know. Our approach is to have a small database table that holds the fully referenced class names of the modules that are available and can be used via Class.forName(). With this solution, we just need to stop the main app, copy the new JAR, adjust the classpath to add the new JAR, and restart the main app. After adding the new module names to the config table, the main app automatically uses them. Instead of a database table you can use e.g. a properties file.

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

  • 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

  • Problem with application modules and switching from 2 tier to 3 tier mode

    Hello,
    I've got an application in 2 tier mode. Now I wanted to switch to 3 tier mode but get a class cast exception. It has turned out, that panelBinding.getApplication().getApplicationModule().findApplicationModule returns in 2 tier mode <ModuleName>Impl and in 3 tier mode oracle.jbo.client.remote.ApplicationModuleImpl. But searching for modul name with panelBinding.getApplication().getApplicationModule().getApplicationModuleNames() returns the right in names in 2 tier and in 3 tier mode. Does anybody know a way to access <ModulName>Impl in 3 tier mode?

    This is the reason that the BC4J project will create an <appmodulename>AM interface and a <appmodulename>AMClient Implementation that you include on the client side if you expose any methods in your app module. You should access them by casting it to the interface, NOT the appModuleImpl class. If you stick to using the interface, then you should be fine.
    So to keep your implementation flexible, you should do this on the client to access your custom methods on your app module:
    The BC4J project should generate the following classes:
    AppModule Name = MyCustomAM.xml
    AppModule Implementation = MyCustomAMImpl.java
    Custom AppModule Interface = /common/MyCustomAM.java
    Custom clientside AppModule Implementation = /client/MyCustomAMClient.java
    On the client, do the following:
    import my.bc4j.model.package.common.MyCustomAM;
    // Call custom method on App module
      MyCustomAM am = (MyCustomAM) panelBinding.getDataControl().getApplicationModule();
      am.myCustomMethod(someParams);Hope this helps.
    Erik

  • Executing a main class automatically from windows

    Hello, I was thinking in a way I could have a java class with a main method inside a pen-drive, then another stuff in windows to recognize when the pen-drive is connected to the usb port and execute automatically the main class inside the pen-drive. What shoud I study in order to do that?
    Thanks

    You should learn how to write the "autorun.inf" files
    see in a CD which has a autorun in it you will find a file with above name
    It works for many forms of drives, Eventthough i havent tried I think it should work for flash drives as well

  • Displaying an application item's value from a page template

    Hello,
    I have an application item 'F50_TEST' and I need to display its value on every page that's using a specific page template. I think I can access data like the APP_USER by using #APP_USER# in the template, but can I access application items that way?
    Thank you,
    Pavel

    Hello,
    In your template, you can use '&F50_TEST.' (notice the trailing dot) to display the value .
    Regards,
    Arie.

Maybe you are looking for

  • Process chain not continue after successful node

    Hi gurus,    In my process chain I load data from R/3 to PSA and then execute DTP to DSO, all actions are serially. Usually our PC is running well. But recently the PC will stop after the loading to PSA was successfully end , which means in the log v

  • Pre Checks before running Data Pump Export/Import

    Hi, Oracle :-11.2 OS:- Windows Kindly share the pre-checks required for data pump export and import which should be followed by a DBA. Thanks

  • Macbook Pro cannot start properly after Yosemite v10.10.3 update

    Hello, I have a serious concern with my MacBook pro 13Inch Retina. After the recent update to Yosemite v10.10.3 on 18 April, whenever I start my Mac book, the Apple icon will not show up immediately as usual just black page. It only appear after I pr

  • Play Back Issues

    Ok guys I recently downloaded the trial because I'm thinking of getting on the cloud.  1st off I built my own system its pretty sturdy. Supermicro X9DAX-IF board its dual cpu 2 xeon e5 2630's v2 ivy bridge 84 gb of ram kingston hyperX Nvidia Quadro K

  • Download Premiere Elements 12

    I bought Premiere Elements 12 a few months ago and recently opened it to install on my laptop, problem is my laptop doesn't have a CD drive. How can I download Premiere Elements 12 without a CD drive?