Feedback request for this case

http://www.amazon.com/Premium-Crystal-Silicone-Precut-Protector/dp/B003E8LBVM/re f=cmcr_pr_pbt
Anyone ever used this?

http://www.amazon.com/Premium-Crystal-Silicone-Precut-Protector/dp/B003E8LBVM/re f=cmcr_pr_pbt
Anyone ever used this?

Similar Messages

  • Authorisation request for this document was cancelled

    Forum,
    I have an approval stage and template configured in SAP when a sales order is raised it prompts the user for authorisation. Whilst this is ok'd the order is placed in a 'Draft' status. Upon trying to add one particular order, i get the following message:
    The authorisation request for this document was cancelled. The document cannot be added inless the authorisation request is restored.
    As he needed to get the order processed. I advised he duplicate the order and re-add it this time ensuring the correct authorisation procedure is carried out.
    Why would this occur?
    Regards,
    Juan

    HI Juan
    The question u have asked is nor very much clear the first scenario is that once the approval is rejected the document saves in draft well if thats the concern than this is the way the approval procedure is defined that without approval the document should not have any affect on the system whereas rightly said by fellow geniuses u can have multiple person to approve if one is not present other can approve it this would save time and effort for you
    The second scenario is that the approval procedure u have assigned gives u the message with one particular document and its fine with rest if thats the case then i would request you please check the query if there is any associated with the approval procedure
    Regards,
    Manish

  • I am able to load some pages from a particular website while other pages from the same site give the error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

    I am able to access some directories on the website without any problems while I get the "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." error for other directories of the same site.
    == URL of affected sites ==
    http://www.safelistgrande.com

    Suddenly from yesterday I am getting this error while trying to opening gmail

  • Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    keep getting this error:
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    I've also tried in IE and got this page can not be displayed.
    Cleared cache, deleted cookies.
    I'm trying to access grrlzrock.com I was using it about an hour ago, and now it doesn't work. any idea?

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    *http://kb.mozillazine.org/Cookies
    *https://support.mozilla.org/kb/Deleting+cookies
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Google calendar is getting the error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." I have tried disabling cookies, clearing cookies and cache but that didn't work.

    Google calendar is getting the error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." I have tried disabling cookies, clearing cookies and cache but that didn't work.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies.

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    In my experience this is most of the times a server issue of the website provider.
    Does this error occur on all Websites or just one specific Website?
    Does this Website load in Internet Explorer (or any other Browser?)?

  • I have downloaded firefox but when I open it I get the following message 'Firefox has detected that the server is redirecting the request for this address in a way that will never complete'. What do I do?

    I have downloaded firefox but when I open it I get the following message 'Firefox has detected that the server is redirecting the request for this address in a way that will never complete'. What do I do?

    See:
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly
    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"

  • Load the document in Firefox (click gmail "Documents") error: The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    load document in Firefox (clicking gmail "Documents", error: "The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • "The page isn't redirecting properly, Firefox has detected that the server is redirecting the request for this address that will never complete" has anyone come across this staement?

    This statement pops up on some occasions when I am sending an Email, but the Emails are usually received by the recipient! who are mostly Family so I have been able to check that that have been read.

    Hi mawhitehead,
    try these
    * '''The page is not redirecting properly''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/The_page_is_not_redirecting_properly
    * '''Network.http.redirection-limit''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Network.http.redirection-limit
    * I am unable to access my gmail calender. It states that refused because of cookies being blocked.<br>https://support.mozilla.com/en-US/questions/786049
    * tried posting new thread on sourceforge shareaza forums, firefox gives problem loading page, <br>https://support.mozilla.com/en-US/questions/757368
    * Firefox has issues redirecting, cookies are all on, I think I voided my warranty. <br>https://support.mozilla.com/en-US/questions/755435
    * firefox message: &quot;The page isn't redirecting properly&quot; Firefox has detected that the server is redirecting the request for this address in a way that will never complete.<br>https://support.mozilla.com/en-US/questions/695393

  • WhenI send an email the following appears, the page isn`t redirecting properly, firefox has detected that the server is redirecting the request for this address in a way that will never complete

    firefox has detected that the server is redirecting the request for this address in a way that will never complete

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    See also:
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • "F.F. servr redirectng request for this adres" when enter Gmail URL in adr. bar to createTab. How 2 fix?

    When I entered the Gmail URL into the F.F. Address bar a pop-up tells me: "The Page isn't redirecting properly; F.F. has detected that the server is redirecting the request for this address in a way that will never complete."
    I installed G. Chrome a few days ago successfully, with a Gmail tab.
    However, I thought F.Fox will be more suitable, made it default browser, created three app tabs & Home Page, but was unable to create the G-mail Tab.
    I have read the Help & Support files > http://support.mozilla.org/en-US/kb/How-to-clear-firefox-cache?esab= and found the below info

    Hi hdellascala
    try to '''''clear cookies and cache''''' from '''Tools''' > '''Clear Recent History''' > '''Time range to clear''' select '''Everything''' > click on '''Details '''and check '''Cookies and Cache '''> '''Clear Now''' and check it again.
    '''also be sure you have ''check mark''''' in '''Accept cookies from sites[ v ]''' and to '''Accept third party cookies [ v ]'''
    see how to do that: [https://support.mozilla.org/en-US/kb/enable-and-disable-cookies-website-preferences#w_how-do-i-change-cookie-settings How do I change Cookie settings?]
    see also: [http://kb.mozillazine.org/The_page_is_not_redirecting_properly The page is not redirecting properly]
    thank you

  • Firefox has detected the server is redirecting the request for this address in a way that will never complete. This is happening in my email program with comcast but does not happen with IE e

    Question
    firefox has detected the server is redirecting the request for this address in a way that will never complete. This is happening in my email program with comcast but does not happen with IE e edit

    Thanks to cor-el for the suggestion given in the link. Sadly I have to report:
    1) It is not a bookmark problem and it makes no difference whether I put
    www.adobe.com or 192.150.18.117 in the address bar.
    2) Cookies are allowed and there are no exceptions set
    3) All cookies have been deleted
    4) network.http.sendRefererHeader is already set to 2
    That deals with the items in the linked document.
    Additional information:
    5) I can get into the adobe site from a clean "in memory" installation of PuppyLinux using Seamonkey using the same router and dhcp setup.
    6) un-installing all Mozilla products - rebooting and re-installing makes no difference even when I remove the mozilla folder from docs&settings.
    so as I said in previous post (as annonymous) not a lot makes sense.
    Bear in mind that I have no problem running tracert in a command window
    Tracing route to www.adobe.com [192.150.18.117] over a maximum of 30 hops:
    1 11 ms 10 ms 9 ms 10.0.0.1
    2 13 ms 12 ms 11 ms glo-2-dsl.as9105.net [212.74.111.191]
    3 13 ms 12 ms 11 ms ge1-2-27.glo0.as9105.net [212.74.106.106]
    4 14 ms 12 ms 13 ms pos0-0.bri1.as9105.net [212.74.108.162]
    5 17 ms 16 ms 17 ms ge0-0-0.he-lon0.as9105.net [212.74.109.14]
    6 17 ms 17 ms 16 ms 10.72.11.75
    7 16 ms 17 ms 17 ms xe-0-3-0-10.lon20.ip4.tinet.net [213.200.77.177]
    8 91 ms 92 ms 99 ms xe-5-1-0.was12.ip4.tinet.net [89.149.184.34]
    9 92 ms 92 ms 93 ms xe-0.equinix.asbnva01.us.bb.gin.ntt.net [206.223.115.12]
    10 162 ms 170 ms 162 ms as-3.r20.snjsca04.us.bb.gin.ntt.net [129.250.2.167]
    11 166 ms 166 ms 165 ms ae-1.r07.snjsca04.us.bb.gin.ntt.net [129.250.5.53]
    12 162 ms 163 ms 161 ms xe-0-2-0-3.r07.snjsca04.us.ce.gin.ntt.net [128.241.219.86]
    13 166 ms 163 ms 161 ms 192.150.18.11
    14 166 ms 166 ms 165 ms www.adobe.com [192.150.18.117]
    Trace complete.
    and I can ping the site.
    so where now ?

  • I can't access Facebook. I keep getting the "Firefox has detected that the server is redirecting the request for this address in a way that will never complete". I have cleared cache, cookies, history, offline storage. Nothing has worked.

    can't access Facebook. I keep getting the "Firefox has detected that the server is redirecting the request for this address in a way that will never complete". I have cleared cache, cookies, history, offline storage. Nothing has worked.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Firefox has detected that the server is redirecting the request for this address in a way that will never complete. *This problem can sometimes be caused by disabling or refusing to accept cookies. I followed the instructions for "redirection" issues.

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    In my experience this is most of the times a server issue of the website provider.
    Does this error occur on all Websites or just one specific Website?
    Does this Website load in Internet Explorer (or any other Browser?)?

  • Feedback request for a Single Instance Application Implementation

    Hello,
    I have been working on a class which I tried to make the most generic I could so that I could re-use it for various projects. It offers 2 main functionalities:
    -Preventing multiple instances of an application
    -Allowing a user to stop the application even if it doesn't read any user input
    Of course if someone wants to have multiple instances of the same application, it is still possible. The only requirement is that each instance be configured to run on a different port.
    I would like your feedback on how I've implemented this to make sure I haven't missed the chance to make my Class flexible and re-usable. I would also make sure that there aren't any situations where the different threads used for realizing this functionality will run into any conflicts.
    My code includes the following files:
    Serviceable.java : An interface which must be implemented by every application using these classes
    DuplicateServiceException.java : An exception thrown when an instance of the application is already running
    Service.java : The class responsible for offering the functionalities I already mentionned
    Main.java : An example of a class implementing Serviceable and offering two ways of closing the Application. 1- By closing the JFrame which is displayed. 2- By sending the stop command.
    In order to execute this example, you have to specify the following command line arguments:
    -DService.Command={start/stop} //Either start or stop command
    -DService.Port=<0-65535> //Port to be used for receiving the stop command and preventing multiple instances
    Serviceable.java
    * Serviceable cares about two parts of the life of a Service.  Its startup
    * and its shutdown sequences.  The startup occurs only after making sure
    * no other instance of the Service is running.  Shutdown has to be
    * synchronized between multiple threads since it is possible to shutdown
    * the service through a shutdown command sent by another process, or through
    * the normal flow of execution of the service.
    * @author Gabriel Aubut-Lussier
    public interface Serviceable {
          * Initiates the startup of the Service since we have made sure
          * that there isn't any other instance of the Service running.
         public void startup();
          * Initiates the shutdown of the Service since we've received
          * a shutdown request from one of the two supported means of
          * shutting down.
         public void shutdown();
    DuplicateServiceException.java
    public class DuplicateServiceException extends Exception {
          * serialVersionUID?  Bah. Eclipse generates one automatically so why not...
         private static final long serialVersionUID = 3929576386522489749L;
         public DuplicateServiceException() {
              super();
         public DuplicateServiceException(String msg) {
              super(msg);
    Service.java
    * The same way a graphical application is running as long as there
    * is something to display, a background service will run as long as
    * there is an active Thread.
    * A service can be terminated in different ways.  First of all, it
    * can be terminated through its normal flow of execution.  On the
    * other hand, it is possible to provoke the termination of a Service
    * externally.
    * To terminate the service through the normal flow, just call the
    * Service.shutdown() method.  Another way to terminate the service
    * is to start a new instance of the program with the Stop command.
    * This Service implementation will behave according to two system
    * properties.  The property Service.Command can be set
    * to "start" or "stop".  When set to "start", the Service will make
    * sure there isn't another instance of the service already running.
    * If it is the case, a DuplicateServiceException will be thrown.  In
    * the other case, the Service will start.  When the "stop" command
    * is invoked, the Service will attempt to stop a running instance of
    * the Service.  The other property is Service.Port and
    * it defines the Port number which will be used to support the
    * functionalities offered by the Service class.
    * It is recommended to set these properties as command line arguments
    * when launching the application.  Moreover, batch files or shell
    * scripts can be created for invoking the start and stop commands.
    * @author Gabriel Aubut-Lussier
    public class Service implements Runnable {
         public final static String START_COMMAND = "start";
         public final static String STOP_COMMAND = "stop";
         public final static String SERVICE_COMMAND = "Service.Command";
         public final static String SERVICE_PORT = "Service.Port";
         private String serviceCommand;
         private int servicePort;
         private Serviceable service;
         private ServerSocket serviceListener;
         private Thread serviceThread;
          * Creates a new service registering the hooks required to perform
          * clean termination sequences.
          * @param s
          * @throws DuplicateServiceException
         public Service(Serviceable s) throws DuplicateServiceException {
              service = s;
              serviceCommand = System.getProperty(SERVICE_COMMAND);
              String servicePortString = System.getProperty(SERVICE_PORT);
              if(servicePortString == null)
                   servicePort = -1;
              else
                   servicePort = Integer.parseInt(servicePortString);
          * Try running this new Service instance if there isn't one
          * already running.
          * @throws DuplicateServiceException if another service instance is already running.
         public void start() throws DuplicateServiceException {
              if(serviceCommand == null || servicePort < 0) {
                   throw new IllegalArgumentException("The command and port number must be specified.");
              if(serviceCommand.equals(START_COMMAND)) {
                   try {
                        serviceListener = new ServerSocket(servicePort);
                        serviceThread = new Thread(this);
                        serviceThread.start();
                        service.startup();
                   } catch(BindException e) {
                        throw new DuplicateServiceException("An instance of the service is already running.");
                   }catch(IOException e) {
                        e.printStackTrace();
              } else if(serviceCommand.equals(STOP_COMMAND)) {
                   shutdown();
          * Provoke a shutdown command.
         public void shutdown() {
              try {
                   Socket sock = new Socket("localhost", servicePort);
                   OutputStreamWriter out = new OutputStreamWriter(sock.getOutputStream());
                   out.write("shutdown");
                   out.flush();
                   out.close();
                   sock.close();
              } catch (UnknownHostException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   //This exception may occur when trying to stop a service which wasn't running.
                   //There is no need to do anything in this case.
          * While the Service is running, it listens on a port to make sure no
          * other instance of this Service is started and to listen to shutdown
          * commands.
         public void run() {
              boolean keepGoing = true;
              while(keepGoing) {
                   try {
                        Socket sock = serviceListener.accept();
                        InputStreamReader in = new InputStreamReader(sock.getInputStream());
                        char cBuf[] = new char[256];
                        int amount = in.read(cBuf);
                        in.close();
                        sock.close();
                        keepGoing = !((new String(cBuf, 0, amount)).equals("shutdown"));
                   } catch (IOException e) {
                        e.printStackTrace();
              try {
                   service.shutdown();
                   serviceListener.close();
              } catch(IOException e) {
                   e.printStackTrace();
         public String getServiceCommand() {
              return serviceCommand;
         public void setServiceCommand(String serviceCommand) {
              this.serviceCommand = serviceCommand;
         public int getServicePort() {
              return servicePort;
         public void setServicePort(int servicePort) {
              this.servicePort = servicePort;
    Main.java
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    public class Main implements Serviceable {
         private JFrame window;
         private Service service;
         public static void main(String[] args) {
              new Main();
         public Main() {
              try {
                   service = new Service(this);
                   service.start();
              } catch(DuplicateServiceException e) {
                   e.printStackTrace();
         public void startup() {
              window = new JFrame("SERVICE TEST! :D");
              window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              window.addWindowListener(new WindowAdapter() {
                   public void windowClosed(WindowEvent e) {
                        service.shutdown();
              window.setVisible(true);
         public void shutdown() {
              System.out.println("Application shutdown");
              window.dispose();
    }Thanks in advance for your feedback.
    -Gabriel Aubut-Lussier

    I have fixed the handshake.
    And even though it isn't implemented yet, I think I have my solution for the limitation of 1 instance per user. I plan on using a hidden file in the user's home directory in which I will write the port number where the running application is listening for events. I have not yet chosen how the port number will be chosen before being written to the file but I am thinking about using a random number between 1024 and 65535. Using this approach, it is possible to maintain all the features I've implemented in the Single Overall Instance solution I already have.
    Here is the code with the handshake fixed:
    Serviceable.java
    * Serviceable cares about two parts of the life of a Service.  Its startup
    * and its shutdown sequences.  The startup occurs only after making sure
    * no other instance of the Service is running.  Shutdown has to be
    * synchronized between multiple threads since it is possible to shutdown
    * the service through a shutdown command sent by another process, or through
    * the normal flow of execution of the service.  Moreover, when another instance
    * is prevented from being launched, the running instance is notified so that it
    * can react to such an event.
    * @author Gabriel Aubut-Lussier
    public interface Serviceable {
          * Initiates the startup of the Service since we have made sure
          * that there isn't any other instance of the Service running.
         public void startup();
          * Notifies the Service that the application has been invoked again in
          * case the running instance wants to react to such an event.  Most GUI
          * applications will just bring themselves to the front while background
          * services will maybe just want to re-scan their configuration files or
          * just ignore the event.
         public void invoke();
          * Initiates the shutdown of the Service since we've received
          * a shutdown request from one of the two supported means of
          * shutting down.
         public void shutdown();
    DuplicateInstanceException.java
    public class DuplicateServiceException extends Exception {
          * serialVersionUID?  Bah. Eclipse generates one automatically so why not...
         private static final long serialVersionUID = 3929576386522489749L;
         public DuplicateServiceException() {
              super();
         public DuplicateServiceException(String msg) {
              super(msg);
    Service.java
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.BindException;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.net.UnknownHostException;
    * The same way a graphical application is running as long as there
    * is something to display, a background service will run as long as
    * there is an active Thread.
    * A service can be terminated in different ways.  First of all, it
    * can be terminated through its normal flow of execution.  On the
    * other hand, it is possible to provoke the termination of a Service
    * externally.
    * To terminate the service through the normal flow, just call the
    * Service.shutdown() method.  Another way to terminate the service
    * is to start a new instance of the program with the Stop command.
    * This Service implementation will behave according to two system
    * properties.  The property Service.Command can be set to "start"
    * or "stop".  When set to "start", the Service will make sure there
    * isn't another instance of the service already running.  If it is
    * the case, a DuplicateServiceException will be thrown.  In the
    * other case, the Service will start.  When the "stop" command is
    * invoked, the Service will attempt to stop a running instance of
    * the Service.  The other property is Service.Port and it defines
    * the Port number which will be used to support the functionalities
    * offered by the Service class.
    * It is recommended to set these properties as command line arguments
    * when launching the application.  Moreover, batch files or shell
    * scripts can be created for invoking the start and stop commands.
    * @author Gabriel Aubut-Lussier
    public class Service implements Runnable {
         public final static String START_COMMAND = "start";
         public final static String STOP_COMMAND = "stop";
         public final static String SERVICE_COMMAND = "Service.Command";
         public final static String SERVICE_PORT = "Service.Port";
         private final static String GREETING = "Greetings";
         private final static String QUERY = "?";
         private final static String ACCEPT = "yes";
         private final static String DECLINE = "no";
         private final static String SHUTDOWN = "shutdown ";
         private final static int SO_TIMEOUT = 100;
          * This is the application-specific String
         private String serviceClass;
          * This is the command which we will execute when start() is invoked
          * The value is either "start" or "stop"
          * This value can be configured using the System property: Service.Command
         private String serviceCommand;
          * This is the port which is used to watch for duplicate instances
          * This value can be configured using the System property: Service.Port
         private int servicePort;
         private Serviceable service;
         private ServerSocket serviceListener;
         private Thread serviceThread;
          * Creates a new service registering the hooks required to perform
          * clean termination sequences.
          * @param s A Serviceable class
          * @throws DuplicateServiceException If there is a duplicate instance running
         public Service(Serviceable s) throws DuplicateServiceException {
              service = s;
              serviceClass = s.getClass().toString();
              serviceCommand = System.getProperty(SERVICE_COMMAND);
              String servicePortString = System.getProperty(SERVICE_PORT);
              if(servicePortString == null)
                   servicePort = -1;
              else
                   servicePort = Integer.parseInt(servicePortString);
          * Try running this new Service instance if there isn't one
          * already running.
          * @throws DuplicateServiceException if another service instance is already running.
          * @throws BindException if another application is using the configured port.
         public void start() throws DuplicateServiceException, BindException {
              if(serviceCommand == null || servicePort < 0 || servicePort > 65535) {
                   throw new IllegalArgumentException("The command and port number must be specified.");
              if(serviceCommand.equals(START_COMMAND)) {
                   try {
                        serviceListener = new ServerSocket(servicePort);
                        serviceThread = new Thread(this);
                        serviceThread.start();
                        service.startup();
                   } catch(BindException e) {
                        queryOtherInstance();
                        throw e;
                   } catch(IOException e) {
                        e.printStackTrace();
              } else if(serviceCommand.equals(STOP_COMMAND)) {
                   shutdown();
          * Send the shutdown command to the running instance of the application.
         public boolean shutdown() {
              boolean shutdownSuccessful = false;
              try {
                   Socket sock = new Socket("localhost", servicePort);
                   sock.setSoTimeout(SO_TIMEOUT);
                   //If the greeting doesn't match, it's not a duplicate instance
                   //and we can't shut it down
                   InputStreamReader in = new InputStreamReader(sock.getInputStream());
                   OutputStreamWriter out;
                   if(receivedGreeting(in)) {
                        //Sending the shutdown command
                        out = new OutputStreamWriter(sock.getOutputStream());
                        out.write(SHUTDOWN + serviceClass);
                        out.flush();
                        //Read the confirmation
                        char cBuf[] = new char[1024];
                        int amount = in.read(cBuf);
                        String confirmation = new String(cBuf, 0, amount);
                        if(confirmation.equals(ACCEPT)) {
                             shutdownSuccessful = true;
                        out.close();
                   //Closing the connection
                   in.close();
                   sock.close();
              } catch (UnknownHostException e) {
                   //This exception shouldn't happen unless the loopback address doesn't exist?
              } catch (IOException e) {
                   //This exception may occur when trying to stop a service which wasn't running.
                   //There is no need to do anything in this case.
              return shutdownSuccessful;
          * Reads the greeting from the running instance we are interacting with.
          * @param in An InputStreamReader built on the Socket's InputStream
          * @return True if we received the expected greeting, false otherwise
          * @throws IOException if a problem occurs while receiving the greeting
         private boolean receivedGreeting(InputStreamReader in) throws IOException {
              //Reading the expected greeting from the server
              char cBuf[] = new char[1024];
              int amount = in.read(cBuf);
              String greeting = new String(cBuf, 0, amount);
              return greeting.equals(GREETING);
          * While the Service is running, it listens on a port to make sure no
          * other instance of this Service is started and to listen to shutdown
          * commands.
         public void run() {
              boolean keepGoing = true;
              while(keepGoing) {
                   Socket sock;
                   InputStreamReader in;
                   try {
                        sock = serviceListener.accept();
                        sock.setSoTimeout(SO_TIMEOUT);
                        //Sending a greeting
                        OutputStreamWriter out = new OutputStreamWriter(sock.getOutputStream());
                        out.write(GREETING);
                        out.flush();
                        //Reading the incoming message
                        in = new InputStreamReader(sock.getInputStream());
                        char cBuf[] = new char[1024];
                        int amount = in.read(cBuf);
                        String message = new String(cBuf, 0, amount);
                        //Writing an answer
                        boolean invoked = message.equals(serviceClass + QUERY);
                        if(invoked) {
                             out.write(ACCEPT);
                        } else {
                             out.write(DECLINE);
                             keepGoing = !message.equals(SHUTDOWN + serviceClass);
                        out.flush();
                        //Closing the connection
                        out.close();
                        in.close();
                        sock.close();
                        //Notify the running application is there has been an invocation
                        if(invoked) {
                             service.invoke();
                   } catch (IOException e) {
                        //Seems like an IO operation failed.  Let's just forget about
                        //this connection attempt and wait for another
              //Shutdown the Service
              service.shutdown();
              try {
                   serviceListener.close();
              } catch(IOException e) {
                   //Couldn't close the serverSocket upon shutdown?
                   //weird... but anyhow...
          * Connects to the configured port to check out wether it is a duplicate
          * instance of the application or if it is another application using the
          * same port number.  If it is another application, nothing will happen.
          * @throws DuplicateServiceException if it is a duplicate instance
         private void queryOtherInstance() throws DuplicateServiceException {
              try {
                   Socket sock = new Socket("localhost", servicePort);
                   sock.setSoTimeout(SO_TIMEOUT);
                   //Read greeting
                   InputStreamReader in = new InputStreamReader(sock.getInputStream());
                   String answer = null;
                   if(receivedGreeting(in)) {
                        //Writing the application-specific query
                        OutputStreamWriter out = new OutputStreamWriter(sock.getOutputStream());
                        out.write(service.getClass().toString() + "?");
                        out.flush();
                        //Reading the answer
                        char[] cBuf = new char[3];
                        int amount = in.read(cBuf);
                        answer = new String(cBuf, 0, amount);
                        out.close();
                   //Closing the connection
                   in.close();
                   sock.close();
                   //If the answer is "yes" then it is a duplicate
                   if(answer != null && answer.equals("yes")) {
                        throw new DuplicateServiceException("An instance of the service is already running.");
              } catch (UnknownHostException e) {
                   //This exception shouldn't happen unless the loopback address doesn't exist?
              } catch (IOException e) {
                   //If we fail to query the application appropriately we consider
                   //it isn't a duplicate entry so we do nothing.
         public String getServiceCommand() {
              return serviceCommand;
         public void setServiceCommand(String serviceCommand) {
              this.serviceCommand = serviceCommand;
         public int getServicePort() {
              return servicePort;
         public void setServicePort(int servicePort) {
              this.servicePort = servicePort;
    Main.java
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.net.BindException;
    import javax.swing.JFrame;
    public class Main implements Serviceable {
         private JFrame window;
         private Service service;
         public static void main(String[] args) {
              new Main();
         public Main() {
              try {
                   service = new Service(this);
                   service.start();
              } catch(DuplicateServiceException e) {
                   e.printStackTrace();
              } catch(BindException e) {
                   e.printStackTrace();
         public void startup() {
              window = new JFrame("SERVICE TEST! :D");
              window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              window.addWindowListener(new WindowAdapter() {
                   public void windowClosed(WindowEvent e) {
                        service.shutdown();
              window.setVisible(true);
         public void shutdown() {
              System.out.println("Application shutdown");
              window.dispose();
         public void invoke() {
              System.out.println("Another instance tried to startup");
              window.toFront();
    }

Maybe you are looking for

  • Issues on the Lumia 800 with "WIFI" and "Mobile ne...

    I keep my Lumia 800 on 2G/E at all times usually to conserve battery life, and because i'm at work with a wifi connection all day..occasionally when i go out i like to turn on the 3G and use the map functions etc. The problem occurs after a while tha

  • Instantiation of objects -- create new space inmemory?

    If I have this: lPerson : person = new; lPerson.name.setValue('Martin'); lPerson.phone.setValue('2762109'); lPerson = new; Does this second instantiation create a new copy of "lPerson" in memory? Does it destroy the old? Does it create and destroy in

  • Calling Session Beans in JSP ?

    Hi Folks, I am new to EJB3, I am doing simple applicatuions. Can any one please tell me how to call session beans in jsp page. for example my case is.. iam entering two diffrent data, lets say user name and password in jsp page and this should go in

  • Problem in Starting Default Domain

    Hi, I am facing a problem while starting default domain, Its showing me the following statement: Starting Domain domain1, please wait. Log redirected to D:\Sun\AppServer\domains\domain1\logs\server.log. Domain domain1 failed to startup. Please check

  • External iSight camera

    Is there any way to disable the built in Isight camera and use an external one instead? I've tried an external isight cam and opened Ichat and it says the camera is disabled. When I also connect the external one it's light goes on then off. Any ideas