Webservice initialized on every method-call.

Hello!
I have written two webservices. One containing a EJB and a SOAP-Webservice and one with just a SOAP-Webservice.
If I call the EJB-Version the webservice gets inizialized by glassfish on the first call and then stays running (Constructor is not called any more) but if I call the SOAP-only service constructor is called on every method-call.
Therefore I have a deployment-problem with the EJB-Version: I use SQL-Server-JDBC-Libs in my Netbeans-Project. The get deployed to the server but are not used by the application. Instead I have to copy them to the servers lib-directory. If I deploy them with my Soap-only-service they work...

For the Webservice-only I create a web-application in Netbeans (File - New Project - Java Web - Web Application) and run this code:
package com.service;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService(serviceName = "Service")
public class Service {
    public Service() {
        System.out.println("Constructor called!");
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        return "Hello " + txt + " !";
}Everytime i call the hello-method through the Tester (http://ip:port/URI?Tester) the webservice get initialized ("Constructor called").
On the other hand I create a Java EE - EJB-Module in Netbeans and add the webservice.
I remove the EJB-Annotations from the module and use it as a POJO for the code.
EJB:
package com.slan.ejb;
import javax.ejb.Stateless;
@Stateless
public class EJBSlan {
    public EJBSlan(){
        System.out.println("Constructor of EJB called!");
    public String getHello(String name) {
        return "Hello " + name;
}Service:
package com.slan.service;
import com.slan.ejb.EJBSlan;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService(serviceName = "EJBService")
@Stateless()
public class EJBService {
    private EJBSlan ejbRef;
    public EJBService(){
        ejbRef = new EJBSlan();
        System.out.println("Constructor of Service called!");
    @WebMethod(operationName = "getHello")
    public String getHello(@WebParam(name = "name") String name) {
        return ejbRef.getHello(name);
    @WebMethod(operationName = "getMachines")
    public String getMachines() {
        String machines = "";
        try {
            DriverManager.registerDriver(new com.mysql.jdbc.Driver());
            Connection c = DriverManager.getConnection("jdbc:mysql://ip/cm","user","password");
            Statement s = c.createStatement();
            ResultSet r = s.executeQuery("select  from machines");
            while(r.next()){
                machines += r.getString("comment");
            s.close();
            c.close();
        } catch (SQLException e) {
            System.out.println(e.toString());
        return machines;
}As you can see I already tried to add the sql-code to query the database. I added the mysql.jar to the project and deployed it. Using the tester the Service- and POJO-Object gets initialized only once but I cant use the mysql-driver cause it is not used on the server. But it gets deployed to the server... I think it's just not included in the class-path...

Similar Messages

  • Ejbload() on CMP with transaction = supports - why called before every method?

    If an entity bean (CMP v2) has its transaction attrib "supports", why
    when a client (ejb/servlet/jsp) calls its business methods does WLS
    call ejbLoad() before every method call? Note that the calls do not
    occur inside a transaction!
    This is not intuitive to me. I would think that ejbLoad() would be
    called once when the bean is activated and then all business methods would
    access that data.
    Note that if you put the entity bean behind a session bean with a
    transaction attrib "Required", then the ejbLoad() gets called once no
    matter how many business methods are called from the session bean.
    This is (obivously) correct.
    Why is this relevant? The latest java petstore demo essentially calls
    EJBLocal's from jsp (via taglib's) - I guess no different from WLS
    EJB to taglib product - where the fine grained getter methods are
    called. From what I gather, this means that every one of the jsp
    get methods results in a database read! This can't be right!
    What am I missing? As above, if the entity bean has "supports"
    and is called from a jsp, it appears that ejbLoad()/ejbStore()
    would be called for every jsp taglib invocation.
    Glenn

    "Glenn R. Kronschnabl" wrote:
    Rob,
    Thanks for your reply. This implies that even EJBLocals with fine
    grained getter methods should never be used outside a tx scope.Yes, unless you are using Read-Only entity beans which cache data for longer
    periods of time.
    Even
    though you bypass the RMI semantics, you'll be killed by the local tx.
    Which to me says that using EJB's from JSP (even via tags) is a bad
    idea because each getter method will result in a database read/write,
    (unless you go with a readonly EJB as you stated).
    Accessing transactional entity beans via tags is probably a bit off. You
    could start the tx in the JSP or the tag library, but I don't really like
    that pattern much. I prefer making the tags more coarse-grained and having
    the tags talk to a stateless session bean which in turn talks to the entity
    beans.
    >
    Unfortunately, I've been seeing some threads on the net advocating
    using EJBLocals with tx=supports because one of the most common
    patterns has session beans (where you can specify your desired tx)
    in front of entity beans (so you're set methods are protected via
    the session bean tx),RIght, I think Required or Mandatory is a better choice for the entity beans
    here.
    but then you can use the EJBLocal (via tags)
    on a JSP page (no tx) to view the data via fine grained getter
    methods.Other than the performance issues, I dislike this because it exposes the
    entity bean directly to the JSP. If I have to go through an interface (the
    session bean) to access the entity bean, then I shouldn't have another route
    to access the entity bean directly.
    -- Rob
    >
    As you state, this is a disaster because each getter method
    will run in a local tx, requiring a database read/write. Oouch!
    Glenn
    On Thu, 06 Dec 2001 17:08:07 -0600, Rob Woollen wrote:
    First off, I wouldn't recommend that you ever run any EJB with the
    'supports' transaction attribute. If you want transactional behavior
    use Required, RequiresNew, or Mandatory. If you want to run in an
    unspecified tx, use NotSupported or Never.
    WLS runs entity beans with an unspecified tx in their own local tx.
    That's why you see the reads and writes on the method call boundary.
    Your scheme of only reading when the bean is activated could make the
    bean's data out of sync with the underlying database. That's acceptable
    in many cases, and that's why we have the Read-Only entity bean option.
    It gives you exactly what you'd like.
    -- Rob
    "Glenn R. Kronschnabl" wrote:
    If an entity bean (CMP v2) has its transaction attrib "supports", why
    when a client (ejb/servlet/jsp) calls its business methods does WLS
    call ejbLoad() before every method call? Note that the calls do
    not occur inside a transaction!
    This is not intuitive to me. I would think that ejbLoad() would be
    called once when the bean is activated and then all business methods
    would access that data.
    Note that if you put the entity bean behind a session bean with a
    transaction attrib "Required", then the ejbLoad() gets called once no
    matter how many business methods are called from the session bean. This
    is (obivously) correct.
    Why is this relevant? The latest java petstore demo essentially calls
    EJBLocal's from jsp (via taglib's) - I guess no different from WLS EJB
    to taglib product - where the fine grained getter methods are called.
    From what I gather, this means that every one of the jsp get methods
    results in a database read! This can't be right! What am I missing? As
    above, if the entity bean has "supports" and is called from a jsp, it
    appears that ejbLoad()/ejbStore() would be called for every jsp taglib
    invocation.
    Glenn
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com
    [att1.html]

  • Piggy back values with every method invocation

    Hi,
    I have a setup where , many of my application users are mapped to
    Realm Users of WLS.
    I do the initial mapping of Application users to RealmUsers
    (example: harish --> joeuser and scott --> joeuser) and
    create a InitialContext using "joeuser", when "harish" logs in.
    All further accesses ( lookup etc.. ) on the EJB's are made using the
    InitialContext created using "joeuser" .
    ("harish" does not exist in the WLS realm).
    Now, when I call a EJB , I need to know at the EJB end that
    the user is actually "harish" ...so that I cud use this information
    for
    logging purposes..
    Is there any way of sending this information("harish") , "piggyback"
    with every request ?
    NOTE: I do not want to include a applicationuser parameter to every
    method call.
    Am using WLS 6.1 SP2.
    Any info will be highly appreciated.
    Thanks
    Harish

    Hi
    u can create a static startup class which will read the mappings from a
    XML file in a static block and all apps can query this static class for
    getting the external or internal user id.
    thanx
    ssk
    Harish Murthy wrote:
    Hi,
    I have a setup where , many of my application users are mapped to
    Realm Users of WLS.
    I do the initial mapping of Application users to RealmUsers
    (example: harish --> joeuser and scott --> joeuser) and
    create a InitialContext using "joeuser", when "harish" logs in.
    All further accesses ( lookup etc.. ) on the EJB's are made using the
    InitialContext created using "joeuser" .
    ("harish" does not exist in the WLS realm).
    Now, when I call a EJB , I need to know at the EJB end that
    the user is actually "harish" ...so that I cud use this information
    for
    logging purposes..
    Is there any way of sending this information("harish") , "piggyback"
    with every request ?
    NOTE: I do not want to include a applicationuser parameter to every
    method call.
    Am using WLS 6.1 SP2.
    Any info will be highly appreciated.
    Thanks
    Harish

  • How to print a method trace to a file (first method called to the end)

    I have a tomcat war that I am deploying. I want to use some command line parameter or some tool that will show me a method trace of each method that gets executed.
    There is some static initializer in the code that starts everything in the war (the war is not a web app) but simply a process that runs in the background that does stuff.
    I want to find out what the first method called in the war is and to locate the static initializer. Having a method trace would do this because this method would be printed out first.
    After the static initializer gets called I want to see a method trace of all methods called. Having this printed to a file like Class:Method(params) would be nice.
    Even better would be some sort of tool that I could open a trace file with and see method calls in the order they were called.
    I tried several Java profiling tools but none of them show me the order (first to last) of the methods called. All I need is to see a method trace from beginning to end.
    Any help would be appreciated.

    JProbe provided almost everything I needed to see a method call trace. The method graph feature was great.
    I have a single static class with a static initializer that runs in a loop but did not know what the class name was (I inherited some code and was told about the static initializer).
    So when I fired it up in JProbe it showed me the class running off the root thread. In fact I found another static initializer that was unknown to me and another oddity as well.
    The only problem is that the method call graph is collapsed and you need to click [+] to expand every method call.
    I am told by JProbe support that there was an "expand all" option in JProbe 7.0 but it is not there in 7.1.
    Not sure why they took the time, money and energy to take a needed feature out.
    It would be great to have something that did the same thing from the command line or to be able to print a method call trace out to a file but not sure how to do this.

  • ADF method call to fetch data from DB before the initiator page loads

    Hello everyone
    I'm developing an application using Oracle BPM 11.1.1.6.0 and JDeveloper 11.1.1.6.0
    I want to fetch some data from the database before the initiator task, so that when the user clicks on the process name, his/her history will be shown to them before proceeding.
    It was possible to have a service task before the initiator task in JDeveloper 11.1.1.5.0, but I have moved to 11.1.1.6.0 and it clearly mentions this to be an illegal way.
    I came across this thread which suggested to do this using an ADF method call, but I don't know how since I'm new to ADF.
    Re: Using Service Task Activity before Initiator Task issue
    Can anyone show me the way?
    Thanks in advance

    Thanks Sudipto
    I checked that article however I think I might be able to do what I want using ADF BC.
    See, what I'm trying to do is to get a record from a database and show it to the user on the initiator UI.
    I have been able to work with ADF BC and View Objects to get all the rows and show them to the user in a table.
    However, when I try to run the same query in the parameterized form to just return a single row, I hit a wall.
    In short, My problem is like this:
    I have an Application Module which has an entity object and a view object.
    My database is SQL Server 2008.
    when I try to create a new read only view object to return a single row I face the problem.
    The query I have in the query section of my View Object is like this:
    select *
    from dbo.Employee
    where EmployeeCode= 99which works fine.
    However when I define a bind variable, input_code for example, and change the query to the following it won't validate.
    select *
    from dbo.Employee
    where EmployeeCode= :input_codeIt just keeps saying incorrect syntax near ":" I don't know if this has to do with my DB not being Oracle or I'm doing something wrong.
    Can you help me with this problem please?
    thanks again
    bye

  • ADF Mobile: WebService data control method call with array

    JDev 11.1.2.3
    ADF Mobile deployed to Android emulator
    Hello All,
    I am trying to invoke a method in my Web Service data control and get the following exception
    Caused by: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - Cannot serialize: [I@1dbae822
            at oracle.adfmf.dc.ws.soap.SoapTransportLayer.invokeSoapRequest(Lorg/ksoap2/SoapEnvelope;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Loracle/adfmf/dc/ws/soap/SoapGenericType;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.JavaBeanOperation.execute(Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.WebServiceDataControlAdapter.invokeOperation(Ljava/util/Map;Loracle/adfmf/bindings/OperationBinding;)Z(Unknown Source)
            at oracle.adfmf.bindings.dbf.AmxMethodActionBinding.execute()Ljava/lang/Object;(Unknown Source) This method is an AppModule method exposed as a service interface and the parameter for this method is a List<oracle.jbo.domain.Number>. The schema definition for the input is as follows:
    <element name="acceptTask">
       <complexType>
         <sequence>
                <element maxOccurs="unbounded" minOccurs="0" name="taskID" type="decimal"/>
         </sequence>
       </complexType>
    </element>For the input to my binding, I have tried int[], Integer[] and List<Integer>. All of these result in similar errors.
    I have also tried invoking this through a regular ADF application and that works fine with an int[]. It looks like something specific to the ADF Mobile SOAP layer.
    Is this a bug or a restriction in the framework? Any workarounds that has worked for anyone?

    No luck. A WS DC method call with a simple parameter (java.lang.String or java.lang.Integer) works fine but I can't get it to work when there is an array input.
    I have tried WS methods with int arrays and simple string arrays without any luck. All of them result in a cannot serialize error.
    I can't figure out what I am doing wrong. Are there any working WS Datacontrol samples with array inputs?

  • AcquireConnection method call to the connection manager Excel connection Manager failed

    I used VS Studio 2008 (BIDS version 10.50.2500.0) on an WinXp machine (v 5.1.2600 SP3 Build 2600) to create a package that writes multiple query results to different tabbed sheets of a single excel spreadsheet. The package was working just fine and has run
    successfully multiple times, but all of a sudden when opening the project, every single Data Flow task with an Excel Connection Manager displayed error icons. Each raises the following error message when attempting to open the Advanced Editor:
    SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005 Description: "Unspecified error". Error at DataFlow task name: SSIS error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method
    call to the connection manager Excel connection Manager failed with error code 0xC0202009. There may be error messages posted before this with more information on why the Acquire Connection method call failed. Exception from HRESULT: 0Xc020801c (Microsoft.SQlServer.DTSPipelineWrap)
    From the time I created the original package (when it worked fine) until now:
     1) I have been using the same computer, the same login account and the same permissions.
     2) I have been writing to the same (32 bit) 2010 Excel file (which I created) in a folder on my local machine.
     3) The filename and location have not changed; a template file is used each time to move and overwrite the previous file. Both are in the same locations.
     4) I can independently open the target Excel file and the template Excel files with no errors.
     6) The ConnectionString has not changed. The Connnection String I am using is
      Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Conversion\Conversion\Results_dt01.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES;".
     7) Run64BitRuntime is set to False.
    8)  Delay Validation is set to true
    9) This is not running under a SQL job  
    10) There are no child packages being run
    I CAN create a NEW Excel Connection Manager, assigning it the exact same target Excel spreadsheet, successfully, but when I attempt to assign it to the Data Flow destination this error occurs:
    "Test connection failed because of an error in initializing provider. Unspecified error."
    Thinking that the driver might be corrupt, I opened a second SSIS package, which also uses the Excel Connection Manager (same driver) and this package continues to work fine on the same workstation with no errors.
    I have searched online for causes of this error for many hours and found nothing that helps me to solve this issue.
    Does anyone have any suggestions for me?

