Problem in Getting host name by using request.getHostName() on solaris 9

Hi there,
I'm trying to get the machine name of the system from which the request was initiated by using request.getHostName() on Solaris 9 but it is giving me the IP Address of the machine which har sent the request to the server and the same thing is running on Windows and AIX platform. Can anyone tell me any solution to this problem.
Thanks in advance.
Nitin Jain

Hi Nitin,
Following is the specification for getRemoteHost()
"Returns the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST." I think the same would be true for getHostName().....
So, this can be one possiblity why ur given IP.

Similar Messages

  • Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

  • Stored procedure for getting host name, host instance and status of that host is it running or stopped.

    Hello all,
    yesterday I got one task in that I have to stored procedure for getting host name, host instance and status of that host is it running or stopped.
    any body knows where exactly, In which table this details are there in BizTalk databases.
    thanks

    Status of the host instance is not stored in the SQL database for you to query the status using stored procedure. You have to either use Powershell or WMI to get the status.
    In SQL, following table contains the details about the host like Name, LoginName, IsDisables etc but status of the host instance is not stored in the database.
    SELECT * FROM BizTalkMgmtDb..adm_HostInstance
    Powershell to get the status:
    http://axonolympus.nl/?page_id=186&post_id=969&cat_id=6&lang=en
    WMI to get the status:
    https://msdn.microsoft.com/en-us/library/aa561820.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/aa578621.aspx
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Network Error []: Cannot Get Host Name when running business rules

    Guru's
    We are getting the following error intermittently when we are running business rules (Planning Application >>Tools>>Business Rules) or running SmartView refreshes:
    Network error []: Cannot Get Host Name
    The following is then logged in the Essbase Application logs:
    Local/Application/Database/admin@Native Directory/Error(1042022)
    Network error []: Cannot Get Host Name.
    A quick look at the Essbase Error Messages Doc says it is a network error and we have to consult the network documentation. Unfortunately this is not very descriptive so we logged an SR with Oracle but we don't seem to be getting a resolution.
    The environment is 11.1.2.0 and the architecture is as follows:
    Server 1 - MS Server 2008 x64:
    Planning, Calc Manager, Foundation Services, Framework Web Services, EAS, APS, Web Analysis, FR Web Services
    Server 2 - MS Server 2008 x64:
    Essbase Server
    Server 3 - MS Server 2008 x64:
    Framework Services, FR Print Services
    We have tried doing the following:
    1. Put in the server host names into the hosts file on the Hyperion Servers
    2.  Applied the following TCP/IP settings on all the Hyperion Servers and one of the user machines as a test:
          - Added a new DWORD Value named TcpTimedWaitDelay and set it to 30.
         - Added a new DWORD Value named MaxUserPort and set it to 65534.
         - Added a new DWORD Value named MaxFreeTcbs and set it to 6250
    3. Confirmed that there are no packet drops by monitoring the server NICs so no packet loss could be the cause of this issue
    4. The Essbase Config file has the following settings:
    NETDELAY 2000
    NETRETRYCOUNT 2500
    Has anyone come across this issue and if you managed to resolve it, how did you go about it.
    Thanx

    Hi Rahul
    The issue is happening to a number of calcs so it it not one calc specifically. I will ask the functional consultants to enhance the logging in the business rules so that we can see if the issue happens on a specific member\block etc and yes we do use Xrefs
    We can run this as a calc in EAS without any issues and it's intermittent because this business rule runs 95% of the time in Planning Application >> Tools >>Business Rules without any issues.
    Thanks

  • Get host name and ip addrees of the client machine for window VISTA

    Hello Friends !!
    I have write the following code to get the ip adress and host name of the client machine ..
    it works fine for windows xp and 2000 but in vista it gives this type of out put.
    host name = 0:0:0:0:0:0:0:1
    ip addresss = 0:0:0:0:0:0:0:1
    what i have to make changes in my code to get the proper ip address and hostname for vista...
    My code is listed below....
    code ::
    InetAddress remoteAddress = null;
    // Setting Host Name...
    request.setAttribute("reportHostIP", request.getRemoteAddr());
    // Setting Host IP Address...
    try
         remoteAddress = InetAddress.getByName(request.getRemoteAddr());
         //This will give you the full qualified domain name of the client
    request.setAttribute("reportHostName", remoteAddress.getCanonicalHostName());
    catch(Exception e)
         logger.error(e.getMessage(), e);
    }

    BIJ001 wrote:
    Is it not IPv6 by any chance?It is. And if I remember correctly, then "0:0:0:0:0:0:0:1" (or "::1" for short) is the IPv6-equivalent to "127.0.0.1", i.e. it's the loopback device.

  • Getting host name of the remote client using getRemoteHost() --Problem

    Hi everybody
    Does anyone know how I can get the Host name out of the request ? I just get IP address which I do not need at all , any suggestion ?
    Many thanks
    Arash

    If it has a name then
            InetAddress addr = InetAddress.getByName("212.58.224.123");
            System.out.println(addr.getHostName());

  • Problem. Help please. Server Host Name "already used"

    Hello.
    This isn't very critical. But I'm getting a little tired.
    For some reason, from time to time, it appears the following message:
    "The server host name '[my nameXX]' is already being used. It has been substituted by [my_nameXX+1]".
    So it keeps incrementing by 1 that index next to the name of the computer...
    It seems like the name of the computer stays somehow in the net, in the router or in itself, and when I restart my MacBook, it finds that the name is already used.
    Any idea??
    Thanks in advance

    Hola ElPiter, y una cálida bienvenida a los foros!
    The last time I saw this I think it was the Router or Server doing it.
    Does everything have the latest Firmware updates? Routers in particulasr can't be trusted for any Auto update/notification of Firmware.

  • Problem in getting column name by API "SQLColAttribute"

    The column name is "~<>#!@" (Japanese SBC case).
    Using Oracle ODBC driver, the result turns to be "?<>#!@" , the SBS case ~ (tilde) cannot be obtained correctlly.But there is no problem if the driver change to Microsoft ODBC for Oracle.
    Can anyone tell me how to get the correct character using Oracle ODBC dirver?
    Bye the way, my environment is "NLS_LANG=JAPANESE_JAPAN.JA16SJIS"

    Hi Nitin,
    Following is the specification for getRemoteHost()
    "Returns the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST." I think the same would be true for getHostName().....
    So, this can be one possiblity why ur given IP.

  • Getting Host Name From Forms 6i (deployed in 10g AS)

    Hi,
    I need to get the host name of client while launching my application. I am using forms6i. So I cannot use webutils.pll for the same. But in the below thread I have read that Webutil.pll has been modified to use with FORMS 6i also. Can anybody send me webutils.pll which can be used with Forms 6i
    Re: Converting to Webutil? 6i and 9i equivalents.
    Its an urgent requirement
    Any help is appreciated.
    Thanks

    Hi,
    I have tried sys_context and java class option already ..but in vain :(..
    Let me explain my problem in detail.
    My database server(Oracle 10g) is in HOSTA
    My appserver (Oracle 10g AS)resides in HOSTB
    And user launches the application from HOSTC
    My requirement is to get the host name of the user while he launches the application. ie HOSTC in this case.
    If I am trying with java.net.InetAddress.getLocalHost().getHostName(); I am getting the value HOSTA(Host name of Data base server)
    If I am trying with SYS_CONTEXT I am getting HOSTB(Host name of appserver)
    And my requirement is to get HOSTC !!!
    I have read that if Webutil_clientinfo.get_host_name is used I can get the host name of client machine. But since I am working with forms 6i , I can't use Webutil.
    please help me if you know any way to achieve the same in forms 6i

  • How to get file name for failed request in JSOM

    hello friends,
    i am uploading files to sharepoint 2013 document library. due to some problem when a file is not uploaded request is failed and failed callback handler is executed. at this time how i can know for which file has not been uploaded.
    as i am uploading multiple files so it is necessary to know for which file error occurs.
    please help 
    Thanks in advance.
    Mukesh

    Hi Z..
    it will be hard for any one to understand the code. how ever I have provided bellow.
    theme is I need to upload multiple files selecting one by one asynchronously when a file will begin to upload It will show status of file name with processing image. similarly for other files.
    ones file successfully uploaded processing image will get hidden. and delete will appear.
    when error occurs for a file then processing div need to be removed for which I need file name when request failed. in failed handler
    function uploadData()
    var input = $("#fldFile")[0];
    if (input) {
    $("#uploadedfile").append("<div class='file'><label>" + input.files[0].name + "</label><div class='image'><img src='/_layouts/15/KPMG.VendorPortal.DMS/processing.gif' alt='processing..'/><img src='/_layouts/15/KPMG.VendorPortal.DMS/error.png' alt='delete' style='display:none;' /></div>");
    file = input.files[0];
    filename = input.files[0].name;
    fr = new FileReader();
    fr.onload = uploaddocument;
    fr.readAsDataURL(file);
    function uploaddocument()
    web = clientContext.get_web();
    clientContext.load(web);
    list = web.get_lists().getByTitle("TempLibrary");
    rootFolderUrl = list.get_rootFolder();
    file = this.result;
    clientContext.load(rootFolderUrl);
    clientContext.executeQueryAsync(onuploaddocumentsuccess, failed);
    function onuploaddocumentsuccess()
    fileCreateInfo = new SP.FileCreationInformation();
    fileCreateInfo.set_url(rootFolderUrl.get_serverRelativeUrl() + "/" + foldername + "/" + filename);
    fileCreateInfo.set_overwrite(true);
    fileCreateInfo.set_content(new SP.Base64EncodedByteArray());
    // Read the binary contents of the base 64 data URL into a Uint8Array
    // Append the contents of this array to the SP.FileCreationInformation
    var arr = convertDataURIToBinary(file);
    for (var i = 0; i < arr.length; ++i) {
    fileCreateInfo.get_content().append(arr[i]);
    // Upload the file to the root folder of the document library
    uploadedfile= list.get_rootFolder().get_files().add(fileCreateInfo);
    clientContext.load(uploadedfile);
    clientContext.executeQueryAsync(documentuploaded, documentfailed);
    function documentuploaded()
    var fname = uploadedfile.get_name();
    $("#uploadedfile").children("div").each(function () {
    var flabelname = $(this).children("label").text();
    if (flabelname.trim() == fname.trim())
    $(this).children("div").children("img").get(0).style.display="none";
    $(this).children("div").children("img").get(1).style.display="block";
    alert("uploaded");
    function documentfailed(sender,args)
    Mukesh

  • Problem connecting to hosted sharepoint site using hotspot connection with Telstra 3G

    I have problems connecting to a hosted sharepoint website using hotspot conection - either the page doesnt load (IE) or I get repeated sharepoint authentication prompts (Firefox). The problem is specific to this hosted site, we can successfully load other webpages, and can access another companes sharepoint extranet using iPhone hotsot connection. I have tried changing the cellular data APN settings on the iPhone from telstra.iph to telstra.internet but this did not solve the problem.

    Look at the JSSE examples. You need to setup a key store, add the jsse jars to your classpath, yadda, yadda, yadda....

  • Getting host name

    I am using serverSocket and the .accept() method to wait for a connection and I want to store the address of the computer that connects to the server. Is there a way to do this?

    Yes. accept returns a Socket and you can get the remote InetAddress from that and from that in turn get the host name.

  • How to get Host name and SQL Instance Name by T-SQL

    I am using SQL 2000, 2005 and 2008. I have few multi instances SQL servers. I would like to gather following information:
    Host Name
    SQL Instance Name
    SQL Version
    Server1
    Server1
    SQL 2000
    Server1
    Server1\ABC
    SQL 2005
    Server1
    Server1\XYZ
    SQL 2008
    Server2
    Server2
    SQL 2008
    Is there any way I can get it by T-SQL? Any help would be appreciated.
    Thanks
    Saumen 

    SELECT
    SERVERPROPERTY('MachineName') AS [ServerName],
    SERVERPROPERTY('ServerName') AS [ServerInstanceName],
    SERVERPROPERTY('InstanceName') AS [Instance],
    SERVERPROPERTY('Edition') AS [Edition],
    SERVERPROPERTY('ProductVersion') AS [ProductVersion],
    Left(@@Version, Charindex('-', @@version) - 2) As VersionName
     |
    Blog: MSBICOE.com |
    MCITP - BI, SQL Developer & DBA
    Hate to mislead others, if I'm wrong slap me. Thanks!

  • Getting host name and IP address

    I have develop different types of forms which resides on server and clients are acessing it.Now from my end i want to track that which user is accessing my forms on the server i.e i want to know the client IP address and host name.When the user execute some query on the database then i will get it easily using sys_context function but if it perform some functions within the form and i catch the host name then it returns the server host name where the actual forms resides not the client host name and i want to know the client host name and IP address who is running the forms.Plz let me know the way so i can do that easily .
    thanks

    Hi Grant,
    I want to get ip/address host name of reports server, sitting on forms server.
    can you tell me how to do this.
    in a web base environment.
    i have several report server instances running on different machines.
    when i run a report using RUN_REPORT_OBJECT using report_server=mac_rep1
    i want to know mac_rep1 resides on which host/ip machine.
    regds

  • How to Get Host Name Domain Name : Port No. for App Server From Forms

    Forms 10g r2
    I am looking to run various forms and reports from within a form. I am using web_show_document. I am passing the URL which includes "http://{host name . domain name : port number}/forms/frmservlet?config=schema1_schema2 form=ab0001 p_param1=151 p_param2=1409 p_x=X". My schema1_schema2 config section in formsweb.cfg contains user name, password, connection information.
    All works well when the actual host_name.domain_name:port_no are hard-coded within a string that is used for the URL with web_show_document, but I need to be able to distribute the form without hard-coding the host_name, domain_name, and port_no.
    I have looked in forms help for application properties, system variables, and within this forum for the built-in or system variable that returns this information, but have not found it.
    Can someone please tell me how I can get this information (host_name, domain_name, and port_number for the application server on which the form is currently running) so that I can build this working URL dynamically?
    I appologize if I have overlooked it within this forum.
    Thanks greatly,
    James

    Thanks, Rosario.
    As it turns out, I don't need the IAS Host_Name, Domain_name, and Port_No. Instead, I can do what I described by stripping off precisely THAT information leaving a URL that looks like:
    v_url := "/forms/frmservlet?config=schema1_schema2 form=ab0001 p_param1=151 p_param2=1409 p_x=X";
    WEB.SHOW_DOCUMENT(v_url,'_blank');
    The original IAS Host_Name, Domain_Name, and Port_No. are assumed and the named config -- schema1_schema2 is still properly referenced so as to use the username/password and connect string to the 2nd schema. This is done by use of the relative path.

Maybe you are looking for

  • How to add an additional email account in Mail?

    Hi, I set up my main 'Hotmail' email address in 'Mail' about a year ago but have never used the Mail App since. I now have a 2nd email address (university) and it is hosted through 'Exchange Labs' which is basically Hotmail/MSN I think. I cannot chec

  • How do I get bookmarks to be shown in the bookmarks dropdown?

    On the Bookmarks dropdown from the top menu bar, I used to see the websites that I bookmarked. I was organizing bookmarks and something happened to the dropdown. When I click on the dropdown, now I don't see my bookmarks. So, I reinstalled Firefox an

  • Content Presenter Portlet (CPP) on weblogic portal 10.3 giving error

    Hi, We are using WLP 10gR3 & UCM 10gR3 in our environment. We've done a new installation on portal following the checklist which is working fine on a working env. On portal application CPP giving error Content Presenter Portlet giving err-An appropri

  • PR header text copied to PO header text

    hi is there any setting for coping PR header text to PO header text i checked in  define text types & copying rules to PR & PO am not finding this option to copy PR header text to PO header text is it possible in std SAP nani

  • Cideon / Autocad 2007 / Material BOM Creation from autocad

    Hi, we are using Cideon integration for AutoCad 2007 & SAP ERP communication. DIR's in DMS are created from AutoCad drawings via SAP menu. We want to create Material & Material BOM from AutoCad but we cannot see any option present in SAP menu. We can