How to get managed server name  in Weblogic10.2 ?

Hi
I want to get managed server name from a cluster in a servlet or util project class whom that one is called by ?
Do I have to implement any interface or I have to extends a class ? Please help me to resolved.
Thanks

Here is a snippet of code that I use in WL10 MP1 that works fine:
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.naming.InitialContext;
String managedServerName = null;
InitialContext ctx = null;
try {
//fetch managed server name by accessing the
//RuntimeServerMBean using the
//MBeanServer interface
ctx = new InitialContext();
MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
ObjectName service = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
managedServerName = (String) server.getAttribute(service, "ServerName");
} catch (Exception ex) {
//error occurred
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (Exception dontCare) {

Similar Messages

  • How to get the server name/hostname on which JVM is running?

    How to get the server name/hostname on which JVM is running from the Servlet or normal class?

    InetAddress.getLocalHost()

  • How to get a server name through the load balancer

    Hi.
    I'd like to get the server name where is my application installed. There are some servers and clients access there throuth the load balancer. When I try to get it with request.getServerName(), I get the virtual address of the load balancer.
    Any suggestions?
    Thanks.

    Dear Sikindar;
    THanks for your cooperation, but I believe that these Tcodes will eb helpful if I know the table name, actually we don't know its name and that's what I'm asking about, how can I get the table name for the ABAPer?
    Appreciating your cooperation.
    Best Regards;
    Lobna

  • How to get the Server Name in Crystal

    Hi All,
    We created a Crystal Report that pulls images from a File Location at the run time and this File Location is different for each environment (D-Q-P). We are trying to automate the file location by the server name. Is there any function in Crystal Reports that we can get the server name so we know if it is D-Q or P system?
    Thank you,

    Hi,
    There is no function in CR that can fetch the Server Name. That is something you need to provide to the formula.
    If you're loading images from a location on the Server, you can always use a Relative Path. For eg: if the images would be stored in a folder called Images, then you can write a formula on the 'Graphic Location' for the OLE object as:
    "/Images/Crystal.jpg"
    This will load the image from the folder when it is run on D, Q or P.
    Hope this helps!
    -Abhilash

  • How to get report Server Name and Environment ID in Report

    How to print report Server Name and Environment ID in Report 10G.(Through in package or others)
    I'm also using Oracle Application Server 10G.

    Hi,
    Server and envid are the parameters passed along with Reports URL call.
    These variables value can be traped in Report by defining SERVER , ENVID named user parameters.
    Once trapped, can be printed on Report.
    Just ensure that these users parameters are not exposed to Parameter page, otherwise user may end up changing it.
    Thanks

  • How to oracle manager server name

    for connecting OEM it asking
    username
    password
    oracle manager server
    so how can i get this name

    hint: read docu "Oracle Enterprise Manager Configuration Guide" (chapter 4)

  • How to get the Server name only?

    Hello,
    I would like to get this part of server's URL: "http://<host_name>"
    I am familiar with the Object WDURLGenerator but I don't see a method to do that, all the methods require manipulating the received String. Is there a method to get only the part I've mentioned?
    Roy

    Hi,
    String sysname = System.getProperty("SAPSYSTEMNAME");
    String hostname = System.getProperty("j2ee.dbhost");
    will give the server name..then u can say http://<hostname>...

  • How to find manage server name in weblogic server?

    I have two managed server in weblogic server. I need to find out which managed server serving my request. Please let me know if any body knows about this.

    You do not need to do anything, if your Report server is on the same machine as the Forms server (which is usually the case) you simply use the url as
    /reports/rwservlet?report=myreport' and the server will automatically use the default report server.
    then you simply use
    web.show_document('/reports/rwservlet?userid=scott/tiger@orcl&report=myreport&desformat=htmlcss&desname=test.html'Tony
    Try it now
    Edited by: Tony Garabedian on Nov 5, 2008 2:00 PM

  • How to get SMTP server name and SMTP port

    hi
    i need to send a report to the use to his mail id
    while configuring the ibot in mail tab it is asking for SMTP server ,and SMTP port
    how we can get these two,.... ?:(
    do i have to purchase from vendors, can any one please tell me the process
    really i don;t knw, please help me out
    Thanks in advance

    Hi,
    To configure the Mail Server u need to have SMTP server details, which your using as the mail server,either from vendor side or u can use your's domain.For your info iam pasting the Gmail Smtp server details here,
    Incoming Mail (POP3) Server - requires SSL:      pop.gmail.com
    Use SSL: Yes
    Port: 995
    Outgoing Mail (SMTP) Server - requires TLS or SSL:      smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Port for TLS/STARTTLS: 587
    Port for SSL: 465
    Account Name:      your full email address (including @gmail.com or @your_domain.com)
    Email Address:      your email address ([email protected] or username@your_domain.com)
    Password:      your Gmail password
    Thanks,
    Kumar.

  • Get Managed bean name while running tests.

    hi,
    while running web application,i can able get managed name.
    but how to get managed bean name while running unit tests.
    thanks
    siva

    public String getManagedBeanName() {
        String managedBeanName = null;
        HttpServletRequest request =
            (HttpServletRequest) FacesContext
                .getCurrentInstance()
                    .getExternalContext()
                        .getRequest();
        // lookup bean in request scope
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements()) {
            String requestAttribute = (String) requestAttributeNames.nextElement();
            Object object = request.getAttribute(requestAttribute);
            if (object instanceof MyBean) {
                managedBeanName = requestAttribute;
                break;
        if (managedBeanName == null) {
            // lookup bean in session scope
            Enumeration sessionAttributeNames = request.getSession().getAttributeNames();
            while (sessionAttributeNames.hasMoreElements()) {
                String sessionAttribute = (String) sessionAttributeNames.nextElement();
                Object object = request.getSession().getAttribute(sessionAttribute);
                if (object instanceof MyBean) {
                    managedBeanName = sessionAttribute;
                    break;
        return managedBeanName;
    }Sorry, don't know other ways.

  • How to get Manager id automatically when Employee Id is given.

    How to get Manager id automatically when Employee Id is given.
    1) I created a simple BO with two elements namely
        1.Employee Id
        2.Manager id
    How to get employee's first name and last name?
    And how will i get manager id  automatic when i click employee id in element field.
    Anbu.

    Have you tried to use "APPS.FND_CONCURRENT" API?
    http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=FND_CONCURRENT&c_owner=APPS&c_type=PACKAGE
    http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=FND_CONCURRENT&c_owner=APPS&c_type=PACKAGE%20BODY
    Thanks,
    Hussein

  • How to get a computer name in teststand step ?

    how to get a computer name in teststand step ?

    Hi,
    Use an ActiveX Automation Adapter with the following settings,
    ActiveX Reference : RunState.Engine
    Automation Server: TestStand API (depends on your version)
    Object Class: Engine (IEngine)
    Action: Get Property
    Property: ComputerName
    Then set your Parameters: to pickup the String ComputerName.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to start Managed server in Weblogic 8.1

    Hi,
    I am Using Weblogic 8.1 server. I can able to start weblogic server by invkoing startWebLogic.sh. When I start managed server by invoking the shell startManagedWebLogic.sh it error out by following exception
    <BEA-000364> <Server failed during initialization. Exception:weblogic.security.spi.ProviderInitializationException: [Security:090314]Entitlement Engine unable to connect to the embedded LDAP server
    netscape.ldap.LDAPException: error result (49)
    weblogic.security.spi.ProviderInitializationException: [Security:090314]Entitlement Engine unable to connect to the embedded LDAP server
    netscape.ldap.LDAPException: error result (49)
    at weblogic.security.providers.authorization.DefaultAuthorizationUtils.getEngine(DefaultAuthorizationUtils.java:130)
    at weblogic.security.providers.authorization.DefaultRoleMapperProviderImpl.initialize(DefaultRoleMapperProviderImpl.java:104)
    at weblogic.security.service.SecurityServiceManagerDelegateImpl.createSecurityProvider(SecurityServiceManagerDelegateImpl.java:242)
    at weblogic.security.service.SecurityServiceManager.createSecurityProvider(SecurityServiceManager.java:957)
    at weblogic.security.service.RoleManager.initialize(RoleManager.java:152)
    at weblogic.security.service.RoleManager.<init>(RoleManager.java:98)
    at weblogic.security.service.SecurityServiceManagerDelegateImpl.doRole(SecurityServiceManagerDelegateImpl.java:513)
    at weblogic.security.service.SecurityServiceManagerDelegateImpl.initializeRealm(SecurityServiceManagerDelegateImpl.java:409)
    at weblogic.security.service.SecurityServiceManagerDelegateImpl.loadRealm(SecurityServiceManagerDelegateImpl.java:700)
    at weblogic.security.service.SecurityServiceManagerDelegateImpl.initializeRealms(SecurityServiceManagerDelegateImpl.java:733)
    at weblogic.security.service.SecurityServiceManagerDelegateImpl.initialize(SecurityServiceManagerDelegateImpl.java:876)
    at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:734)
    at weblogic.t3.srvr.T3Srvr.initializeHere(T3Srvr.java:822)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:670)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:344)
    at weblogic.Server.main(Server.java:32)
    I refered some forum, they ask to update <EmbeddedLDAP > tag by setting Credential="" in config.xml file. Still I get the same exception.
    I have also tried in console, that too fails.
    Help me out to resolve this.
    thanks,
    Thiru.

    Hi,
    Thanks for your reply.
    My Admin server is running fine. The msi-config.xml, SerializedSystemIni.dat, boot.properties files are in the same directory. When I exceute the command
    startManagedWebLogic.sh <managed server name> it shows the same exception
    <WebLogicServer> <BEA-000364> <Server failed during initialization. Exception:weblogic.security.spi.ProviderInitializationException: [Security:090314]Entitlement Engine unable to connect to the embedded LDAP server
    netscape.ldap.LDAPException: error result (49)
    weblogic.security.spi.ProviderInitializationException: [Security:090314]Entitlement Engine unable to connect to the embedded LDAP server
    netscape.ldap.LDAPException: error result (49)
    thanks,
    Thiru.

  • How to get Sequence File Name ?

    Hello everybody !!
    I'm using TestStand 3.1 and i would like to get sequence file name. I've tried to use NameOf() function, but without success.
    Of course, I've searched previous posts about the same question, but nothing works.
    Is there someone able to tell me how to get sequence file name ?
    Thanks a lot.
    MrOrange

    MrOrange,
    first of all, the solution i will present only works for saved sequence files.
    you got all information you need within TestStand itself, just browse for RunState.SequenceFile.Path. here you can find the filename. but the path of the file is also included in the string, so this is a part you have to get rid off.
    you can use statements to extract the filename from the path. just search the string for the last occurence of "\\" (searchinreverse!) and then you can retrieve the right() part of the path. beware that right() needs the number of characters you want to extract, not the startindex!!
    hope this helps,
    Norbert B.
    NI Germany
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to get mobile model name for different types mobile devices

    Hi,
    I have checked few thread in this forum about getting mobile model name at server. So far, i noticed the mobile name is set manually in the midlet as user-agent .
    HttpConnection connection = null;           connection = (HttpConnection)Connector.open(url);          connection.setRequestMethod(HttpConnection.POST);          connection.setRequestProperty("User-Agent","Nokia7110 Profile/MIDP-1.0 Configuration/CLDC-1.0");
    i retrieve the header information from servlet like below :-
    String userAgent = request.getHeader("User-Agent");
    How to get mobile model name for different model devices , not by manually adding the model name in midlet?
    Thanks in advance :-)

    Hi,
    In J2ME there is no method to get the model number from the device. how ever you can use the APIs provided by the device manufacturer if available. But still the APIs will not work with devices from other manufacturer or sometimes it will not work with the devices of the same manufacturer if the API is not supported. so it is better to send the device model name through the header.

Maybe you are looking for