    Yes, I have verified that the Excel file is not in use or opened by anyone, including me. It has been two months since I opened this particular package, although I have been working with other packages in this project. I just discovered that another
    package in the same project has the same problem - all Data Flows that output to an Excel Destination now have the same error icons. This second packages outputs to an entirely different Excel file than in the first package.  A summay:
    Package #1 has error on every Excel Destination and uses templateA to overwrite fileA and then writes to fileA
    Package #2 has error on every Excel Desintation and uses templateB to overwrite fileB and then writes to fileB
    Package #3 has no error on any Excel Destination and is linked to multiple files (none are A or B)
    Package #1 and #2 are in the same project, but Package #3 is in a separate project .
    I will try replacing the Excel files with new ones for Package 1 and 2.

  • Taskflow Method call receiving null parameter.

    Hi all,
    I am using 11.1.1.6. I have created in my application an extra project which is pure Java objects and exposed a master class as a POJO DC. In my application, I have a taskflow where I have dragged and dropped one method from my POJO DC - 2 of the parameters of this methods are coming from an application scope bean. I have debugged the application, and made sure that the object being returned by the getter of my app scope bean is not null. So basically, when the breakpoint is in the return statement of my getter the oject is not null and it has been correctly initialized. Just after that, the next breakpoint is in the class receiving the parameter in my POJO DC class. In there, the object is NULL.
    Does anyone knows wat could be the reason??

