Passing connection object as EJB parameter

I am working on a legacy website which uses stateless session EJB's and runs on
WebLogic 6.1 using JDK 1.3 and Oracle 8.1.6, I am working on upgrading this
application to WebLogic 9.2, JDK 1.5 and Oracle 10.2.
I configured a datasource in WebLogic using the Oracle thin XA driver.
When attempting to run the application I got an error message stating that an
object which is not serializable is being passed as an EJB parameter. I found that
several EJB methods are passing open database connections as parameters so to fix this
issue we should change the code. However, I am reluctant to change the code since I
believe that the reason for passing the connection objects is that the developers
wished to preserve transactions and so any changes might result in many issues in
the application. I have the following questions:
- The code is doing something which is not allowed. So why was this okay in WebLogic
6.1 using the older Oracle oci driver?
- One way to get around this would be to convert the EJB's to POJOS. There are no
container based properties and the only EJB's are stateless session EJB's. The
high water mark for concurrant usage is 40. There is only a single server (no clustering)
What kind of issues would such a
conversion bring?
- Would it be better to convert the EJB's to local interfaces? What kind of issues would
this bring?
Any other suggestions would be very much appreciated.

Salma Saad wrote:
Thanks Joe,
Converting to POPJOS from EJB or to local EJB's is changing the code but it limits changes to the logic of the application which could result in unforseen issues.
There is only 1 server and 1 jvm but I get a not serlializable exception which I did not get when running this code on WebLogic 6.2 or 8.1 using Oracle 8.1.6 and 9i .I am getting it now that I am using WL 9.2 and Oracle 10.2.
I looked through all the parameters and everything is a string except for Connection which does not implement serializable. There is a Vector but all the contained objects are strings. Let me know if you have any ideas what I can do to get rid of this, and also why is it happenning in the newer version of WL when it didn't happen before?
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****
     at weblogic.rmi.internal.CBVWrapper.copy(CBVWrapper.java:57)
     at com.isr.applications.isrinteractive.ejb.sessionbean.user.UserBean_x07h56_EOImpl_CBV.validateLogin(Unknown Source)
     at jsp_servlet._admin.__validatelogin._jspService(__validatelogin.java:187)
     at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)Hi. I looked at the code throwing this exception, and
it's in a whole 'nother area of the server, nothing to
do with JDBC or EJBs as such. It's odd too, because it
seems to have already verified that whatever object
it's dealing with is a serializable object...
I recommend you're opening an official support case
about this exception, and maybe they'll want help
reproducing it...
Joe
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
     at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:391)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
     at com.isr.applications.isrinteractive.servlets.reports.SessionFilter.doFilter(Unknown Source)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3212)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.io.NotSerializableException: java.lang.Object
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
     at weblogic.rmi.extensions.server.CBVOutputStream.writeObject(CBVOutputStream.java:84)
     at weblogic.rmi.internal.CBVWrapper.copy(CBVWrapper.java:49)
     ... 20 more

