Name of server in a cluster - Weblogic

This is a discussion on Name of server in a cluster - Weblogic ; IS there a way to get the name of the managed server in a cluster thats currently servicing a request? I looked at the JMX API and couldnt find anything obvious that would let me know the name of the ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Name of server in a cluster

  1. Name of server in a cluster


    IS there a way to get the name of the managed server in a cluster thats currently
    servicing a request? I looked at the JMX API and couldnt find anything obvious
    that would let me know the name of the server in a cluster thats servicing the
    request.
    Any ideas? hacks ?

    TIA
    Raj

  2. Re: Name of server in a cluster


    you can try system.getProperty("weblogic.name")

    "Raj" wrote:
    >
    >IS there a way to get the name of the managed server in a cluster thats
    >currently
    >servicing a request? I looked at the JMX API and couldnt find anything
    >obvious
    >that would let me know the name of the server in a cluster thats servicing
    >the
    >request.
    >Any ideas? hacks ?
    >
    >TIA
    >Raj



  3. Re: Name of server in a cluster


    The following works:

    public String getServerName() {
    weblogic.management.Admin adm = Admin.getInstance();
    weblogic.management.runtime.ServerRuntimeMBean runtimeSvr = null;
    if ( adm.getServer() != null ) {
    runtimeSvr = adm.getServer().lookupServerRuntime();
    }
    if (runtimeSvr != null) {
    return runtimeSvr.getName();
    }

    return null;
    }



    "mogliSoso" wrote:
    >
    >you can try system.getProperty("weblogic.name")
    >
    >"Raj" wrote:
    >>
    >>IS there a way to get the name of the managed server in a cluster thats
    >>currently
    >>servicing a request? I looked at the JMX API and couldnt find anything
    >>obvious
    >>that would let me know the name of the server in a cluster thats servicing
    >>the
    >>request.
    >>Any ideas? hacks ?
    >>
    >>TIA
    >>Raj

    >



  4. Re: Name of server in a cluster


    I get the following exception if I did that:

    -----------
    RemoteException: EJB Exception: ; nested exception is:

    weblogic.management.NoAccessRuntimeException: Access not allowed for
    subject: principals=[], on ResourceType: Server Action: execute, Target: lookupServerRuntime
    ------------------------------------------

    Why does this happen and how do we overcome this?

    Chandra



    "Joel" wrote:
    >
    >The following works:
    >
    > public String getServerName() {
    > weblogic.management.Admin adm = Admin.getInstance();
    > weblogic.management.runtime.ServerRuntimeMBean runtimeSvr = null;
    > if ( adm.getServer() != null ) {
    > runtimeSvr = adm.getServer().lookupServerRuntime();
    > }
    > if (runtimeSvr != null) {
    > return runtimeSvr.getName();
    > }
    >
    > return null;
    > }
    >
    >
    >
    >"mogliSoso" wrote:
    >>
    >>you can try system.getProperty("weblogic.name")
    >>
    >>"Raj" wrote:
    >>>
    >>>IS there a way to get the name of the managed server in a cluster thats
    >>>currently
    >>>servicing a request? I looked at the JMX API and couldnt find anything
    >>>obvious
    >>>that would let me know the name of the server in a cluster thats servicing
    >>>the
    >>>request.
    >>>Any ideas? hacks ?
    >>>
    >>>TIA
    >>>Raj

    >>

    >



+ Reply to Thread