    Hi Frank Nimphius-Oracle,
    That is precisely the problem.  The object is being passed as to the taskflow as an input parameter (getting it from my application scope bean). If I access the pageFlowScope inside my taskflow I see it and its there, correctely intialized. However, when I call a method call activity that consumes that object as parameter, all what it gets is null.
    The method that consumes this object is in a separate project, and its exposed in a POJO DC. I don't know if it has to be with the complexity of the object I am passing or what but I don't understand why its not being passed correctly to the DC Method.

  • Preventing hang on a method call in doGet ()

    Hi,
    I have the following problem.
    Inside the doGet() method, I have a method call X which may take a long time or hand, what it does is do some calculations and return a object Obj. Then I can send this Obj back to client.
    My question is how can i set a Timeout, say 20 seconds. If the method can be finished within 20 sec, then I just let it keep going. It X takes more than 20 seconds, before X finish (or maybe it never finish) I will set a error message into Obj then sent it back to client.
    Can anybody help me with some sample code or suggestion?
    Any input will be appreciated.

    Thanks, @Sujoy.
    According to your suggestion, each expensive method will take AT LEAST the specified wait miliseconds to finish.
    My solution was to start a timer thread before call the method, after the X number of miliseconds, the thread will check the return object from the method. but the problem is the thread has no way to access to the local varialbe inside the method. If you make the variable outside the doGet, which is an instance variable, every request thread will be capable of changing it, which is not acceptable.
    Any better idea? thanks!