Similar Messages

  • How to pass an object as a parameter

    how do you pass an object as a parameter? (what type should it be ?)

    Well you can use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html]String
    Or you can take a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Double.html]Double
    And you can pass [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Event.html]Events
    and get yourself in trouble
    and you can use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Frame.html]Frame
    or maybe take a [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html]List
    but some will use [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html]Collection
    depends you your direction
    so if you need to know
    if you should use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html]Map
    then this is what to do
    just browse the [url http://java.sun.com/j2se/1.4.2/docs/api/]API

  • How to pass class object  as in parameter in call to pl/sql procedure ?

    hi,
    i have to call pl/sql proecedure through java. In pl/sql procedure as "In" parameter i have created "user defined record type" and i am passing class object as "In" parameter in call to pl/sql procedure. but it is giving error.
    so, anyone can please tell me how i can pass class object as "In" parameter in call to pl/sql procedure ?
    its urgent ...
    pls help me...

    793059 wrote:
    I want to pass a cursor to a procedure as IN parameter.You can use the PL/SQL type called sys_refcursor - and open a ref cursor and pass that to the procedure as input parameter.
    Note that the SQL projection of the cursor is unknown at compilation time - and thus cannot be checked. As this checking only happens at run-time, you may get errors attempting to fetch columns from the ref cursor that does not exist in its projection.
    You also need to ask yourself whether this approach is a logical and robust one - it usually is not. The typical cursor processing template in PL/SQL looks as follows:
    begin
      open cursorVariable;
      loop
        fetch cursorVariable bulk collect into bufferVariable limit MAX_ROWS_FETCH;
        for i in 1..bufferVariable.Count
        loop
          MyProcedure( buffer(i) );   --// <-- Pass a row structure to your procedure and not a cursor
        end loop;
        ..etc..
        exit when cursorVariable%not_found;
      end loop;
      close cursorVariable;
    end;

  • Default Connection Object in EJB

    When we use default connection to get a connection to the oracle database through a deployed EJB, it uses the internal driver or in short it returns the same connection object. Is this connection object synchronized and thread safe. I mean if multiple people access this EJB at once, will it be fine or will the connection crash or some exception is thrown.

    Either pass them as parameters or make them into member variables.

  • Connection Object as a parameter !

    I have got a jdbc connection object. Is it a good practice to send the connection object as parameter to a method??

    yes..really it is good practice to send as parameter...i too use this way

  • How to pass an object as method parameter

    Hi Guys
    I was testing a simple program and was trying to pass an object to a method but it didnt seem to work and I couldnt find out WHY.
    I am posting the code so please let me know who can i make my method ADD_EMPLOYEE work so that when i pass an object of LCL_EMPLOYEE, it updates I_EMPLOYEE_LIST.
    *& Report:  ZOO_HR_SAMPLE_1
    *& Author:  Avinash Pandey
    *& Date:    25.03.2009
    *& Description: Concepts of OO in ABAP
    REPORT  zoo_hr_sample_1.
    *&       Class LCL_EMPLOYEE
           Local class
    CLASS lcl_employee DEFINITION.
    Public section
      PUBLIC SECTION.
    Data type
        TYPES:
          BEGIN OF t_employee,
            no  TYPE i,
            name TYPE string,
            wage TYPE i,
         END OF t_employee.
    Method
        METHODS:
          constructor
            IMPORTING im_employee_no TYPE i
                      im_employee_name TYPE string
                      im_wage TYPE i,
            add_employee
             IMPORTING im_employee TYPE REF TO lcl_employee,
           display_employee_list,
           display_employee,
           get_no EXPORTING ex_no TYPE i,
           get_name EXPORTING ex_name TYPE string,
           get_wage EXPORTING ex_wage TYPE i.
      Class methods are global for all instances
        CLASS-METHODS: display_no_of_employees.
    Protected section
      PROTECTED SECTION.
      Class data are global for all instances
        CLASS-DATA: g_no_of_employees TYPE i.
        CLASS-DATA: i_employee_list TYPE TABLE OF t_employee.
    Private section
      PRIVATE SECTION.
       CLASS-DATA: i_employee_list TYPE TABLE OF t_employee.
        DATA: g_employee TYPE t_employee.
    ENDCLASS.               "LCL_EMPLOYEE
    *&       Class (Implementation)  LCL_EMPLOYEE
           Text
    CLASS lcl_employee IMPLEMENTATION.
    Class constructor method
      METHOD constructor.
        g_employee-no = im_employee_no.
        g_employee-name = im_employee_name.
        g_employee-wage = im_wage.
        g_no_of_employees = g_no_of_employees + 1.
      ENDMETHOD.                    "constructor
    Method
      METHOD display_employee.
        WRITE:/ 'Employee', g_employee-no, g_employee-name.
      ENDMETHOD.                    "display_employee
    Method
      METHOD get_no.
        ex_no = g_employee-no.
      ENDMETHOD.                    "get_no
    Method
      METHOD get_name.
        ex_name = g_employee-name.
        WRITE: / 'Name is:' , ex_name.
      ENDMETHOD.                    "get_no
    Method
      METHOD get_wage.
        ex_wage = g_employee-wage.
      ENDMETHOD.                    "get_no
    Method
      METHOD add_employee.
      Adds a new employee to the list of employees
        DATA: l_employee TYPE t_employee.
        l_employee-no = im_employee->get_no.
        l_employee-name = im_employee->get_name.
        l_employee-wage = im_employee->get_wage.
        APPEND l_employee TO i_employee_list.
      ENDMETHOD.                    "add_employee
    Method
      METHOD display_employee_list.
      Displays all employees and there wage
        DATA: l_employee TYPE t_employee.
        WRITE: / 'List of Employees'.
        LOOP AT i_employee_list INTO l_employee.
          WRITE: / l_employee-no, l_employee-name, l_employee-wage.
        ENDLOOP.
      ENDMETHOD.                    "display_employee_list
    Class method
      METHOD display_no_of_employees.
        WRITE: / 'Number of employees is:', g_no_of_employees.
      ENDMETHOD.                    "display_no_of_employees
    ENDCLASS.               "LCL_EMPLOYEE
    REPORT
    DATA: g_employee1 TYPE REF TO lcl_employee,
          g_employee2 TYPE REF TO lcl_employee.
    START-OF-SELECTION.
    Create class instances
      CREATE OBJECT g_employee1
        EXPORTING
          im_employee_no   = 1
          im_employee_name = 'John Jones'
          im_wage          = 20000.
      CREATE OBJECT g_employee2
        EXPORTING
          im_employee_no   = 2
          im_employee_name = 'Sally Summer'
          im_wage          = 28000.
    Call methods
      CALL METHOD g_employee1->display_employee.
      CALL METHOD g_employee1->add_employee
        EXPORTING
          im_employee = g_employee1.
      CALL METHOD g_employee1->get_name.
      CALL METHOD g_employee2->display_employee.
      CALL METHOD g_employee2->display_no_of_employees.
    The error I am getting is:
    Field GET_NO/GET_NAME/GET_WAGE is unknown.
    Please help me out on this.
    Thanks a lot you people

    hi.
    The following parts of your program were changed.
    The result is OK?.
    *(1)change
    CLASS lcl_employee DEFINITION.
    Public section
    PUBLIC SECTION.
    display_employee,
    *get_no EXPORTING ex_no TYPE i,
    *get_name EXPORTING ex_name TYPE string,
    *get_wage EXPORTING ex_wage TYPE i.
    get_no returning value(ex_no) TYPE i,
    get_name returning value(ex_name) TYPE string,
    get_wage returning value(ex_wage) TYPE i.
    *(2)change
    CLASS lcl_employee IMPLEMENTATION.
    Method
    METHOD add_employee.
    Adds a new employee to the list of employees
    DATA: l_employee TYPE t_employee.
    *l_employee-no = im_employee->get_no.
    *l_employee-name = im_employee->get_name.
    *l_employee-wage = im_employee->get_wage.
    l_employee-no   = im_employee->get_no( ).
    l_employee-name = im_employee->get_name( ).
    l_employee-wage = im_employee->get_wage( ).
    APPEND l_employee TO i_employee_list.
    ENDMETHOD. "add_employee
    Result List
    Employee          1  John Jones
    Name is: John Jones
    Name is: John Jones
    Employee          2  Sally Summer
    Number of employees is:          2

  • Passing Connection object from web tier to ejb tier

    I am having a multi threaded application where i am creating multiple threads and doing ejb lookup in each thread and there in ejb it is creating a database connection.
    But i wish to pass only a single connection so that total no of free connections will be more.
    i am creating a connection in my web tier and passing it in each thread and then to ejb tier. But i am getting a class cast exception
    java.lang.ClassCastException: com.sun.gjc.spi.ConnectionHolder
         at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(DynamicMethodMarshallerImpl.java:338)
         at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArguments(DynamicMethodMarshallerImpl.java:407)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:157)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
    Please give some insight where i am doing wrong also suggest me a better way to do it.
    TIA
    ~seshu

    Hi Krishendu,
    I think this is a bug in 9.0.2 that is fixed in 9.0.3/9.0.4.
    Can you please contact Oracle support and see whether they can provide a patch for this problem.
    regards
    Debu

  • Passing connecting string as a parameter

    how will be pass a connecting string at runtime as a parameter at parameter from in reports.

    The Excel Add-in method requires you to create a module with the essxlvba.txt custom functions in it. This is located under %HYPERION_HOME%\AnalyticServices\bin\essxlvba.txt. Create a VBA module with this file in it.
    Start by creating sub procedures that connect, refresh data and disconnect.
    Then create a hidden worksheet that lists your member selection list as a range and map your drop-down object to this range.
    Create an On-Click event that passes in the drop-downs selected member to the spreadsheet template’s page area.
    Then call procedures to connect, refresh and disconnect the spreadsheet template.
    This has No-Frills but conceptually it’s the simplest way to do this, I think.
    Brian Chow

  • How to pass an "object" as a parameter in an web services request?

    I am developing a simple web service client and server (using Eclipse for auto code generation). I am able to pass String and Byte array from the client. However, there is a parameter "statusInfo" which is an object of the class "cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo" and I have no idea of how to do so.
    Below is an extract of the wsdl file:
       <xs:element name="SendCertificatesRequest">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="callerID" type="xs:string"/>
          <xs:element name="messageID" type="xs:string" minOccurs="0" maxOc-curs="1"/>
          <xs:element ref="certificateSequence"  minOccurs="0" maxOccurs="1"/>
          <xs:element name="statusInfo">
           <xs:simpleType>
            <xs:restriction base="xs:string">
             <xs:enumeration value="new_cert_available_notification"/>
             <xs:enumeration value="ok_cert_available"/>
             <xs:enumeration value="failure_inner_signature"/>
             <xs:enumeration value="failure_outer_signature"/>
             <xs:enumeration value="failure_syntax"/>
             <xs:enumeration value="failure_request_not_accepted"/>
             <xs:enumeration value="failure_internal_error"/>
            </xs:restriction>
           </xs:simpleType>
          </xs:element>
         </xs:sequence>
        </xs:complexType>
       </xs:element>Below is an extract of the auto-gen SendCertificatesRequest.java file:
       private java.lang.String callerID;
       private java.lang.String messageID;
       private byte[][] certificateSequence;
       private cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo statusInfo;
       public SendCertificatesRequest(
          java.lang.String callerID,
          java.lang.String messageID,
          byte[][] certificateSequence,
          cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo) {
          this.callerID = callerID;
          this.messageID = messageID;
          this.certificateSequence = certificateSequence;
          this.statusInfo = status = statusInfo;
       public void setStatusInfo(cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo) {
          this.statusInfo = statusInfo;
       Below is the auto-gen SendCertificatesRequest.java file:
    * SendCertificatesRequestStatusInfo.java
    * This file was auto-generated from WSDL
    * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
    package cz.unmz.namespaces.csn369791;
    public class SendCertificatesRequestStatusInfo implements java.io.Serializable {
        private java.lang.String _value_;
        private static java.util.HashMap _table_ = new java.util.HashMap();
        // Constructor
        protected SendCertificatesRequestStatusInfo(java.lang.String value) {
            _value_ = value;
            _table_.put(_value_,this);
        public static final java.lang.String _new_cert_available_notification = "new_cert_available_notification";
        public static final java.lang.String _ok_cert_available = "ok_cert_available";
        public static final java.lang.String _failure_inner_signature = "failure_inner_signature";
        public static final java.lang.String _failure_outer_signature = "failure_outer_signature";
        public static final java.lang.String _failure_syntax = "failure_syntax";
        public static final java.lang.String _failure_request_not_accepted = "failure_request_not_accepted";
        public static final java.lang.String _failure_internal_error = "failure_internal_error";
        public static final SendCertificatesRequestStatusInfo new_cert_available_notification = new SendCertificatesRequestStatusInfo(_new_cert_available_notification);
        public static final SendCertificatesRequestStatusInfo ok_cert_available = new SendCertificatesRequestStatusInfo(_ok_cert_available);
        public static final SendCertificatesRequestStatusInfo failure_inner_signature = new SendCertificatesRequestStatusInfo(_failure_inner_signature);
        public static final SendCertificatesRequestStatusInfo failure_outer_signature = new SendCertificatesRequestStatusInfo(_failure_outer_signature);
        public static final SendCertificatesRequestStatusInfo failure_syntax = new SendCertificatesRequestStatusInfo(_failure_syntax);
        public static final SendCertificatesRequestStatusInfo failure_request_not_accepted = new SendCertificatesRequestStatusInfo(_failure_request_not_accepted);
        public static final SendCertificatesRequestStatusInfo failure_internal_error = new SendCertificatesRequestStatusInfo(_failure_internal_error);
        public java.lang.String getValue() { return _value_;}
        public static SendCertificatesRequestStatusInfo fromValue(java.lang.String value)
              throws java.lang.IllegalArgumentException {
            SendCertificatesRequestStatusInfo enumeration = (SendCertificatesRequestStatusInfo)
                _table_.get(value);
            if (enumeration==null) throw new java.lang.IllegalArgumentException();
            return enumeration;
        public static SendCertificatesRequestStatusInfo fromString(java.lang.String value)
              throws java.lang.IllegalArgumentException {
            return fromValue(value);
        public boolean equals(java.lang.Object obj) {return (obj == this);}
        public int hashCode() { return toString().hashCode();}
        public java.lang.String toString() { return _value_;}
        public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
        public static org.apache.axis.encoding.Serializer getSerializer(
               java.lang.String mechType,
               java.lang.Class _javaType, 
               javax.xml.namespace.QName _xmlType) {
            return
              new org.apache.axis.encoding.ser.EnumSerializer(
                _javaType, _xmlType);
        public static org.apache.axis.encoding.Deserializer getDeserializer(
               java.lang.String mechType,
               java.lang.Class _javaType, 
               javax.xml.namespace.QName _xmlType) {
            return
              new org.apache.axis.encoding.ser.EnumDeserializer(
                _javaType, _xmlType);
        // Type metadata
        private static org.apache.axis.description.TypeDesc typeDesc =
            new org.apache.axis.description.TypeDesc(SendCertificatesRequestStatusInfo.class);
        static {
            typeDesc.setXmlType(new javax.xml.namespace.QName("http://namespaces.unmz.cz/csn369791", ">>SendCertificatesRequest>statusInfo"));
         * Return type metadata object
        public static org.apache.axis.description.TypeDesc getTypeDesc() {
            return typeDesc;
    }    In the client (an auto-gen JSP file), Eclipse has generated the following two lines of code:
    cz1unmz1namespaces1csn3697911SendCertificatesRequest_4id.setMessageID(messageID_5idTemp);
    cz1unmz1namespaces1csn3697911SendCertificatesRequest_4id.setMessageID(callerID_6idTemp);    I have also added the following line for the parameter "certificateSequence" (I have already prepared a Bytearray of certificateSequence)
    cz1unmz1namespaces1csn3697911SendCertificatesRequest_4id.setCertificateSequence(certificateSequence);    Can anyone suggest a way of passing the parameter "statusInfo"? Thanks.
    Edited by: stupidtss on Oct 28, 2009 12:32 AM

    You want something like this:
    DECLARE
      lio_success  VARCHAR2( 2000 );
      li_id        NUMBER;
      li_dep_id    NUMBER;
      li_sel_id := NUMBER;
      li_date DATE;
      lo_date DATE;
      lio_return_message xyz_bpe_rec_fn.xyz_bpe_rec_col;
      l_ret xyz;
    BEGIN
      lio_success := 'some value';
      li_id := NULL;     -- or some number
      li_dep_id := NULL; -- or some number
      li_sel_id := NULL; -- or some number
      li_date DATE := sysdate;
      lio_return_message.col1 := somevalue;
      lio_return_message.col2 := somevalue;
      lio_return_message.coln := somevalue;
      l_ret := get_xyz( lio_success
                      , li_id
                      , li_dep_id
                      , li_sel_id
                      , li_date
                      , lo_date
                      , lio_return_message );
    END;
    /

  • Passing JDBC Connection between differents EJB

    Hello,
    we are migrating diferents applications from WLS 4.5.2 to 6.1, some EJBs calls other
    EJBs with an java.sql.Connection as parameters. Is a problem known to use a connection
    which is obtained in other EJB?.
    we have foun a java.sql.SQLException when from the connection we call to preparedStatement
    method form Connection object.
    Thanks for all.

    Well, first you are only supposed to pass Serializable parameters. Second,
    it's better to just let the container manage your connections.
    Bob
    "Manuel Villalta" <[email protected]> wrote in message
    news:3cd920c4$[email protected]..
    >
    >
    >
    Hello,
    we are migrating diferents applications from WLS 4.5.2 to 6.1, some EJBscalls other
    EJBs with an java.sql.Connection as parameters. Is a problem known to usea connection
    which is obtained in other EJB?.
    we have foun a java.sql.SQLException when from the connection we call topreparedStatement
    method form Connection object.
    Thanks for all.

  • Passing object as a parameter to a method while dragging it to UI

    Hi
    I am using webservice datacontrol to invoke "Secured webservice". Dragged a method from datacontrol and dropped it into UI, it passes a object(i.e., SOAHeader object) as input parameter and returns "String" as a output. So, here I have created a java class and passing it as an object to the method. When i deployed the app into Android emulator, while clicking that method as a button, its throwing me an error message *"HTTPStatusCode 500: Server encountered an unexpected condition which prevented it from fulfilling the request"*. I tried to configure debugger to get log for remote deployment, after that the application itself not opening in emulator. Then how can i find the exact reason for this error message?
    Here I got few doubts,
    1) Is this the correct way of passing the object as a method input parameter?
    2) How can i invoke secured web service through "Webservice datacontrol" in ADF Mobile. I searched in google and got a link by andrejus "http://andrejusb.blogspot.be/2012/11/adf-mobile-secured-web-service-access.html", but not understanding about "*adfCredentialStoreKey*", what is it? and how can i use it?. I set the security policies as mentioned, is it enough to invoke the secured webservices without giving username/password?. Bit confused, can anyone please tell me more about accessing secured webservices from webservice datacontrol.
    3) I tried to configure debug option(as mentioned in developer's guide) to get log of remote deployment. I changed *"java.debug.enabled=true"* in cvm.properties. After that configuration, unable to open that mobile app through emulator. What could be the reason?
    Regards
    Raj

    Thank you Shay.. you have posted new demo's regarding this for people like us(Newbies in ADF), awesome :) Please keep continuing.. This demo & Andrejus sample helps me a lot to do sample authentication using "**Remote login server**".
    Small doubt, Is it possible to inject user credentials with webservice request without creating *"regular" web ADF application, securing it, and deploying it on a server* . I read it in mobile document that,
    For secured web services, the user credentials are dynamically injected using ADF Mobile uses Oracle Web Services Manager (OWSM) Lite Mobile ADF Application Agent to create and configure proxies, as well as to request services through the proxies. The user credentials are injected into the OWSM enforcement context when proxies are configured.
    I am new with this OWSM, can you please give me some hints like how to proceed further for implementing authentication using OWSM lite mobile ADF Application Agent.
    Thanks in advance

  • Passing a Vector object as a parameter to a method

    Hi,
    How can I pass a Vector object as a parameter to a method?
      void buttonAdd_actionPerformed(ActionEvent e) {
        Vector studentHobbies = new Vector();
          String[] items = listHobbies.getSelectedItems();
          for (int i=0; i<items.length; i++) {
            studentHobbies.addElement(items);
    newStudent = new Student(Name,StudentNumber,studentHobbies);
    studentenlist.addTo(newStudent);
    So I want to pass the Vector object 'studentHobbies'  to a method.
    Would I do something like this :import java.util.Vector;
    public Student(String Name, int StudentenNumber, Vector studentHobbies){
    this.Name = Name;
    this.StudentNumber = StudentNumber;
    this.studentHobbies = StudentenHobbies;

    yes, thats how you do it.
    maybe you should first try your idea and then ask people questions?
    also, use ArrayList instead of Vector, its better - google as to why if you care.

  • Hoe to pass object as a parameter thru webSerive

    I need to pass Object as a parameter to web service:
    example:
    public calss returnCodes{
    int ret_code;
    String ret_string;
    public retrunCodes(int ret_code, String ret_string){
    this.ret_code = ret_code;
    this.ret_string = ret_string;
    public int getret_code()
    return this.ret_code;
    public String getret_string {
    return this,ret_string
    and other repc holder class to hold returnCodes
    public class retrunCodesHolder implents javax.xml.rpc.Holder
    returnCode value;
    pubic returnCodesHolder(){
    public returnCodesHolder(returnCodes value) {
    this.value = value;
    In Webservice I use returnCodesHolder as parameter.
    WebService getReturnCodesWs I have
    returnCodes retCodes = new returnCodes(04,"Good return code)
    returnCodesHolder retholder = new returnCodesHolder(retCodes)
    return myString;
    When I am calling above webService in servlet I have code:
    org.test.mytest.returnCodesHolder retHolder = new org.test.mytest.returnCodesHolder();
    String result = port.getReturnCodesWs(retHolder);
    How to I access /get values of returnCodes class in my calling servlet?
    I am using Tomcat v 6.0

    I believe (although have never used, so if I'm wrong,
    correct me please!) you can do it with implicit
    dynamic cursors, such as:
    For rec in 'select col1, col2 from table 1 '||lstr
    loop
    Not really:
    michaels>  declare
       lstr   varchar2 (30) := ' where empno = 7788';
    begin
       for rec in 'select * from emp e ' || lstr
       loop
          null;
       end loop;
    end;
    Error at line 1
    ORA-06550: line 5, column 4:
    PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
       . ( * @ % & - + / at mod remainder rem .. <an exponent (**)>
       ||

  • Passing Inner class name as parameter

    Hi,
    How i can pass inner class name as parameter which is used to create object of inner class in the receiving method (class.formane(className))
    Hope somebody can help me.
    Thanks in advance.
    Prem

    No, because an inner class can never have a constructor that doesn't take any arguments.
    Without going through reflection, you always need an instance of the outer class to instantiate the inner class. Internally this instance is passed as a parameter to the inner class's constructor. So to create an instance of an inner class through reflection you need to get the appropriate constructor and call its newInstance method. Here's a complete example:import java.lang.reflect.Constructor;
    class Outer {
        class Inner {
        public static void main(String[] args) throws Exception{
            Class c = Class.forName("Outer$Inner");
            Constructor cnstrctr = c.getDeclaredConstructor(new Class[] {Outer.class});
            Outer o = new Outer();
            Inner i = (Inner) cnstrctr.newInstance(new Object[]{o});
            System.out.println(i);
    }

  • Passivation of Connection Object in Stateful Session Bean

    Hi all,
    I am developing a Stateful session bean that has a Connection object as its instance variable. And this bean starts transaction that spans across multiple method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object to join a Transaction, Do I have to create the connection after the transaction has started?
    2. If the answer to the above question is yes, then: I understand that when this bean get passivated, the UserTransaction instance object would be passivated. And since the connection object can't not be passivated, I have to recreate the connection object in ejbactivate() method, would newly created connection participate in the same Transaction that was being passivated and now activated?

    >
    Hi all,
    I am developing a Stateful session bean that has a
    Connection object as its instance variable. And this
    bean starts transaction that spans across multiple
    method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object
    to join a Transaction, Do I have to create the
    connection after the transaction has started?Strictly NO. In fact, the connection is obtained first and then can a transaction begin.
    2. If the answer to the above question is yes, then: I
    understand that when this bean get passivated, the
    UserTransaction instance object would be passivated.
    And since the connection object can't not be
    passivated, I have to recreate the connection object
    in ejbactivate() method, would newly created
    connection participate in the same Transaction that
    was being passivated and now activated?
    The answer to first question being NO, your argument for question 2 does not hold true. According to the EJB specification, a stateful session bean can only be passivated between the transaction and not within a transaction. Your implementation for the stateful EJB is good to work.

Maybe you are looking for

  • Problem with Image File in Encore CS5

    I made a 6 GB Image File in order to make BluRay discs without having to open Encore each time.  I can't seem to find software that will allow me to use the file to burn the disc.  Simple copy/paste doesn't work either.  The problem may be that the i

  • Problem with comparable generics

    Hi all, I just started using generics and I cannot solve the following issue: Here's the code snippet that gives me all the trouble: public class BinaryLogicalExpression{   private Comparable leftOperand;   private Comparable rightOperand;   public B

  • Extracting audio from DVD using iMovies.

    Can someone tell me how to go about? I do have Garage band & Logic if that would help.

  • Export to Excel - Problem with extra rows

    Hi have a report that has 3 groups. I suppress the group headers and am using the group footers for totals. When I export to excel, I get extra rows in the excel file for the suppressed sections. How can I get rid of these? Thanks, Linda

  • Backup from other drive

    Is it possible to get my previous backup from my other hard drive? Like sync thru Itunes, but use another drive to retrieve those backups?