Types of methods

What are class methods and instance methods? What are the differences between the two?

linuxisbest.eric wrote:
Well, i thought that it would be better to ask a Professional than some random website...How am I any less random than whatever website you might get the answer from? How do you even know anybody who answers here is a professional? How do you know the person providing the answer at a "random website" is not? You realize this is a website, right?
Google first. Go through a few responses to make sure they make sense and agree with each other. If something is still not clear, as here, with specifics about what is confusing you.

Similar Messages

  • Question on using table types in methods

    Hi
       I have a simple question involving passing table types in method
    I want to pass an internal table by reference - to a method and within the method populate the internal table (t1) using a select * into the internal table and then sort t1 by f1 and f2. t1 is an internal table based on a ABAP dictionary table ( at1 )
    Question is : If I use a generic type TABLE declaration , it does not allow sort operation specifically by fields. If I use type at1 as in
    the METHODS M1 exporting t1 type at1statement, syntax error is - t1 is not an internal table.
    How do I achieve the above using the method implementation ?
    Sample code that I try
    CLASS C1 DEFINITION
    PUBLIC SECTION
    METHODS M1 exporting t1 type table
    ENDMETHOD
    ENDCLASS
    CLASS C1 IMPLEMENTATION
    METHOD M1
    select * from at1 into t1.
    sort t1 field f1 f2
    ENDCLASS

    You should define a TABLE TYPE based upon the data dictionary type (at1) either in the data dictionary using SE11 or in the TYPES section of the class.
    Then define the parameter of this new type.
    Cheers
    Graham Robbo

  • Trying to uderstand different types of methods.

    Well, basically, I'm trying to uderstand the different types of methods there are.
    I uderstand private static, public static, private void and public void. Public means the method can be called from another class, private means method can only be called from within its own class. Static - some value is going to be returned, Void - no values are returned.
    These are the ones I don't understand for sure;
    static {
       try { ... }
       catch(...) { ... }
    } This method tries to do something and catches exception. But, it isn't public or private and it doesn't have a name, how does it fire?
    A void someName() method with no public or private prefix. Who can fire this method?
    final void someName(), static class someName(), and protected void someName() are other methods I don't understand.
    All help appreciated.

    Static - some
    value is going to be returned, No. Static means the method is associated with the class as a whole, not with any particular instance of the class. It has nothing to do with what, if anything, it returns.
    These are the ones I don't understand for sure;
    static {
    try { ... }
    catch(...) { ... }
    This method tries to do something and
    catches exception. But, it isn't public or private
    and it doesn't have a name, how does it fire?It's not a method. It's a static initializer. It runs when the class is loaded.
    A void someName() method with no public or
    private prefix. Who can fire this method?Without public, protected, or private, it's "default access" or "package access." It's only accessible within that class or to classes in the same package.
    >
    final void someName()[/i
    ], static class
    someName(), and protected void someName()
    are other methods I don't understand.
    You should go through a tutorial or introductory text.
    See Resources for Beginners for a list.
    http://www.thejword.com/3.html#beginner_resources

  • Cannot send complex type as method parameter

    Cannot send complex type as method parameter
    Hi!
    I'm using a kSOAP 1.2 client and i'm having trouble executing a method that takes an object
    of complex type as parameter:
    method:
    public void addSquareDetail(SquareDetail sd){/stuff}
    -SquareDetail is a java bean class that implements KvmSerializable
    - a mapping was added to classmap
    -legacy namespace is not an issue (i AM able to execute the following methods successfully
    over kSOAP):
    -getting one SquareDetail object
    -getting a vector of squareDetail objects
    Here's how i'm trying to call the 'send' method:
         ClassMap classMap = new ClassMap();
    classMap.addMapping("urn:SquareWebService/types", "SquareDetail", (new
    SquareDetail()).getClass());
    System.out.println("add one SquareDetail");
    request = new SoapObject(serviceURN, "addSquareDetail");
    sd = new SquareDetail();
    request.addProperty("SquareDetail_1", sd);
    tx = new HttpTransport(this.endPointURL, "addSquareDetail");
    tx.debug = true;
    tx.setClassMap(classMap);
    tx.call(request); //exception here
    (above:)
    private String endPointURL = "http://localhost:8080/SquareWebService/SquareWebService";
    protected static final String serviceURN = "urn:SquareWebService/wsdl";
    Error(from server, Sun ONE App Server7):
    SoapFault - faultcode: 'env:Server' faultstring: 'Internal Server Error (deserialization
    error: unexpected XML reader state. expected: END but found: START: someInt)' faultactor:
    'null' detail: null
    Here are request/response dumps:
    -request---------
    <SOAP-ENV:Envelope xmlns:n0="urn:SquareWebService/types"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <addSquareDetail xmlns="urn:SquareWebService/wsdl" id="o0" SOAP-ENC:root="1">
    <SquareDetail_1 xmlns="" xsi:type="n0:SquareDetail">
    <someFloat xsi:type="SOAP-ENC:float">1.5</someFloat>
    <someInt xsi:type="xsd:int">-1</someInt>
    <someString xsi:type="xsd:string">someString from SquareDetail</someString>
    <propertyCount xsi:type="xsd:int">4</propertyCount>
    </SquareDetail_1>
    </addSquareDetail>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    response------------
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:SquareWebService/types"
    xmlns:ns1="http://java.sun.com/jax-rpc-ri/internal"
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><env:Fault><faultcod
    e>env:Server</faultcode><faultstring>Internal Server Error (deserialization error:
    unexpected XML reader state. expected: END but found: START:
    someInt)</faultstring></env:Fault></env:Body></env:Envelope>
    So, apparently, the request message is not understood by the server. what exactly is it
    missing, and how can i add/correct that? (my guess in SquareDetail_1 xmlns="" should be
    "urn:SquareWebService/types", although it's just a guess AND i don't know how to make kSOAP
    get it in there)
    I'm not sure what kind of SOAP parser my app server utilizes, but i'm guessing it's an
    apache product (how can i tell?). I also have a WSDL file available, should anyone be
    willing to look at it, please let me know
    thanks
    -nikita

    Don't know if it will help but Can you check if the serializable object has a public empty no args constructor with an empty call to super()
    Also make sure that a type mapping registry is added with a reference to the serializable object in it.
    Please paste The WSDL as well

  • Object type component method name is not supported by object type BOR

    Hi All,
    Just want to get your help on the above error message in my workflow step.
    The method is successfully created in the BO, no errors, status is released/implemented.  This error only occurs when the workflow is triggered by a RFC call using SWE_EVENT_CREATE FM.  But when using t.code SWUS or SWUE the workflow will run as expected, no error.  And when the erroneous workitem is restarted using SWPR, it will run or continue successfully.
    Another thing, this is newly created task and method inserted in the workflow. If i delete this task, the workflow will run successfully when triggered by the same RFC.
    Hope you guys have already experienced this kind of error.
    Thanks in advance.
    Matt

    Hi Matt,
    I am trying to analyse the problem.
    When you trigger the workflow using function module it gives error. But when you trigger using SWUE or restart workflow then you do not get error.
    In both the cases ( SWUE or restart workflow  ) event is getting called using system. But when you trigger it prgramatically it throws error. I hope you are triggering it correctly.
    But as you are saying, when you delete the task and method it works fine. So that means it should not be triggering issue.
    Just do consistency check for the business object. Check if there is any issue in method.

  • Instantiating anonymous Type as method argument...

    hi,
    trying to do this, i guess i have stumbled upon a noob's syntax error. any help please?
        private <T extends Dimension> void fillArray(T dim, ArrayList<T> arrayList) {
            for (int i=0; i<dim.getDim();i++) {
                arrayList.add(new <T>(i+1));
        }the error is spotted in the third line and the compiler says: <identifier> expected
    thnx!

    you cannot do this because of the way java has defined generics. you either need some factory instance which knows how to create new T instances or a class of type T from which you can reflectively call the relevant constructor.

  • Incompatible type for method

    this is for school so you don't have to answer if you choose not to.
    i have to have method signature that reads
    public void BFEncrypt(String source, String target, byte code)throws IOException, FileNotFoundException{
    but when i call the method
    bfp.BFEncrypt("C:/WINDOWS/Desktop/ASSIGN3/test.txt","result.txt",12);
    i'm told i have to convert an int to byte. it is defaulting the 12 at the end of the call to an int. i got the class, which is to read a file, encode it using the simple code passed in, and then re-write to work fine when making the signature int code. I was told that it had to be byte though and i can't get it to work.
    thanks in advance

    Well, then overload the method..
    public void BFEncrypt(String source, String target, int code)throws IOException, FileNotFoundException {
       //whatever goes here
    public void BFEncrypt(String source, String target, byte code)throws IOException, FileNotFoundException {
       BFEncrypt(source, target, (int) code);
    }You could even test for values >127 <-128 and throw an exception. And you can use the same technique for short or long. (I did not try to compile this so no guarantees.)

  • Which types of methods cannot be traced?

    Hi, all,
    I met a very strange question. Assume in one class, there are 3 methods called methodA(), methodB(), and methodC(). methodA() will call methodB and methodC. I add methodA, methodB and methodC into method profiling. I can trace the running time on methodA and methodB, but cannot trace the running time of methodC. The running time of methodC always display "?". And the hint message is "Some of the methods might not be loaded by Jrockit". But in fact, if I can add it, it must be already loaded successfully.

    OS: Win2003 English
    WLS: weblogical 8.1
    JROCKIT: jrockit81sp3_142_04
    Today I found in the API, if we use Array as parameter, then this method cannot be traced by JRockit Management Console.
    Here is an example:
    public void testSync(String server) {..}
    public void testSync(String[] servers {…}
    Above two methods, testSync(String[] servers) cannot be traced by JRockit Management Console.

  • Types of method calls in OO ABAP

    Hai all,
    Is there call by value and call by reference is there in OO ABAP or not.
    Regards,
    Sreevathsava.G
    Moderator message: please search for available information before asking.
    locked by: Thomas Zloch on Aug 12, 2010 2:35 PM

    Method parameters can be passed by either reference or value. In SE24 this is specified via a checkbox against the parameter.
    The exception is RETURNING' parameters - these can only be passed by value.

  • What type of method is this

    System.out.println("Enter a sentence:");
    z = keyboard.hasNext();
    while (z) {
    x = keyboard.next();
    System.out.println(x);

    well what is it missing, im trying to create a program that will read a sentence and print each individual line of the sentence

  • Deep DDIC-Structure - Method to get the Comp.Type of a sub-structure

    Dear colleagues,
    thought the subsequent piece of coding might be helpful for the following problem:
    In DDIC you have created a deep/nested Structure e.g. a complete Business Document representation like
    s_doc_header type struct_doc_header
         (incl.) item  type tab_item
            (incl) party type tab_party etc.
    Now for some purpose you need to access somewhere a sub-part of this structure, e.g. the party-part. You only know (dynamically) the component name "party", but need for dynamic access also the Component Type ("tab_party") (in order to make use of  a "CREATE DATA lr_reftodata TYPE (determined_comp_type)." )
    The following piece of coding should help to query any start component type (here "struct_doc_header") for its embedded components.
    Its a recursive use of features provided by the very nice class(set) of cl_abap_structdescr.
    I implemented it as a static method.
    When doing so, you need to ensure, that the TYPE-GROUP "ABAP" is linked to the class (class properties --> forward declarations),
    Let me know if you find it useful.
    And apologies in advance, if the same problem was already posted in the forum. I did only a rough search before due to a lag of ideas for appropriate search-strings ...
    Best regards,
    Rudy
    Signature:
    Importing:
    IV_COMPNAME     TYPE ABAP_COMPNAME
    IV_START_STRUCTR     TYPE KOMP_TYPE
    Exporting/returning
    EV_DDIC_STRUCT     TYPE KOMP_TYPE
    METHOD search_deep_ddic_by_comp.
    * Description      -------------------------------------------
    *  Methods looks into a deep DDIC-Structure and returns the
    *  corresponding TYPE
    *  Prerequsite for usage: Structures component names are unique.
    * Local Data Defintions --------------------------------------
    * Locals -----------------------------------------------------
    * TYPES:
      DATA: lv_compname                 TYPE abap_compname.
      DATA: lt_componenttable           TYPE abap_component_tab.
      DATA: lv_relative_name            TYPE string.
      DATA: lv_ddic_header                  TYPE x030l.
      DATA: lv_ddic_struct              TYPE komp_type.
      DATA: lv_start_struct             TYPE komp_type.
    * supporting
      DATA: lv_lines                    TYPE i.
      DATA: lv_message                  TYPE string.
      DATA: lt_selopt                   TYPE sesf_selection_parameters_tab.
      DATA: ls_selopt                   TYPE sesf_selection_parameter.
    * References -------------------------------------------------
      DATA: lo_struct_descr             TYPE REF TO cl_abap_structdescr.
      DATA: lo_type_descr               TYPE REF TO cl_abap_typedescr.
    * Field-Symbols ----------------------------------------------
      FIELD-SYMBOLS:
            <fs_struct_descr_component> TYPE abap_componentdescr.
      lo_struct_descr ?= cl_abap_structdescr=>describe_by_name( p_name = iv_start_structr ).
      IF lo_struct_descr IS BOUND.
    *   get all sub-structures/components of iv_start_structr
        CALL METHOD lo_struct_descr->get_components
          RECEIVING
            p_result = lt_componenttable.
        lv_compname = iv_compname.
        READ TABLE lt_componenttable ASSIGNING <fs_struct_descr_component>
                                               WITH KEY  name = lv_compname.
        IF sy-subrc = 0.
    *     matching component found - search for DDIC structure
          CALL METHOD <fs_struct_descr_component>-type->get_relative_name
            RECEIVING
              p_relative_name = lv_relative_name.
          ASSERT lv_relative_name IS NOT INITIAL.
          CASE <fs_struct_descr_component>-type->type_kind.
            WHEN 'u' OR 'v'. "structure
              ev_ddic_struct = lv_relative_name.
              RETURN.
            WHEN 'h'. "table type - derive the line type
              lo_type_descr ?= cl_abap_datadescr=>describe_by_name( p_name = lv_relative_name ).
              CALL METHOD lo_type_descr->get_ddic_header
                RECEIVING
                  p_header = lv_ddic_header.
              IF sy-subrc = 0.
                ev_ddic_struct   = lv_ddic_header-refname.
                RETURN.
              ELSE.
                "error
              ENDIF.
            WHEN OTHERS.
              "error
          ENDCASE.
        ELSE.
    *     go deeper into structure and look into each sub-structure via recursion
          LOOP AT lt_componenttable ASSIGNING <fs_struct_descr_component>.
            CALL METHOD <fs_struct_descr_component>-type->get_relative_name
              RECEIVING
                p_relative_name = lv_relative_name.
            ASSERT lv_relative_name IS NOT INITIAL.
            CASE <fs_struct_descr_component>-type->type_kind.
              WHEN 'u' OR 'v'. "structure
              WHEN 'h'. "table type - derive the line type
                lo_type_descr ?= cl_abap_datadescr=>describe_by_name( p_name = lv_relative_name ).
                CALL METHOD lo_type_descr->get_ddic_header
                  RECEIVING
                    p_header = lv_ddic_header.
                IF sy-subrc = 0.
                  lv_relative_name = lv_ddic_header-refname.
                ELSE.
                  "error
                ENDIF.
              WHEN OTHERS.
                EXIT. "next loop, investigate only struct and table
            ENDCASE.
    *        lv_compname     = <fs_struct_descr_component>-name.
            lv_start_struct = lv_relative_name.
            CALL METHOD /scmtms/cl_ddic_utility=>search_deep_ddic_by_comp
              EXPORTING
                iv_compname      = iv_compname
                iv_start_structr = lv_start_struct
              IMPORTING
                ev_ddic_struct   = lv_ddic_struct.
            IF lv_ddic_struct IS NOT INITIAL.
              ev_ddic_struct = lv_ddic_struct.
              EXIT.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDMETHOD.

    Using command:
    ASSIGN COMPONENT idx OF STRUCTURE struc TO <fs>.
    For example:
    DESCRIBE FIELD pi_output TYPE pi_output COMPONENTS lv_columns. "For number of columns
    DO lv_columns TIMES.
    ASSIGN COMPONENT SY-INDEX OF
    STRUCTURE (name of structure) TO <l_fs_output>. "<l_fs_output> - field of structure
    DESCRIBE FIELD <l_fs_output>... "with other options.
    ENDDO.

  • Type parameter in 'add' method of 'ArrayList'

    My little application utilizes an object of type 'ArrayList', especially because this class enables the size increment of the list by successive actions after its creation. http://java.sun.com/javase/6/docs/api/ shows that I can use the method '*add(E e)*' for this purpose.
    The IDE I use is 'NetBeans IDE 6.5'.
    My object of type 'ArrayList' is multi-dimensional and to build it up, I make use of a re-entering method. At the end of this last, one can thus see :
         chaîneCible.add(descendant);
         return (chaîneCible);In 'chaîneCible.add(...',
    1) if I don't write the type E of the object e to append ('descendant')
    - the pre-compiler doesn't grumble : It does not underline the statement in red
    although the type of method parameter, own to 'descendant', is missing - e.g. 'String'.
    - the debugger grumbles :
    Note: C:\Documents and Settings\Me\My documents\ApplicPrograms\Application7\src\package\NoeudàCaseàCocher.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.2) if I add the type E of the object e to append - e.g. 'BigDecimal' - then
    - the pre-compiler grumbles :
    - It underlines the statement in red.
    - "Missing ;" + "Cannot find symbol" + "Symbol : variable String" + "location : ..."
    Confusion : It takes the type for an argument !
    - although the API stipulates that it is mandatory to specify the type of the parameter in front of it.
    3) I don't know when anymore, the compiler returned
    Class 'ArrayList' - method 'add'
    automatic casting of a 'String' into an 'Object' is refuted at compilationWhy cannot I specify the type E of the argument e, as the API requires ?
    Thanks in advance.

    Dear DrClap,
    Here is an intermediate source code (121 lines) of my original code file (1145 lines) which is working well, except this arrayList.*add(E e)* issue.
    You see here the declaration of the ArrayList, the code where I add entries to the ArrayList, the code where I try to "add the type E ...
    By writing *add(E e)*, I am simply using the syntax mentioned in http://java.sun.com/javase/6/docs/api/
    I guarantee that the code that I filtered out is not relevant to my arrayList.*add(E e)* issue.
    It is going on a parser that inserts String data from an auxiliairy file at the time of parsing the principal source file (chaîneSource), to generate a target file (chaîneCible).
    {code}
    package arbreformtarif;
    import java.util.ArrayList;
    import java.math.BigDecimal;
    class NoeudàCaseàCocher
    String dénomFournis;
    FormTarif donnéesàTéléch_CB;
    Object[] formTarif;
    private static Object[] formTarif_Libellés;
    private static byte langue = 0;
    private BigDecimal[] consommParticul;
    NoeudàCaseàCocher (Object[] data_TariefForm,
    String gewest,
    String naam_Aanbod,
    FormTarif dataToDownload_CB,
    { formTarif = data_TariefForm;
    donnéesàTéléch_CB = dataTeDownloaden_CB;
    private ArrayList assocLibellésAuxDonnées(Object[] chaîneSource)
    { byte nbreEléments = (byte) chaîneSource.length;
    ArrayList chaîneCible = new ArrayList(nbreEléments);
    Object descendant = null;
    for (int nbreBoucle = 0; nbreBoucle < nbreEléments; nbreBoucle++)
    { Object élément = chaîneSource[nbreBoucle];
    if (élément instanceof String)
    { switch (...) //
    { case 0:
    switch (...)
    { case 1:
    dénomFournis = (String) élément;
    break;
    case 2:
    switch (...)
    { case 1:
    moisDApplication = (String) élément;
    break;
    case 2:
    break;
    default:
    break;
    case 3:
    break;
    default:
    break;
    case 1:
    switch (...)
    { case 0:
    switch (...)
    { case 0:
    break;
    break;
    default:
    descendant = (String) élément;
    } else
    { if (élément instanceof Boolean)
    descendant = (Boolean) élément;
    } else
    { if (élément instanceof BigDecimal)
    descendant = (BigDecimal) élément;
    } else
    { if (élément instanceof Object[])
    switch (...)
    { case 0:
    élément = ((Object[])formTarif[iCA[0][1]]);
    break;
    case 2:
    switch (...)
    { case 0:
    chaîneCible.add(((Object[])formTarif_Libellés[langue])[3]); // Always a String
    break;
    default:
    break;
    default:
    break;
    default:
    descendant = (ArrayList)assocLibellésAuxDonnées((Object[]) élément);
    } else
    { if (élément == null)
    /* Note: C:\Documents and Settings\Charles\Mijn documenten\Applic Program\Java\CostComp_HomeElectric_2\
    * src\arbreformtarifàtélécharger\Noeudà2CasesàCocher.java uses unchecked or unsafe operations.
    * Note: Recompile with -Xlint:unchecked for details.
    chaîneCible.add(descendant);
    return (chaîneCible);
    {code}
    Remember that
    - 'élément' and 'descendant' are, depending of the momentaneous case, of type String, BigDecimal, Boolean, Object[] or null.
    - 'assocLibellésAuxDonnées' is a re-entering method.
    Thanks

  • How to declare a param. of type RANGE OF in a method (or function module)?

    Hello,
    I've got a following problem.
    I want to pass a value of type RANGE OF to a method declared in
    an interface (the interface is built using Class Builder). I don't know
    how to do that and I did not manage to find a solution using both
    SAP help and google.
    Did anybody have the same problem before?
    Best regards
    Pawel

    Ok, I find a workaround. Maybe it will be useful for somebody in the future.
    Declare the parameter type as ANY TABLE and then cast it to the expected type
    in the body of the method.
    So for example.
    Parameter          Type        Typing Method        Associated Type     
    I_RNG_DATUM Importing Type                         ANY TABLE
    In the body of the method.
    TYPES:
        erdat_range TYPE RANGE OF erdat.
      FIELD-SYMBOLS:
        <l_fs_rng_erdat> TYPE erdat_range.
      DATA:
        l_ref_to_range TYPE REF TO data.
      GET REFERENCE OF i_rng_datum INTO l_ref_to_range.
      ASSIGN l_ref_to_range->* TO <l_fs_rng_erdat> CASTING.
    However, if somebody know how to pass type RANGE OF
    explicitely, the right answer is still welcome.
    Best regards
    Pawel

  • Auth.log - Rejected send message, 2 matched rules; type="method_call"

    Hi,
    i'm checking the /var/log/auth.log and I found out that there is this error message
    Jun 9 20:19:56 localhost polkitd(authority=local): Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session2 (system bus name :1.23 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    Jun 9 20:19:57 localhost dbus[513]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.23" (uid=1000 pid=861 comm="/usr/bin/gnome-shell ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=654 comm="/usr/sbin/console-kit-daemon --no-daemon ")
    Jun 9 20:19:57 localhost dbus[513]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.23" (uid=1000 pid=861 comm="/usr/bin/gnome-shell ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=654 comm="/usr/sbin/console-kit-daemon --no-daemon ")
    Jun 9 20:19:57 localhost dbus[513]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.23" (uid=1000 pid=861 comm="/usr/bin/gnome-shell ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=654 comm="/usr/sbin/console-kit-daemon --no-daemon ")
    if think the problem is in /etc/dbus-1/system.conf
    <deny send_type="method_call"/>
    I'm tempted to change this to allow,  but I won't as long as I don't understand why this deny-rule is implemented.
    Last edited by miky76 (2012-06-09 20:41:06)

    That deny rule is the default. Things in /etc/dbus-1/system.d override it. There's a ConsoleKit.conf file in there that describes what interaction ConsoleKit actually allows.
    That said, ConsoleKit.conf also denies this access:
    <deny send_destination="org.freedesktop.ConsoleKit"
    send_interface="org.freedesktop.DBus.Properties" />
    I don't know why this is denied - most likely it's to prevent private data from being stolen from console-kit-daemon in this way. I don't see any such private data stored in properties on ConsoleKit, though:
    $ dbus-send --print-reply --system --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Session1 org.freedesktop.DBus.Introspectable.Introspect
    method return sender=:1.5 -> dest=:1.14 reply_serial=2
    string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
    "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
    <node>
    <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
    <arg name="data" direction="out" type="s"/>
    </method>
    </interface>
    <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
    <arg name="interface" direction="in" type="s"/>
    <arg name="propname" direction="in" type="s"/>
    <arg name="value" direction="out" type="v"/>
    </method>
    <method name="Set">
    <arg name="interface" direction="in" type="s"/>
    <arg name="propname" direction="in" type="s"/>
    <arg name="value" direction="in" type="v"/>
    </method>
    <method name="GetAll">
    <arg name="interface" direction="in" type="s"/>
    <arg name="props" direction="out" type="a{sv}"/>
    </method>
    </interface>
    <interface name="org.freedesktop.ConsoleKit.Session">
    <method name="SetIdleHint">
    <arg name="idle_hint" type="b" direction="in"/>
    </method>
    <method name="GetIdleSinceHint">
    <arg name="iso8601_datetime" type="s" direction="out"/>
    </method>
    <method name="GetIdleHint">
    <arg name="idle_hint" type="b" direction="out"/>
    </method>
    <method name="Unlock">
    </method>
    <method name="Lock">
    </method>
    <method name="Activate">
    </method>
    <method name="GetCreationTime">
    <arg name="iso8601_datetime" type="s" direction="out"/>
    </method>
    <method name="IsLocal">
    <arg name="local" type="b" direction="out"/>
    </method>
    <method name="IsActive">
    <arg name="active" type="b" direction="out"/>
    </method>
    <method name="GetLoginSessionId">
    <arg name="login_session_id" type="s" direction="out"/>
    </method>
    <method name="GetRemoteHostName">
    <arg name="remote_host_name" type="s" direction="out"/>
    </method>
    <method name="GetDisplayDevice">
    <arg name="display_device" type="s" direction="out"/>
    </method>
    <method name="GetX11DisplayDevice">
    <arg name="x11_display_device" type="s" direction="out"/>
    </method>
    <method name="GetX11Display">
    <arg name="display" type="s" direction="out"/>
    </method>
    <method name="GetUnixUser">
    <arg name="uid" type="u" direction="out"/>
    </method>
    <method name="GetUser">
    <arg name="uid" type="u" direction="out"/>
    </method>
    <method name="GetSessionType">
    <arg name="type" type="s" direction="out"/>
    </method>
    <method name="GetSeatId">
    <arg name="sid" type="o" direction="out"/>
    </method>
    <method name="GetId">
    <arg name="ssid" type="o" direction="out"/>
    </method>
    <signal name="Unlock">
    </signal>
    <signal name="Lock">
    </signal>
    <signal name="IdleHintChanged">
    <arg type="b"/>
    </signal>
    <signal name="ActiveChanged">
    <arg type="b"/>
    </signal>
    <property name="idle-hint" type="b" access="readwrite"/>
    <property name="is-local" type="b" access="readwrite"/>
    <property name="active" type="b" access="readwrite"/>
    <property name="x11-display-device" type="s" access="readwrite"/>
    <property name="x11-display" type="s" access="readwrite"/>
    <property name="display-device" type="s" access="readwrite"/>
    <property name="remote-host-name" type="s" access="readwrite"/>
    <property name="session-type" type="s" access="readwrite"/>
    <property name="user" type="u" access="readwrite"/>
    <property name="unix-user" type="u" access="readwrite"/>
    </interface>
    </node>
    Note those properties at the end of that list, which are the same things you can learn by running ck-list-session.
    If you want to change the deny to allow, you may as well do it in the ConsoleKit.conf line, so it's specific to this usage, rather than allowing any method call in the world called through dbus.
    FWIW, I can reproduce this same error, trying to do it "by hand", though I don't use GNOME, as you do:
    $ dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Session1 org.freedesktop.DBus.Properties.GetAll string:org.freedesktop.ConsoleKit.Session
    Error org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.17" (uid=1000 pid=13892 comm="dbus-send --print-reply --system --type=method_cal") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination="org.freedesktop.ConsoleKit" (uid=0 pid=751 comm="/usr/sbin/console-kit-daemon --no-daemon ")

  • Help: Connecting Tomcat to CA-IDMS Using JDBC Type 4 Drivers (JNDI)

    Hi there,
    I have a rather interesting / complex problem......creating a connection to CA-IDMS from Tomcat using JDBC type 4 drivers (CA provide the type 4 driver).
    We have a zSeries 9 IBM mainframe running CA-IDMS r16.1, and I need to connect to the IDMS from Tomcat (running on Linux) using the JDBC Type 4 drivers provided by CA.
    At this stage I am struggling with the actual setup and configuration of Tomcat’s server.xml and web.xml files. These are the files where the JDBC configuration is set (I think). I have to setup the CA-IDMS part of the configuration, but that is a different problem. Basically there is a TCP/IP listener on the IDMS, waiting for incoming connections from the JDBC type 4 driver.
    I set up a Tomcat to MySQL connection using MySQL Connector / J, which is a similar kind of process to what I am trying to achieve with IDMS. MySQL connector / J came with a jar file which is placed in Tomcat’s lib folder, and then the JDBC setup for the web application is created in Tomcat's server.xml and web.xml files. You can then connect to the MySQL database using JSP and the configured JDBC driver / connection. The CA-IDMS Server comes with an idmsjdbc.jar file, which I think is the JDBC typr 4 driver. I think it needs to be placed in the Tomcat /lib folder, but I don’t know how to set up the configuration.
    There is a JDBC DriverManager which allows JDBC drivers to connect to CA-IDMS. The DriverManager recognises the following syntax:
    jdbc:idms://hostname:port/database
    This allows the JDBC driver running within Tomcat to connect to the IDMS which is running on the IDM mainframe. CA IDMS r16 supports direct connections from the Type 4 JDBC driver to the Central Version on IDMS. "hostname" is the DNS name or IP address of the machine where the CV is running, and "port" is the IP port that was specified for the listener PTERM (setup on the IDMS side).
    There is a caidms.properties file for the JDBC driver, which is used to specify user ID, password, and optional accounting information. It can also be used to specify physical connection information, allowing an application to connect to a CA-IDMS database without requiring the definition of an ODBC style data source. However, I don’t know where to place this file within the Tomcat setup.
    There is also an IdmsDataSource class. I don’t know where to configure this or how to set it up; the CA-IDMS Server manual states the following:
    This class implements the JDBC DataSource interface. It is used with an application server (Tomcat) providing Java Naming and Directory Interface (JNDI) naming service to establish a connection to a CA IDMS database. IdmsDataSource properties conform to the Java Beans naming conventions and are implicitly defined by public “setter” and “getter” methods. For example, the “description” property, which is required for all DataSource implementations, is set using the setDescription(String) method. The application server may use the java.lang.reflection methods to discover DataSource properties and provide an interface to set them, or may simply require that they are defined in some configuration file. IdmsDataSource properties are used to specify the connection parameters. These properties are the equivalent of the DriverPropertyInfo attributes described in the previous section and can be used to completely define the parameters needed to connect to a database. Like a URL, an IdmsDataSource object can also reference an “ODBC” style data source name, where the connection parameters are defined in the configuration file on Linux.
    Is there anyone that can try to point me in the right direction to setting up the JDBC connection? I am totally new to Java and so the instructions are not making much sense at the moment. Any help, hints, tips…..anything will be greatly appreciated as I have just hit a brick wall here. I can't find much to do with setting up the CA-IDMS Server JDBC type 4 driver online either....if anyone can point me to some resources that would also be extremely useful.
    Kind regards
    Jp

    You say you've managed to get the JDBC driver working
    in an application but not in a JSP. You also say that
    the error you get is
    "com.microsoft.jdbc.sqlserver.SQLServerDriver".
    I'd be willing to bet that the exception that you have
    got is a ClassNotFoundException. I.E. your application
    server hasn't found the JDBC driver classes. The
    application server probably doesn't use your current
    CLASSPATH to look for classes. It will be setup within
    the application server in some way and you'll need to
    check your app server documentation to see how it is
    done.
    Try replacing
    e.printStackTrace();with
    e.printStackTrace(out);to get a full stack trace of your error.
    ColTried it. Got this error when I tried to run the JSP.
    Incompatible type for method. Can't convert javax.servlet.jsp.JspWriter to java.io.PrintWriter.
              e.printStackTrace(out);
    I'm currently using Apache Tomcat 4.0.3 as my JSP/Servlet Container.
    I'm also using Type 4 MS SQL Server 2000 JDBC driver version 2.0 on my NT4.0 Server.
    Do I need to set my JDBC driver in my container? if so, how do I do that?

Maybe you are looking for

  • 16:9 or 4:3?

    Hi guys, I seem to have a problem with a project I am working on. The video is all HD but when I export to QuickTime and play in full screen mode I can see black borders at either side of my movie as well as at the top. This gets me thinking that it

  • Macbook running slow....loading web pages slowly

    i have noticed that for a while now, my macbook does not have the same pep that it used to have. if i t were a pc, i would think that i had a virus. the most i notice it is when using safari, opening pages, buffering movies, etc. that is mostly what

  • I have no idea what the password is for my airport utility

    I Have no idea what the password is for my airport utility

  • Can I change my computer name?

    Hello all, I just replaced my Power G5 with a Mac Pro, however, the computer name of the new Mac Pro is quite too long, therefore I am thinking to change it. I have not set up the network connection yet with my other computers at home. Do I have any

  • Cut, Copy Paste Implementation in JApplet

    I have created HTML TextEditor in applet using HTMLEditorkit class. Used the following action functions CutAction CopyAction PasteAction when i run the applet in applet viewer it pastes any text copied from outsite the applet in the applet,but when i