  • 11g Task flow - Method call with router Issue

    Hi, I am using bounded task flow method call - which is default activity. The outcome of method call will go to a router and that decides which method/page fragment has to be selected. But when ever i try to call the default activity only the default out come of the router (Page fragment) is shown in the jspx. When click on some button which is binded with the default activity - the task flow is not working as i expected. Pls find the code of my task flow below.
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
    <task-flow-definition id="methodcall2task-flow-definition">
    <default-activity>initiatetaskflow</default-activity>
    <data-control-scope>
    <shared/>
    </data-control-scope>
    <input-parameter-definition>
    <name>methodname</name>
    <value>#{CompanyBean.methodname}</value>
    </input-parameter-definition>
    <managed-bean>
    <managed-bean-name>CompanyBean</managed-bean-name>
    <managed-bean-class>com.boeing.seds.view.company.CompanyBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <method-call id="initiatetaskflow">
    <method>#{CompanyBean.test}</method>
    <outcome>
    <fixed-outcome>#{CompanyBean.methodname}</fixed-outcome>
    </outcome>
    </method-call>
    <router id="selectMethod">
    <case>
    <expression>#{CompanyBean.methodname eq 'default'}</expression>
    <outcome>default</outcome>
    </case>
    <case>
    <expression>#{CompanyBean.methodname eq 'addcompany'}</expression>
    <outcome>addcompany</outcome>
    </case>
    <case>
    <expression>#{CompanyBean.methodname eq 'gotoAddress'}</expression>
    <outcome>gotoAddress</outcome>
    </case>
    <case>
    <expression>#{CompanyBean.methodname eq 'gotoDist'}</expression>
    <outcome>gotoDist</outcome>
    </case>
    <default-outcome>gotoAddress</default-outcome>
    </router>
    <view id="default">
    <page>/includes/company/default.jsff</page>
    </view>
    <view id="addnewcompanyFrgmt">
    <page>/includes/company/addnewcompanyFrgmt.jsff</page>
    </view>
    <method-call id="methodCall1">
    <method>#{CompanyBean.addCompany}</method>
    <outcome>
    <to-string/>
    </outcome>
    </method-call>
    <view id="supplierAddressFrgmt">
    <page>/includes/company/supplierAddressFrgmt.jsff</page>
    </view>
    <view id="supplierDistributorFrgmt">
    <page>/includes/company/supplierDistributorFrgmt.jsff</page>
    </view>
    <control-flow-rule>
    <from-activity-id>initiatetaskflow</from-activity-id>
    <control-flow-case>
    <from-outcome>#{CompanyBean.methodname}</from-outcome>
    <to-activity-id>selectMethod</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <control-flow-rule>
    <from-activity-id>selectMethod</from-activity-id>
    <control-flow-case>
    <from-outcome>default</from-outcome>
    <to-activity-id>default</to-activity-id>
    </control-flow-case>
    <control-flow-case>
    <from-outcome>addcompany</from-outcome>
    <to-activity-id>methodCall1</to-activity-id>
    </control-flow-case>
    <control-flow-case>
    <from-outcome>gotoAddress</from-outcome>
    <to-activity-id>supplierAddressFrgmt</to-activity-id>
    </control-flow-case>
    <control-flow-case>
    <from-outcome>gotoDist</from-outcome>
    <to-activity-id>supplierDistributorFrgmt</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <control-flow-rule>
    <from-activity-id>methodCall1</from-activity-id>
    <control-flow-case>
    <from-outcome>goAddNew</from-outcome>
    <to-activity-id>addnewcompanyFrgmt</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <use-page-fragments/>
    </task-flow-definition>
    </adfc-config>
    Kindly let me know what may be the issue and help me to resolve it.
    Thanks!
    Sankari Kannan

