Re: how to get servername from a request but not the cluster name?

hi all,
how do i get server name from the request? This is the scenario, When ever a request is made, its handed to a cluster and then directed to one of the server in the cluster.
When i say request.getServerName();---- This is giving me the cluster name and not the server name. Say cluster1 has server1 and server2 and request is dispatched to any of one these servers. request.getServerName() - gives me cluster1 but I need to get server1/server2.
any suggestions/idea ? Thanks alot in advance.

http://forum.java.sun.com/thread.jspa?threadID=5287623

Similar Messages

  • How to get servername from a request but not the cluster name?

    hi all,
    how do i get server name from the request? This is the scenario, When ever a request is made, its handed to a cluster and then directed to one of the server in the cluster.
    When i say request.getServerName();---- This is giving me the cluster name and not the server name.
    any suggestions/idea ? Thanks alot in advance.
    Edited by: new_member on Apr 18, 2008 9:11 PM

    ADJavaUser wrote:
    You could try this:
    Create a batch or shell script that executes ifconfig or ipconfig and writes the IP address out to a file.
    Place each shell script file at different locations on each server within the cluster.
    Then within the code, try to execute each script from an external process (Runtime.exec). Since the files are at different locations within each server only the correct shell script for each server should execute and write the IP Address to a file. You'll have to detect which one ran. Then open the file that was written, possible parse it for the IP Address and use the code that I already provided.
    This is a time consuming process that will slow your application. Additionally depending on how your cluster is set up it might not work and still return the cluster's IP address.I got the solution....java.net.InetAddress.getLocalHost().getHostName(); works fine...But thanks guyz for ur responses

  • How do you delete albums from an I-phone 4,only able to delete from camera roll,but not the other albums

    How do you delete albums from an I-phone 4,only able to delete from camera roll,but not the other albums

    How did the photos get onto the phone ? Only photos taken with the phone or saved from emails/websites etc can be deleted directly on the device. Photos that were synced from your computer are deleted by moving/removing/de-selecting them from where they were synced from on your computer and then re-syncing.

  • How do you extend the frame from one side but not the whole thing?

    I am updating my blog and want to put a rectangle picture into the pre-set frame. I need to stretch it horizontally but the entire frame (i.e., both sides and top/bottom) stretched instead. How do you extend the frame from one side but not the whole thing?

    In Inspector, select the Graphic Inspector. Choose, from the Fill options, Image Fill. Select the image from the dropdown and click Open. Now go back to Inspector and click on Scale to Fit. Choose from the options in the window. There are a number of them which should address your problem:
    With the Blog template, you will probably need to insert a text box over the stock placement frame and work with that instead.
    Mark

  • "SOME" devices can resolve the ALIAS (CNAME record) for a device, but not the REAL name (A record) - Why? How do I fix this?

    I'm running the DNS server role on Windows Server 2012 R2 on a physical machine on my home network.
    My AD is configured with a non-registered name - let's say it's "home.acme.ca" and the DNS server is configured to host that zone.  I also configured a 2nd zone in the DNS server called "myinf.acme.ca".  They both run on a physical
    server with an IP of 192.168.1.10
    The DHCP server on my Cable Modem is configured to hand out 192.168.1.10 as the only DNS server to every device on my network.  On my servers (with static IP addresses), 192.168.1.10 is configured as the only DNS server available for them. 
    I took the DNS servers from my Cable Provider and configured a Forwarder on my server to send name resolution requests to them only if my DNS server can not answer the request - basically for any name resolution request that does not end with ".home.acme.ca"
    or ".myinf.acme.ca"
    The "home.acme.ca" zone is populated with 'A' records for all of the physical and virtual servers and PC's on my network.
    The "myfin.acme.ca" zone is populated with 'CNAME' records that point directly to the 'A' record in "home.acme.ca" - for example, I have a serve named s000abc123ww.home.acme.ca with an 'A' record providing an IP address of 192.168.1.20 and
    I created a 'CNAME' (alias) record named 'webserver.myinf.acme.ca' which points to the 'A' record 's000abc123ww.home.acme.ca'
    2 of my 6 machines can resolve the alias but not the real name of the server!
    .10 is the Domain Controller.  All of the other machines (except .98) are members of the home.acme.ca domain.
    I attempted to ping 's000abc123ww.home.acme.ca' AND 'webserver.myinf.acme.ca' on the following 6 computers.  I used the fully qualified name in all cases.
    4 of the below machines are able to resolve BOTH names.  The other 2 can resolve the Alias but not the real name!
    I don't understand how this is possible, but I would like to fix it...!!!  Please help?
    .10 - Server 2012 R2 (Physical) -  Hosts Active Directory and DNS.
    .20 - Server 2012 R2 (Virtual)   -  Runs SQL Server
    .21 - Server 2012 R2 (Virtual)   -  Runs Apache
    .22 - Server 2012 R2 (Virtual)  -   Runs Apache.  This is the device I am trying to ping (s000abc123ww)
    .98 - Windows 7 (Physical)
    .99 - Windows 7  (Virtual)
    .21 (which is configured nearly identically to .20 and .22) can resolve and ping the Alias, but not the real name.
    .98 can also resolve and ping the Alias, but not the real name.
    The rest of the machines can resolve and ping both the alias and the real name.
    All of the Virtual Machines are running under Hyper-V on the .10 physical server.
    All the devices are on the same subnet.
    Thank in advance to anyone who can help me understand and correct this problem!
    Jim

    Hi,
    CNAME resource records are recommended for use in the following scenarios:
    • When a host that is specified in an A resource record in the
    same zone needs to be renamed
    • When a generic name for a well-known server, such as www, must resolve to a group of individual computers (each with individual A resource records) that provide the same
    service, for example, a group of redundant Web servers
    Therefore please try to create your CNNAM record in the same zone and try again.
    The related KB:
    Adding, Changing, and Deleting Resource Records
    http://technet.microsoft.com/en-us/library/cc779020(v=ws.10).aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How can i delete my icloud account but not the password to turn off the find my phone

    how can i delete my icloud account but not the password to turn off the find my phone setting

    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iPad and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then save any photo stream photos that you wish to keep to your camera roll (unless using iCloud Photo Library).  When finished go to Settings>iCloud, tap Sign Out and choose Delete from My iPad when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • How to temporarily disable on delete cascade but not the constraint

    Hi all
    i would like to know if this is possible
    how to temporarily disable on delete cascade but not the constraint
    i want to delete a row from the primary key table but i dont want the data from the foreign key to be deleted even though there is an on delete cascade set.
    how do i temporarily disable on delete cascade from firing without disabling the constraint
    Rgrds

    There is an option which I've never used before but just read about which is to create your foreign key constraint as on delete SET NULL
    instead of on delete cascade.
    This will allow you to delete a parent and will set the foreign key column values in the child table to nulls
    e.g.
    SQL> create table parent (father varchar2(30) primary key,
      2                       age number);
    Table created.
    SQL>
    SQL> create table child (father varchar2(30) constraint fk references parent(father) on delete set null,
      2                      child varchar2(30),
      3                      age number);
    Table created.
    SQL>                    
    SQL> insert into parent values ('JOHN', 34);
    1 row created.
    SQL> insert into child values ('JOHN', 'SARAH', 10);
    1 row created.
    SQL> insert into child values ('JOHN', 'BILL', 12);                   
    1 row created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> delete from parent where father = 'JOHN';
    1 row deleted.
    SQL>
    SQL> select * from child;
    FATHER                         CHILD                                 AGE
                                   SARAH                                  10
                                   BILL                                   12
    SQL> HTH AMM

  • How to get Time from Different Work Station on the Network

    Hi,
    How do I get time from different work station on the network using its ip:port etc.
    Lets say, my main server-side Java application is running on a work station 123.12.123.1:1527,
    the client-side applications are accessing it using above IP.
    what I wanna do is, use the time of 123.12.123.1 machine throughout the application, not client local time.
    Appreciated..

    Ok, this network service on IP:Port is working for me, I hope this is the best way of doing it.
    In server application, I have this
    package RenameItToYourOwnPackage;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.text.SimpleDateFormat;
    public class ServerSocketExample implements Runnable {
        private ServerSocket server;
        private int port = 7777;
        Socket socket;
        public void run() {
            try {
                System.out.println("Waiting for client message");
                server = new ServerSocket(port);
                while (true) {
                    socket = server.accept();
                    // Read a message sent by client application
                    ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                    String clientMessage = (String) ois.readObject();
                    System.out.println("Message sent by client: " + clientMessage);
                    // send current datetime to client
                    ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                    oos.writeObject(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date()));
                    ois.close();
                    oos.close();
                    socket.close();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
    }In the client application I have
    package RenameItToYourOwnPackage;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class ClientSocketExample {
        static String dateTimeString;
        public ClientSocketExample() {
        public static String getServerDateString() {
            try {
                // Create a connection to the server socket on the server application
                InetAddress host = InetAddress.getByName("127.0.0.1");
                Socket socket = new Socket(host.getHostName(), 7777);
                // Send a message to the server application
                 ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                 oos.writeObject("Send me today's timestamp as string");
                // Read the response by server application
                ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                dateTimeString = (String) ois.readObject();
                //System.out.println("Message sent by server: " + message);
                ois.close();
                oos.close();
            } catch (UnknownHostException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            return dateTimeString;
    }And I run the service on the server-side with
            new Thread(new ServerSocketExample()).start();On the client-side I receive the date with
            System.out.println("DateTime on Server : " + ClientSocketExample.getServerDateString());Edited by: nkamir on Sep 13, 2010 2:53 PM

  • How to require licence from a different serverUrl (not the one in DRMContentData)?

    Hi guys
    I have a special request for requiring the movie licence from a different serverUrl (not the one I get from DRMContentData.serverUrl). I tried DRMManager.setAuthenticationToken with the new url but it didn't work.
    Does anybody know to do it or is it even possible to do it?
    Thanks.

    Hi,
    What is your particular workflow/use-case?
    Unfortunately, the license server's URL is baked into the DRMContentData and cannot be modified once a video has been packaged.  But, if you describe what problem you're attempting to solve, perhaps there is a different workaround.
    cheers,
    /Eric.

  • How do I delete an app from my phone but not the computer? Is there a way to deactivate it so it doesn't add it back when it syncs?

    How do I delete and app from my phone but not from the computer? Is there a way to do this so it doesn't add it back in when it syncs?

    In iTunes under the Apps tab for the iPhone device just uncheck any app you don't want synced to the phone. When you next sync the app will be removed from the phone but remain in the iTunes library.

  • CR2 files open from one camera, but not the other in CS2

    Running Mac with CS2. My camera raw files shot with my lovely Canon 5D open and can be viewed in bridge and in photoshop, but NOT the camera raw from my brand new Canon powershot G9. They are both producing CR2 files. I can see the images in the bridge browser window, but when I double click to open I get a dialogue box that says, "Could not complete your request because Photoshop does not recognize this type of file." I have the 3.7 plug in installed. Please, some god or goddess of photoshop out there, show me the error of my ways!

    Walt,
    I will answer your questions to the best of my ability. But hopefully others who are better at this than I am will offer their help as well. So, here goes.
    1. Everyone has their preferred method of using Bridge. In the Photoshop preferences I have not checked the box to have bridge start automatically. Although I use Bridge most of the time, there are occasions when I don't want to use it. So I prefer to start my Photoshop session by starting Bridge first, and then double-click on an image in Bridge to have it opened in Photoshop. In the Bridge preferences, I have checked the "Double-Click Edits Camera Raw Settings in Bridge", and I like working that way.
    2. I have seen several people comment about having this problem. And occasionally it will develop after you have been using Bridge/Photoshop for a while. The only thing I can suggest is for you to hold down the Ctrl key while you start Bridge. A dialogue will appear that will allow you to reset your preferences. There are three options and you should choose all three. I know, you haven't had it installed very long, but this "could" be the problem. One guy I talked with said that he had to do it several times before it fixed the problem.
    3. You indicated that you downloaded Camera Raw 4(5). What does that mean? Did you download version 4.5, which is the latest version? And, did you follow the installation instructions that were on the download page? The new plug-in must be put in the exact directory specified, replacing the old version that is already there. The old version cannot be put in a sub folder. You might as well get rid of it. You don't need it anymore. And, again, it has to go into the specific folder designated in the instructions. After you have done that, in Photoshop goto Help/About Plug-ins and click on Camera Raw. It should only be listed once, and when you click on it you should get a dialogue that will tell you what version you have installed.
    4. After I installed CS3, when I inserted a card into my card reader I was presented with the normal Windows options. One of the options I was given was to download using Bridge. I chose that option and indicated to always use that option. I haven't had any problems with it since. But if that option isn't there, you can open Bridge and click on the File menu. There is an option to download images from your camera. It has worked well for me.

  • How to delete items from itunes library but not from computer

    I was wondering if there is a way to remove items from my itunes library but still keep them on my computer in case I want to put them back in the library later. For instance, I bought the first season of Desperate Housewives, which takes up about 4.5 GB, and since I have the 30 GB ipod and lots of personally ripped DVDs, I'm running out of room. But it seems a waste to trash the files, since I paid for the show. I know I should back up the files to an external source anyway, and I've done that with my purchased music, but I don't have a DVD burner, and I'm not sure how many CDs it would take to back up the show. And I don't want to manually update the ipod because I think it's much easier to just plug it in and let it do its thing. Any suggestions/help would be appreciated. Thanks.

    Go to that File(s) and right-Click to Remove; then it will ask you if you want to send it to the Recyle bin or Keep Files on your computer; Say Keep Files on your computer and should be fine.

  • How do I send group emails from my iPad? They work fine from my MacBook but not the iPad.

    How do I send group emails from an iPad? They work fine on my MacBook but not my iPad.

    You need a third party app to do that. Look at Mail Shot or Group Email in the app store. You cannot do it with the built in mail app and the contacts app in iOS 5 without a third party app.

  • Can retrieve value from one table, but not the other (exception thrown)

    Hi
    I hope some friendly soul can help me out here. I have a local Access database file. I am able to get a value from all tables except for one, which throws this error: "System.NullReferenceException:
    Object reference has not been specified to an object".
    The rather simple lines of code when working is this:
    Dim email As Object
    value = MyDataSet.Tables("Table")(0)(1).ToString
    Msgbox(email)
    However, when simply changing from "Table" to "AnotherTable", the exception is thrown. I
    have seriously no idea why. I've made sure the datatypes are the same and that the values are not NULL.
    What gives?

    Hello,
    Going with your last reply, you should be accessing data via the strong typed classes that get generated.
    Example using Microsoft Northwind database accessing the customers table in a MS-Access database. Note the check for Rows, we could even go farther if we are questioning issue with the data via try-catch statements writing errors to the IDE Output window.
    I would highly recommend never referencing rows without first checking if there are rows and secondly never reference columns by ordinal index, always use the column name. One example with ordinal positioning, suppose someone did SomeDataTable.Columns("SomeColName").SetOrdinal(3)
    and you expect the ordinal position to be 1 ? things will crash-n-burn. Food for thought :-)
    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.CustomersTableAdapter.Fill(Me.MainDataSet.Customers)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    If MainDataSet.Customers.Rows IsNot Nothing Then
    Dim FirstCompanyName As String = MainDataSet.Customers.FirstOrDefault.CompanyName
    MessageBox.Show(FirstCompanyName)
    Else
    MessageBox.Show("No rows in customer table")
    End If
    End Sub
    End Class
    In this case we get the first record from below in Button1 Click
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Suddenly, my 1st gen can't access iTunes store.  It sits on "Accessing iTunes Store", with a spinning wheel for days.  I can access the store from my iMac, but not the Apple TV.  Everything is up to date.  What's the deal?

    I can't figure out why my 1st gen appletv cannot access the itunes store.  All newer movies are coming up to view and I can watch previews, but when I go to rent, it stays on the spinning wheel with the Accessing iTunes Store forever.  I've left it going for at least 4 or 5 days.  I can rent from my iMac, but all I have is the headphone, analog, 2-channel audio feed and not the true digital surround.  It sounded much better from the appletv.  HELP!

    Read a bunch of posts from 2008 and 2010.  The only step I found that I hadn't tried was the ol' plug pull.  After that, I got the first movie I tried renting.  ???  At least it works now.

Maybe you are looking for