    Hi Sankari,
    Since after the initial method call, your control flow has the router as its next stop, the //method-call/method/outcome/fixed-outcome can be set to a literal value(go to router) instead of an EL.
    And let router decide where to go next(by EL).
    Or you can discard your router activity, let the method-call activity decide where to go directly by setting //method-call/method/outcome/to-string to "true". Then the return value of the method decide the next stop.
    Todd

  • Method calls in switch and for statements

    I have 2 questions concerning method calls in switch and for statements. Consider these two chunks of code:
    1)
         switch (foo.getIntegerValue()){
              case 1:
              case 2:
         }My question is, is getIntegerValue() being called for every case statement (since it has to compare with each case) or is the method called only once?
    2)
    for (Foo bla : xyz.compileFoos()) {
    }Is compileFoos called once or on every iteration?
    I assume it gets called only once but I would like to be sure. The reason I ask is of course to avoid multiple method calls.
    any help is appreciated

    sdb2 wrote:
    I have 2 questions concerning method calls in switch and for statements. Consider these two chunks of code:
    1)
         switch (foo.getIntegerValue()){
              case 1:
              case 2:
         }My question is, is getIntegerValue() being called for every case statement (since it has to compare with each case) or is the method called only once?
         Once, and the value returned compared to each "case" in turn.
    2)
    for (Foo bla : xyz.compileFoos()) {
    }Is compileFoos called once or on every iteration?
    I assume it gets called only once but I would like to be sure. The reason I ask is of course to avoid multiple method calls.
    any help is appreciatedAlso once, and the returned list/set/array is iterated over.

  • Passing input parameters to the method call in ADF task flow.

    Hi,
    I have the following use case:
    There is a task flow with 2 jspx pages. In the first page I have 2 input search parameters and search button. the search button calls the webservice data control execute (GET_ACCOUNTOperation) method .
    Displaying the search results in the same page is not a problem , but my requirement is that the search results are to be displayed in the second page in tabular form.
    To achieve this, I dragged the execute method as the method call in the task flow and specified the input parameters for the method call (right click and add parameters) . I am getting the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.lang.String, java.lang.String)
         at com.sun.el.util.ReflectionUtil.getMethod(Unknown Source)
         at com.sun.el.parser.AstValue.getMethodInfo(Unknown Source)
         at com.sun.el.MethodExpressionImpl.getMethodInfo(Unknown Source)
         at oracle.adf.controller.internal.util.ELInterfaceImpl.getReturnType(ELInterfaceImpl.java:214)
         at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:135)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1035)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:921)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:820)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:552)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:148)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
         at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:43)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    even though the execute method is there and the service is up and running. I am not sure whether its the correct way of doing it. Please shed some light on how to solve this use case
    Some additional info:
    Under the data controls pallete, the GET_ACCOUNTOperation method has a parameters section , which has "part" (java.lang.Object) as
    the input parameter.
    Regards,
    Rampal

    Hi,
    thanks for the quick turn-around. Jdev version that i am using is Studio Edition Version 11.1.1.6.0. And i am using SOAP. Isnt there a way without using a backing bean? I am planning to use it as a portlet. Would'nt creating a backing bean cause a problem in that case?? Also i am confused here . The method that i am dragging is GET_ACCOUNTOperation(Object). I tried passing the hashmap . It gave the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.util.HashMap)
    Rampal

  • Dynamic method calls in bounded task flows?

    Hi!
    I have the following scenario:
    We are developing a framework in which we would include modules as ADF libraries (as JAR files) with bounded task flows. This framework contains a bean class with bindings for some UI components in framework which I enable or disable (depends on user action). That is the main reason bean class should be present in framework application.
    I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component.
    How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods? That is dynamic method calls for bean.
    I'm using JDeveloper 11.1.2.1.0
    Thanks for your help
    Regards, Marko

    Hi,
    I explained this; +"I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component. How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods?"+ a couple of times already (not sure if it was all for you) and don't think I change my position here. I also explained how to use a ValueExpression to lookp a managed bean containing component bindings (should be in requestscope).
    Frank

  • Clarification on application method calls from backing bean.

    Hi Experts ,
    In our application we are using two different ways to call application module methods from backing bean.
    allication module method name : addRowValidUnitInfo
    it has 2 parameters serialNumber,modelNumber
    1.
    BindingContainer bindings1 =
    BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding serialModelDetails =
    bindings1.getOperationBinding("addRowValidUnitInfo");
    serialModelDetails.getParamsMap().put("serialNumber",
    serialNumber.getValue().toString());
    serialModelDetails.getParamsMap().put("modelNumber",
    modelNumber.getValue().toString());
    serialModelDetails.execute();
    String result =serialModelDetails.getResult().toString();
    2.
    EWarrantyAdminModule appModule =(EWarrantyAdminModule)
    Configuration.createRootApplicationModule(amDef,config);
    try {
    String result = appModule.addRowValidUnitInfo(serialNumber.getValue().toString(), modelNumber.getValue().toString());
    } catch (Exception e) {
    finally {
    Configuration.releaseRootApplicationModule(appModule,true);
    Can any one tell me which one gives best performance and which one should be used in which situations.
    For me both are working fine but just want to know whcih is the best practice and which gives best performance.
    Regards
    Gayaz

    The approach 1 is the right way.
    Reasons:
    1) With Approach 2 - you are creating new ApplicationModule on the fly and release it at the end of the request. If you are invoking multiple method calls, you need to the same for each & every call.
    This is not reusing the existing application module.
    2) If the use cases which does calls for maintaining state across requests from the same client - across the application flow, Approach 2 cannot be used.
    Read this blog post from Jobinesh (which indirectly distinguishes both these approaches).
    http://jobinesh.blogspot.com/2010/04/invoking-applicationmodule-from-servlet.html
    Thanks,
    Navaneeth

  • Show return value of a method-call within a column of ADF table component

    Hi,
    I'm currently developing a ADF "Master Form - Detail Table" component, which displays trips of a car in master form, and all related trip-point information in detail table. This detail table contains the following fields within a row :
    - idTripPoint
    - receivedAt
    - speed
    - coordinates
    Everything is displayed well when deploying my app. What I now want to implement is one more column into my detail table, which displays the result of a method-call which gets the coordinates of the corresponding tripPoint and executes a query to find the nearest neighbour to this point. This method afterwards returns a string which contains a textual description for the coordinates (e.g. 10 km south of Hilton Plaza). This method is defined within my SessionBean and also available within the Data Control Palette.
    What I first did, was just to drag the result (String) of my getTripPointDescription(JGeometry) method to a newly created column within my details table, released it there and set the corresponding NDValue for my method. I used the id of my details table table definition in PageDef for that (${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}). I don't know if this is correct.
    When deploying my app, nothing happened, because my method has never been called. So I decided to implement an invokeAction within my PageDef which calls the generated methodAction within PageDef.
    It looks like that now:
    <executables>
    <invokeAction id="callDescription" Binds="getTripPointDescription"
    Refresh="prepareModel"/>
    </executables>
    <bindings>
    <methodAction id="getTripPointDescription"
    InstanceName="TripsEJBFacadeLocal.dataProvider"
    DataControl="TripsEJBFacadeLocal"
    MethodName="getTripPointDescription"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"
    ReturnName="TripsEJBFacadeLocal.methodResults.TripsEJBFacadeLocal_dataProvider_getTripPointDescription_result">
    <NamedData NDName="tripPoint"
    NDValue="${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}"
    NDType="oracle.spatial.geometry.JGeometry"/>
    </methodAction>
    </bindings>
    Now my method is called once for the coordinates of the first row of my detail table and the generated result is entered within each row.
    So how is it possible to get this standard-behaviour (within other application-frameworks) work in ADF? I just want to display a textual description of a coordinate instead of x/y coordinates within my table. And the corresponding method to get this textual description based on the x/y coordinate should be called for each row displayed in my table.
    I currently walked through all ADF-tutorials and blogs I found on the Internet, but every table example I found only displays data of the associated Entity-Bean. And method Action and accessorIterator are only used with command objects.
    Thank you,
    Thomas

    Sorry, I forgot to say which technologies I use:
    - Toplink Essentials JPA for Model layer (EJB 3.0)
    - ADF in View Layer
    I still hope someone can help me finding an answer.
    Bets Regards,
    Thomas

Maybe you are looking for

  • Multiple signatures in a PDF - without invalidating the previous ones

    Hello dear forum I have created a PDF form with several fields (with LiveCycle Designer 8.0). This form should be signed by two different people, thus I have set up two signature fields. However, when the second guy signs, the first siganture becomes

  • Error 205 installing Creative Cloud on windows 7

    Looked through the log. It says "Failure to download segment" so I repeatedly download the installer. Same thing. WTH?

  • Problem installing PhotoshopElements_12_WWEFDJ.dmg

    Photoshop Elements Experts, After encountering problem installing Photoshop Elements 12 from the CD onto Windows 8.1 (it wanted DirectPlay, which has been depricated from Win 8.1), I posted the problem.  Sandeep Singh responded and told me to try ins

  • TRANSFORM DATA TO XML SCHEMAS

    Greetings to all Members, I write in the forum because my desperation is increasing because of an issue / problem I'm having with DataServices. On the client where I am, DataServices have installed 4.0 and now I need to do a Real-Time Job. I know tha

  • Assigned ringtones won't play

    For several weeks now all my contacts with assigned ringtones (both those that came with the phone and those that I bought) won't play. Even though the contact shows an assigned ringtone, the default actually plays. I re-synched the phone and turned