An rmi client server design problem

I am implementng a networked cards game in java using rmi . The server keeps track of the turn of the players and activates ther clients(on an applet) whose turn it is to play .
Both client and server call each others methods.
Prblem one :
Right now if a a client disconnects , a process run through all the clients active and gets a remote exception on the server and removes ALL the 4 players i nthat particulat group. If I want to save the state and allow any player to contuniue from there , how will I do it?
Problem 2:
How do I keep track of the time a client takes to play.
If he takes longer than say 5 mintes , I should disconnect him.

There seem to be two issues at stake: <b>catching the remote exception</b> and <b>multithreading</b> your application on the server.
When a client disconnects "suddenly" (without logging off via remote method call to alert server), the remote method call by the server to all <i>n</i> players triggers a remote exception that must be caught and dealt with accordingly (do I understand that it is causing the application to exit at present?) When caught, you must identify which player is "gone" and remove that client from the pool of client objects.
Right now, it sounds as if the app is NOT multithreaded. You can create a low-priority thread that looks at a time variable for each player to determine its last moment of play. This means every successful remote call from client-server or vice-versa will update that client's 'lastplayed' variable with (long) System.currentTimeMillis() for example.

Similar Messages

  • Client/socket design problem

    i am having a client /server design where in the client talks to the server via sockets and i am putting code ofboth the client as well as server in the different loop while(true) at respective ends so that they can talk as long as they would like to but the client hangs upon receiving response from server . please guide me what to do.
    the client side code is
    while(true)
    temp1=clientbfr.readLine();
    //System.out.println(temp);
    if(temp1==null)
    else if(temp1.indexOf("Login-")==0)
    System.out.println(temp1);
    temp1="";
    the server side code is the same and that works fine. again if a second clinet requests a socket to the server then that client also hangs. so i think i am not able to view the picture properly. please guide me.

    Is the server reading before writing? If so, the client will hang until it has sent something for the server to reply to.

  • HTTP Client/Server program problems

    Hi all,
    I am doing an exercise in which I create a Client and Server program. I send a GET request but nothing seems to happen. There is obviously something I'm missing. Could it be a badly formed request? The code is below. Any help is appreciated.
    Client program.....
    import java.io.*;
    import java.net.*;
    import java.util.StringTokenizer;
    public class HTTPClient{
        String host, path;
        int port;
        public static void main (String argv[]){
         new HTTPClient(argv[0]);
        public HTTPClient(String url){
         try{
             URL myURL = new URL(url);
             host = myURL.getHost();
             port = myURL.getPort();
             System.out.println("Port = " + port);
             if (port == -1) port = 30280;;
             path = myURL.getPath();
             if (path.equals("")) path =  "/";
             Socket s = new Socket(InetAddress.getByName(host), port);
             sendRequest(s.getOutputStream());
             printResponse(s.getInputStream());
             s.close();
         catch(MalformedURLException murl){
             System.out.println("Badly formatted URL " + murl.getMessage());
         catch(IOException e){
             System.out.println("Problem initialising socket " + e.getMessage());
        public void sendRequest(OutputStream out){
              StringBuffer buf = new StringBuffer();
              buf.append("GET /AC095.html HTTP/1.1\r\n");
              buf.append("Host: http://students.odl.qmul.ac.uk\r\n\r\n");
              try{
                   out.write(buf.toString().getBytes("US-ASCII"));
              catch (IOException e) {System.out.println(e.getMessage());
        public void printResponse(InputStream in){
             try{
                  while (in.available() <= 0)
                  Thread.sleep(500);
                  while (in.available() > 0)
                  System.out.print((char) in.read());
                  System.out.println ("");
             catch (IOException e) {
                  System.out.println(e.getMessage());
             catch (InterruptedException ie) {
                  System.out.println("Error waiting for response " + ie.getMessage());
         /* Read in the response from the HTTP server and print it out */
    }Server code......
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class HTTPServer{
        String version = null;
         public String httpVer;
        public static void main(String argv[]){
         new HTTPServer(Integer.parseInt(argv[0]));
        public HTTPServer(int port){
         boolean listening = true;
         try{
              ServerSocket ss = new ServerSocket(port);
              System.out.println("HTTP Server running and listening for requests...");
              while (listening){
               Socket mySocket = ss.accept();
               InputStream in   = mySocket.getInputStream();
               readHeaders(in);
               String response = getResponse();
               OutputStream out = mySocket.getOutputStream();     
               out.write(response.getBytes("US-ASCII"));
               out.flush();
               mySocket.close();
          catch(Exception e){System.out.println(e.getMessage());}
        private String getResponse(){
             StringBuffer responseBuf = new StringBuffer();
             responseBuf.append (httpVer + " 200 OK\r\n");
             responseBuf.append ("Content-type: text/html\r\n");
             responseBuf.append ("Content-length: 119\r\n");
             responseBuf.append ("<HTML>\r\n");
             responseBuf.append ("<TITLE> My served web document </TITLE>\r\n");
             responseBuf.append ("</HEAD>\r\n");
             responseBuf.append ("<BODY>\r\n");
             responseBuf.append ("<H1> Hello from the server! </H1>\r\n");
             responseBuf.append ("</BODY>\r\n");
             responseBuf.append ("</HTML>\r\n\r\n");
             String responseStr = responseBuf.toString();
             responseStr = responseStr.trim();
         return "";
        private void readHeaders(InputStream in) throws IOException {
         StringBuffer sbuf = new StringBuffer();
         int ch;
         String clientStr;
         //This loop reads in all of the input until there is nothing left to read.
         //All of the characters are appended to the string buffer.
         while ((ch = in.read()) != -1) {
              sbuf.append((char) ch);
         //clientStr will hold string in string buffer without any leading or
         //trailing white space.
         clientStr = sbuf.toString();
         clientStr = clientStr.trim();
         //Split clientStr into substrings and store them in an array.
         String [] tokens = clientStr.split(" ");
         //Obtains HTTP version
         httpVer = tokens [2];
    }Cheers,
    Chris

    I've written out.flush() in the server program. When I attempt to connect to the server it just hangs. I've modified the code locally to request a webpage from elsewhere and it works so it can't be the format of my GET request. I assume that the problem has to be in the Server program. Is it not reading in and understanding the /r/n properly?

  • Client Server Thread Problems

    When I invoke the method getNextJob() in my Client.
    This sends a this message (CLNT::GETNEXTJOB) to the server which then triggers the Server to invoke the corresponding method and send back another message. (Which as far as I know it does).
    My problem is this, when I run the getNextJob() method a thread is supposed to be created and ran in parallel which listens for the Servers reply and unfortunately this thread keeps telling me that its get a NullPointerException (specifically at my Socket connection clientSocket). If I uncomment out this.openConnection(); within my run() method it works BUT I get no response from my server even though it is telling me it has sent a message.
    I hope you can help.
    OUTPUTTED TEXT
    CLIENT:  Building GUI
    CLIENT:  Get Next Job Invoked
    CLIENT:  Opening Connection
    CLIENT:  Socket is now OPEN
    CLIENT:  Listerner Loaded
    Exception in thread "Thread-2" java.lang.NullPointerException
    CLIENT ->CLNT::GETNEXTJOB JAVA CODE
    package Client;
    import java.net.*;
    import java.io.*;
    public class Kernel implements Runnable {
        //Socket Variables & Streams
        Socket clientSocket;
        //variables
        private boolean msgReceived = true;
        private String faultNumber;
        //listening thread
        public void run()  {
                String serverMessage = "ERROR: run";
                System.out.println("CLIENT:  Listerner Loaded");
                //builds listener
                try {
                     //this.openConnection();
                    //opens socket connection
                     BufferedReader in = new BufferedReader(
                                                    new InputStreamReader(
                                                    this.clientSocket.getInputStream()));
                     BufferedReader stdIn = new BufferedReader(
                                                    new InputStreamReader(
                                                    System.in));
                    while((stdIn.readLine()) != null) {
                        System.out.println("CLIENT:  Listener Received Line = " + stdIn.readLine());
                        serverMessage = stdIn.readLine();
                   System.out.println(in.readLine());
                    msgReceived = false;
                    in.close();
                    stdIn.close();
                } catch(IOException e) {System.err.println("Error Details:" + e);}
                //sets current Tail to new value returned
                this.setCurrentTail(serverMessage);
       private void openConnection() throws IOException{
            try {
                System.out.println("CLIENT:  Opening Connection");
                this.clientSocket = new Socket("localhost", 4444);
            } catch (UnknownHostException e) {
                System.err.println("CLIENT:  Host not found");
                System.exit(1);
            } catch (IOException e) {
                System.err.println("CLIENT:  Couldn't get I/O for the connection to: Brenda.");
                System.exit(1);
        public String getNextJob()
            System.out.println("CLIENT:  Get Next Job Invoked");
            try{
                //opens socket connection
                this.openConnection();
                //waits for the socket to open
                System.out.println("CLIENT:  Socket is now OPEN");
                //invokes Listener
                (new Thread(new Kernel())).start();
                //sends a message
                this.sendMessage("CLNT::GETNEXTJOB");
                //waits for a reply from the server
                //while(msgReceived){}
                //closes socket connection
                //this.closeConnection();
            }catch (IOException e) {
                System.err.println("Couldn't get I/O for the connection to: taranis.");
                System.exit(1);
            return this.getCurrentTail();
        private void setCurrentTail(String tail) {
            this.faultNumber = tail;
        private String getCurrentTail() {
            return this.faultNumber;
        private void closeConnection()
            try{
                clientSocket.close();
                System.out.println("CLIENT:  Connection Closed");
            }catch (IOException e) {e.printStackTrace();}
        private void sendMessage(String strMessage){
                try{
                    PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
                    out.println(strMessage);
                    System.out.println("CLIENT ->" + strMessage);
                    //Closes output stream.
                    out.close();
                }catch(IOException e){System.err.println(e);}
    }Edited by: DaveyB on Sep 2, 2009 3:19 PM

    I have made some modifications based on the above information but I have hit another brick wall.
    The below code returns this to the output pane:
    run:
    CLIENT:  Building GUI
    CLIENT:  Get Next Job Invoked
    Never Reached Statement Within getNext StartValue
    CLIENT:  Listerner Loaded
    CLIENT:  Opening Connection
    CLIENT ->CLNT::GETNEXTJOB
    STATEMENT NEVER REACHED
    null
    ErrorWhat you can see is the CLIENT sets up the connection and invokes the Listener thread (run). When this is ran it hits the while loop and even when a non null value is returned via the .ReadLine() as shown via the second value in the output pane {'null', 'Error'} it doesn't exit the loop.
    Any ideas why this would be.
    package webtoolclient;
    import java.net.*;
    import java.io.*;
    public class Kernel implements Runnable {
        //Socket Variables & Streams
        Socket clientSocket = null;
        BufferedReader in = null;
        PrintWriter out = null;
        //variables
        private String faultNumber = "StartValue";
        private boolean isListenerLoaded = false;
        //listening thread
        public void run()  {
                //String serverMessage = "ERROR: run";
                System.err.println("CLIENT:  Listerner Loaded");
                //builds listener
                try {
                    //opens socket connection
                    this.openConnection();
                    //sends a message
                    this.sendMessage("CLNT::GETNEXTJOB");
                    //creates inputstreams
                     in = new BufferedReader(
                                                    new InputStreamReader(
                                                    this.clientSocket.getInputStream()));
                    String line = null; // in.readLine();
                    while((line = in.readLine()) != null){
                        System.out.println(line);
                    System.out.println("STATEMENT NEVER REACHED WITHIN THREAD line = " + line);
                    this.setCurrentTail(line);
                    this.isListenerLoaded = true;
                    //in.close();
                    //stdIn.close();
                    //this.closeConnection();
                } catch(IOException e) {System.err.println("Error In run: " + e);}
                //sets current Tail to new value returned
                //this.setCurrentTail(line);
       private void openConnection() throws IOException{
            try {
                System.err.println("CLIENT:  Opening Connection");
                this.clientSocket = new Socket("localhost", 4444);
            } catch (UnknownHostException e) {
                System.err.println("CLIENT:  Host not found");
                System.exit(1);
            } catch (IOException e) {
                System.err.println("CLIENT:  Couldn't get I/O for the connection to: Brenda.");
                System.exit(1);
        public String getNextJob()
            System.err.println("CLIENT:  Get Next Job Invoked");
            //try{
                //opens socket connection
                //this.openConnection();
                //waits for the socket to open
               //System.err.println("CLIENT:  Socket is now OPEN");
                //invokes Listener
                new Thread(this).start();
                //ensures Listerner is open before message is sent.
                while(this.isListenerLoaded){}
                //waits for a reply from the server
                //while(this.getCurrentTail().equals("StartValue")){}
                System.err.println("Never Reached Statement Within getNext " + this.getCurrentTail());
                //closes socket connection
                //this.closeConnection();
                return this.getCurrentTail();
            /*}catch (IOException e) {
                System.err.println("Couldn't get I/O for the connection to: taranis.");
                System.exit(1);
           //return this.getCurrentTail();
        private void setCurrentTail(String tail) {
            this.faultNumber = tail;
        private String getCurrentTail() {
            return this.faultNumber;
        private void closeConnection()
            try{
                clientSocket.close();
                System.err.println("CLIENT:  Connection Closed");
            }catch (IOException e) {e.printStackTrace();}
        private void sendMessage(String strMessage){
               try{
                    out = new PrintWriter(clientSocket.getOutputStream(), true);
                    out.println(strMessage);
                    System.err.println("CLIENT ->" + strMessage);
                    //Closes output stream.
                    //out.close();
                }catch(IOException e){System.err.println(e);}
    }

  • Question about client/server design

    I designed a server for a particular service. On the client side, how could it know that the server is up and running? i.e. how to make the client know that the server with the particular service is available?
    Thanks.

    When client started, if use udp to check the serveres
    is running or not, I think it is difficult. For so
    many port and so many serveres, how can you check?A single defined port is used for the service query. Regardless of what you do something must be defined ahead of time.
    DHCP works this way. When the client starts up it does not even have an IP address. There is a defined DHCP port for this (which is actually configurable on server and client but is seldom changed from the default.)
    >
    So my suggestion is that when server started, it
    register itselfto a central server. Then central
    server will send some common request to those
    registered server. If some registered server cannot
    work, they will be removed from central server.Yes you can use a service manager process. Even with that process it will still require a defined port though.
    Services could be registered using push, pull or both. Normal the following interactions would occur for this system.
    - On start up the client service must locate the manager server. It can either use a broadcast or configured location.
    - Once the server is located the client service registers itself and the services it provides with the manager.
    - Finally some polling logic is needed to very that each end is still alive. One end (A) sends a poll message and the other(B) responds. If there is no response then A takes some action. And if B does not recieve a poll message after a given period it takes some action.

  • Client Server Application Problem ;

    Data is not received to two clients simultaneously . Data is received correctly to first connected client only

    Shahid,
    what you are listing is VI Server access. This is not intende for data transfer but for "remote control".
    Do you have dedicated LV applications which should "talk to each other" or  do you use web interface (Web Publishing Tool)?
    Can you post the code for the server/client?
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Multi-client Server Design

    Hello all,
    I'm really looking for best practices on multi-client UDP or TCP servers. In reading the java tutorials, it seems like the way to go for multi-client TCP servers is a threaded application, with threads for each client connection. I haven't found out what one would do for a multi-client UDP application....
    Anyways, I was hoping you might be able to point me to some tutorials/online learning resources that deal in design/best-practices.

    Hello all,
    I'm really looking for best practices on multi-client UDP or TCP servers. In reading the java tutorials, it seems like the way to go for multi-client TCP servers is a threaded application, with threads for each client connection. I haven't found out what one would do for a multi-client UDP application....
    Anyways, I was hoping you might be able to point me to some tutorials/online learning resources that deal in design/best-practices.

  • Quartz schedular problem accessing thru RMI client

    Hi,
    I am trying to access Quartz scheduler through RMI client/server.
    Quartz scheduler RMI is starting up properly.
    When I run the RMI client I am receiving the following error.
    =================================================================
    org.quartz.SchedulerException: Error communicating with remote scheduler. [See nested exception: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
         java.io.InvalidClassException: oracle.classloader.util.AnnotatedNoClassDefFoundError; local class incompatible: stream classdesc serialVersionUID = -4364152148004017014, local class serialVersionUID = -687990861161016914]
         at org.quartz.impl.RemoteScheduler.invalidateHandleCreateException(RemoteScheduler.java:135)
         at org.quartz.impl.RemoteScheduler.scheduleJob(RemoteScheduler.java:335)
         at net.nighttale.scheduling.rmi.QuartzClient.main(QuartzClient.java:17)
    * Nested Exception (Underlying Cause) ---------------
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
         java.io.InvalidClassException: oracle.classloader.util.AnnotatedNoClassDefFoundError; local class incompatible: stream classdesc serialVersionUID = -4364152148004017014, local class serialVersionUID = -687990861161016914
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
         at org.quartz.core.QuartzScheduler_Stub.scheduleJob(Unknown Source)
         at org.quartz.impl.RemoteScheduler.scheduleJob(RemoteScheduler.java:332)
         at net.nighttale.scheduling.rmi.QuartzClient.main(QuartzClient.java:17)
    Caused by: java.io.InvalidClassException: oracle.classloader.util.AnnotatedNoClassDefFoundError; local class incompatible: stream classdesc serialVersionUID = -4364152148004017014, local class serialVersionUID = -687990861161016914
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836
    =============================================================
    My client and server quartz properties are as follows.
    Client properties
    org.quartz.scheduler.instanceName = DefaultQuartzScheduler
    org.quartz.scheduler.rmi.proxy = true
    org.quartz.scheduler.rmi.registryHost = 127.0.0.1
    org.quartz.scheduler.rmi.registryPort = 1098
    Server properties
    # Default Properties file for use by StdSchedulerFactory
    # to create a Quartz Scheduler Instance, if a different
    # properties file is not explicitly specified.
    org.quartz.scheduler.instanceName = DefaultQuartzScheduler
    #org.quartz.scheduler.instanceName = Sched1
    org.quartz.scheduler.rmi.export = true
    #org.quartz.scheduler.rmi.proxy = false
    org.quartz.scheduler.rmi.registryHost = 127.0.0.1
    org.quartz.scheduler.rmi.registryPort = 1098
    org.quartz.scheduler.rmi.createRegistry = true
    org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
    org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
    org.quartz.threadPool.threadCount = 10
    org.quartz.threadPool.threadPriority = 5
    org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
    org.quartz.jobStore.misfireThreshold = 5000
    #org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
    org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
    org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
    org.quartz.jobStore.useProperties = false
    org.quartz.jobStore.dataSource = demoDS
    org.quartz.jobStore.tablePrefix = QRTZ_
    org.quartz.jobStore.isClustered = false
    #============================================================================
    # Configure Datasources
    #============================================================================
    org.quartz.dataSource.demoDS.driver = oracle.jdbc.driver.OracleDriver
    org.quartz.dataSource.demoDS.URL = jdbc:oracle:thin:@demou.abc.com:1521:orcl
    org.quartz.dataSource.demoDS.user = demo
    org.quartz.dataSource.demoDS.password = oracle
    org.quartz.dataSource.demoDS.maxConnections = 5
    org.quartz.dataSource.demoDS.validationQuery=select 0 from dual
    #org.quartz.dataSource.demoDS.validationQuery=select lock_name from qrtz_locks where lock_name = 'TRIGGER_ACCESS'
    #============================================================================
    # Configure Plugins
    #============================================================================
    # Uncomment the following to get logging of job execution events...
    #org.quartz.plugin.jobHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin
    # Uncomment the following to get logging of trigger firing events...
    #org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
    #============================================================================
    # Configure Listeners
    #============================================================================
    #org.quartz.jobListener.dummy.class = org.quartz.examples.DumbJobListener
    Appreciate your quick response.
    Regards,
    Nishi

    What I did today is that we connected the client PC directly with the server through a switch. So keep in mind please, that for the following informations there is no firewall involved whatsoever.
    I've just checked the communication log on the server with the microsoft network monitor. the communication proceedes in the following manner:
    1) the client calls the server from a random source port(src) onto the specified destination port(dst) 1088.
    2) the server application replies from (src)1088 to (dst)1052.
    3) now comes two client calls again from (src)1052 to (dst)1088.
    4) and then the server sends something two times from 1088 to 1052
    and that's it! end of communication. of course then it comes the above mentioned error.
    What the most amazes me is that although I explicitly specify for the client as well, that the rmi registry should be available on the remote port 1088, still it uses a random port (in this case 1052). Could this be alright? After all, what port the client uses to reach for the remote registry could be random I guess...
    What I see on the client side with the trace prints is that during the client initialization first a connection will be made on a local machine with port # -1 and just after that calls the remote server. But in that case I don't get it why it prints the 1088 if under the hood is a 1052 or other random port...
    Meanwhile, on the server side I get a trace message from the custom security manager that an accept on the random port (1052) has been successful. but after that no more printouts.
    Oh, and one more thing... did I mentioned that I implemented a pure socket client/server thingy and it works just fine? with or without firewall.

  • Client server protocol book

    Hi, i want to create a program with applet clients communicating each other by a server. I'm looking for a book about a protocol for this purpuse. Thanks

    No recommendations, but note that you're dealing with a lot of parts:
    1) Java generally
    2) Java applets in particular
    3) the HTTP protocol
    4) server-side programming
    5) (if you feel it's necessary) client/server design in general
    There will be books on all of these. The more you know in general is a good thing, but I suspect that you can skip (5), get just a brief overview of (3), make sure you know (1), and read a tutorial on this site for (2). The trickier part will probably be (4).

  • Client/server RMI app using Command pattern: return values and exceptions

    I'm developing a client/server java app via RMI. Actually I'm using the cajo framework overtop RMI (any cajo devs/users here?). Anyways, there is a lot of functionality the server needs to expose, all of which is split and encapsulated in manager-type classes that the server has access to. I get the feeling though that bad things will happen to me in my sleep if I just expose instances of the managers, and I really don't like the idea of writing 24682763845 methods that the server needs to individually expose, so instead I'm using the Command pattern (writing 24682763845 individual MyCommand classes is only slightly better). I haven't used the command pattern since school, so maybe I'm missing something, but I'm finding it to be messy. Here's the setup: I've got a public abstract Command which holds information about which user is attempting to execute the command, and when, and lots of public MyCommands extending Command, each with a mandatory execute() method which does the actual dirty work of talking to the model-functionality managers. The server has a command invoker executeCommand(Command cmd) which checks the authenticity of the user prior to executing the command.
    What I'm interested in is return values and exceptions. I'm not sure if these things really fit in with a true command pattern in general, but it sure would be nice to have return values and exceptions, even if only for the sake of error detection.
    First, return values. I'd like each Command to return a result, even if it's just boolean true if nothing went wrong, so in my Command class I have a private Object result with a protected setter, public getter. The idea is, in the execute() method, after doing what needs to be done, setResult(someResult) is called. The invoker on the server, after running acommand.execute() eventually returns acommand.getResult(), which of course is casted by the client into whatever it should be. I don't see a way to do this using generics though, because I don't see a way to have the invoker's return value as anything other than Object. Suggestions? All this means is, if the client were sending a GetUserCommand cmd I'd have to cast like User user = (User)server.executeCommand(cmd), or sending an AssignWidgetToGroup cmd I'd have to cast like Boolean result = (Boolean)server.executeCommand(cmd). I guess that's not too bad, but can this be done better?
    Second, exceptions. I can have the Command's execute() method throw Exception, and the server's invoker method can in turn throw that Exception. Problem is, with a try/catch on the client side, using RMI (or is this just a product of cajo?) ensures that any exception thrown by a remote method will come back as a java.lang.reflect.InvocationTargetException. So for example, if in MyCommand.execute() I throw new MySpecialException, the server's command invoker method will in turn throw the same exception, however the try/catch on the client side will catch InvocationTargetException e. If I do e.getCause().printStackTrace(), THERE be my precious MySpecialException. But how do I catch it? Can it be caught? Nested try/catch won't work, because I can't re-throw the cause of the original exception. For now, instead of throwing exceptions the server is simply returning null if things don't go as planned, meaning on the client side I would do something like if ((result = server.executeCommand(cmd)) == null) { /* deal with it */ } else { /* process result, continue normally */ }.
    So using the command pattern, although doing neat things for me like centralizing access to the server via one command-invoking method which avoids exposing a billion others, and making it easy to log who's running what and when, causes me null-checks, casting, and no obvious way of error-catching. I'd be grateful if anyone can share their thoughts/experiences on what I'm trying to do. I'll post some of my code tomorrow to give things more tangible perspective.

    First of all, thanks for taking the time to read, I know it's long.
    Secondly, pardon me, but I don't see how you've understood that I wasn't going to or didn't want to use exceptions, considering half my post is regarding how I can use exceptions in my situation. My love for exception handling transcends time and space, I assure you, that's why I made this thread.
    Also, you've essentially told me "use exceptions", "use exceptions", and "you can't really use exceptions". Having a nested try/catch anytime I want to catch the real exception does indeed sound terribly weak. Just so I'm on the same page though, how can I catch an exception, and throw the cause?
    try {
    catch (Exception e) {
         Throwable t = e.getCause();
         // now what?
    }Actually, nested try/catches everywhere is not happening, which means I'm probably going to ditch cajo unless there's some way to really throw the proper exception. I must say however that cajo has done everything I've needed up until now.
    Anyways, what I'd like to know is...what's really The Right Way (tm) of putting together this kind of client/server app? I've been thinking that perhaps RMI is not the way to go, and I'm wondering if I should be looking into more of a cross-language RPC solution. I definitely do want to neatly decouple the client from server, and the command pattern did seem to do that, but maybe it's not the best solution.
    Thanks again for your response, ejp, and as always any comments and/or suggestions would be greatly appreciated.

  • Possible? Cilent-server multiple responses design problem!

    Hello friends,
    I have a problem that needs you kind help.
    I have a client-server problem. The client side is an application, and the server is a servlet/jsp program. Now I want that whenever user sends a request to the server to get data, the server can send a few responses back to clients. Note that these response data are not continuous generated by a program in the server, so I do not want to wait until all the responses are generated before sending them all to the clinet. The time to send back each response data varies from 10 milli-sec to 2-3 seconds currently.
    So any one has some experience of design on this kind of application?
    Thanks!

    In the client application, create a URL connection that connects to the JSP/Servlet. In a loop, repeatedly connect to the JSP/Servlet and read in the response. Come up with some kind of special response like '<response type="END"/>' that will signal the end of the input.

  • Client-Server side programing problem

    I designed a client-server program as seen below basis on serversocket and thread
    I use serversocket for making a host connection than people connect this socket via applet that i designed then they transffer data with socket.getInputStream() and socket.getOutputStream but it always happening between client and server how can i make theese streams transfer between clients is something like that possible if it is how?
    I couldnt send my hole java code because its too long and i wish i could explain my problem
        public void run()
            try
                servsocket = new ServerSocket(port);
                jTextArea1.append("Kullanici Girisi Bekleniyor.\n");
            catch(IOException e)
                jTextArea1.append("Sunucu Uzerinde Socket Acilamadi.\n");
                while(calisiyor)  //calisiyor variable is a boolean variable for checking if server is running
                    try
                    Socket sock = servsocket.accept();
                    background = new techsupportbackground(this,sock);
                    background.start();
                    catch(Exception e)
                        printstring("Hata:"+e);
                        break;
    this is the techsupportbackground classes run method it extends from thread
        public void run()
            if(!servicesetup()) return;
            support.printstring("Baglanti saglandi,kullanici basariyla giris yapti.");
            setPriority(MIN_PRIORITY);
            String sonmesaj = "";
            while(calisiyor)
                String mesaj = readinputline();
                if(mesaj == null) break;
                if (!sonmesaj.equals(mesaj))
                    support.printstring(username+"->"+mesaj);
                    sonmesaj = mesaj;
            cikis();
    and this is the client side program's run method
        public void run()
            try
                if(!doconnection())
                    client.printstring("Baglanti Saglanamadi:");
                    return;
            catch(Exception e)
                client.printstring("Baglanti Saglanamadi");
            while (calisiyor)
                String mesaj = readline();  //readline is the method which reads sockets input stream
                client.printstring(mesaj);
                    if (mesaj == null) break;
                    try {
                    Thread.sleep (client.timeupdate);
                    catch (InterruptedException e)
            if (server != null) closeserver();
            client.setdisconnected();
            client.printstring("Baglanti Koptu");

    I made two java file , one for server one for client
    server is working good openning the socket but the client is crashing when i attempt to connect to server
    here is my code if anyone could tell me where i made a mistake i would be very appreciate
    this is the client program
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class client extends javax.swing.JFrame {
        private boolean baglandi;
        private MulticastSocket socket;
        private int port;
        private String ip;
        String username;
        private InetAddress group;
        private String msg;
        private DatagramPacket datawriter;
        private byte[] reader;
        private boolean calisiyor;
        private JScrollPane scrollpane;
        public client() {
            initComponents();
            this.setSize(490,450);
            jTextArea1.setEditable(false);
            jTextField2.setEditable(false);
            jButton2.setEnabled(false);
            jLabel3.setForeground(Color.RED);
            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            panel.setBounds(0, 0, 480, 260);
            getContentPane().add(panel);
            scrollpane = new JScrollPane();
            scrollpane.getViewport().add(jTextArea1);
            panel.add(scrollpane,BorderLayout.CENTER);
            baglandi=false;
            ip="228.5.6.7";
            port=2222;
            try
            group = InetAddress.getByName(ip);
            msg ="";
            datawriter = new DatagramPacket(msg.getBytes(),msg.length(),group,port);
            calisiyor = false;
            catch(Exception e)
        private void initComponents() {
            jTextArea1 = new javax.swing.JTextArea();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jTextField1 = new javax.swing.JTextField();
            jTextField2 = new javax.swing.JTextField();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jLabel3 = new javax.swing.JLabel();
            getContentPane().setLayout(null);
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            getContentPane().add(jTextArea1);
            jTextArea1.setBounds(0, 0, 480, 260);
            jLabel1.setText("Kullanici Adi");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(0, 270, 90, 15);
            jLabel2.setText("Mesaj");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(0, 300, 60, 15);
            getContentPane().add(jTextField1);
            jTextField1.setBounds(100, 270, 290, 21);
            getContentPane().add(jTextField2);
            jTextField2.setBounds(100, 300, 290, 21);
            jButton1.setText("Gonder");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            getContentPane().add(jButton1);
            jButton1.setBounds(400, 270, 80, 25);
            jButton2.setText("Gonder");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            getContentPane().add(jButton2);
            jButton2.setBounds(400, 300, 80, 25);
            jButton3.setText("Durdur");
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
            getContentPane().add(jButton3);
            jButton3.setBounds(400, 340, 80, 25);
            jLabel3.setText("Baglanti Saglanamadi");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(0, 360, 130, 15);
            pack();
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
            durdur();
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
            printoutput();
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            baslat();
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new client().show();
        public void baslat()
            username = jTextField1.getText();
            try
                socket = new MulticastSocket(port);
                socket.joinGroup(group);
            catch(IOException e)
                jTextArea1.append("Guvenlik Engellemesi Sebebiyle Sunucuya Ulasilamadi.\n");
                return;
                    jTextArea1.append("Sunucuya Baglanildi");
                    baglandi = true;
                    calisiyor = true;
                    jLabel3.setText("Baglanti Saglandi");
                    jTextArea1.append("Sunucuya Basariyla Baglanildi\n");
                    jLabel3.setForeground(Color.GREEN);
                    jButton1.setEnabled(false);
                    jTextField1.setEditable(false);
                    jButton2.setEnabled(true);
                    jTextField2.setEditable(true);
                while (calisiyor)
                        String mesaj = readline();
                        printstring(mesaj);
                        if (mesaj == null) break;
        public void durdur()
            jTextField2.setEditable(false);
            jTextField1.setEditable(true);
            jButton2.setEnabled(false);
            jButton1.setEnabled(true);
            jLabel3.setText("Baglanti Saglanamadi");
            jLabel3.setForeground(Color.RED);
            try
                socket.leaveGroup(group);
            catch(Exception e)
        public void printoutput()
            try
            String mesaj = jTextField2.getText();
            jTextField2.setText("");
            writeline(username+":->"+mesaj);
            catch(Exception e)
                printstring("Veri Ulastirilamadi.");
        public void printstring(String s)
            jTextArea1.append(s+"\n");
        public void setdisconnected()
            jTextField2.setEditable(false);
            jTextField1.setEditable(true);
            jButton2.setEnabled(false);
            jButton1.setEnabled(true);
            jLabel3.setText("Baglanti Saglanamadi");
            jLabel3.setForeground(Color.RED);
            public String readline()
                byte[] buf = new byte[1000];
                DatagramPacket datapack = new DatagramPacket(buf,buf.length);
                try
                    socket.receive(datapack);
                    String mesaj = buf.toString();
                    return mesaj;
                catch(Exception e)
                    printstring("Sunucuya Ulasilamadi");
                    return null;
        public void writeline(String s) throws IOException
                try
                    msg = s;
                    socket.send(datawriter);
                    printstring(msg);
                catch(Exception e)
                    printstring("Mesaj ulastirilamadi.");
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextArea jTextArea1;
        private javax.swing.JTextField jTextField1;
        private javax.swing.JTextField jTextField2;
        // End of variables declaration
    this is the server program
    import java.net.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class techsupport extends javax.swing.JFrame implements ActionListener,Runnable {
        private MulticastSocket servsocket;
        private int port;
        private boolean calisiyor;
        private JScrollPane scrollpane;
        private techsupportbackground  background;
        private InetAddress group;
        public techsupport(String title) {
            super(title);
            initComponents();
            this.setSize(400,400);
            port=2222;
            jTextField1.addActionListener(this);
            jButton1.addActionListener(this);
            calisiyor=true;
            jTextArea1.setEditable(false);
            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            panel.setBounds(0,10,400, 230);
            getContentPane().add(panel);
            scrollpane = new JScrollPane();
            scrollpane.getViewport().add(jTextArea1);
            panel.add(scrollpane,BorderLayout.CENTER);
                try
                group = InetAddress.getByName("228.5.6.7");
                catch(Exception e)
        private void initComponents() {
            jTextArea1 = new javax.swing.JTextArea();
            jButton1 = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            jButton2 = new javax.swing.JButton();
            jTextField1 = new javax.swing.JTextField();
            getContentPane().setLayout(null);
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            getContentPane().add(jTextArea1);
            jTextArea1.setBounds(0, 10, 400, 230);
            jButton1.setText("Start");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            getContentPane().add(jButton1);
            jButton1.setBounds(160, 260, 80, 25);
            jLabel1.setText("Port");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(0, 240, 120, 15);
            jButton2.setText("Stop");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            getContentPane().add(jButton2);
            jButton2.setBounds(250, 260, 90, 25);
            getContentPane().add(jTextField1);
            jTextField1.setBounds(0, 260, 130, 21);
            pack();
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
            try
            servsocket.close();
            jButton1.setEnabled(true);
            printstring("Port Kapatildi.");
            jTextArea1.setText("");
            catch(Exception e)
                printstring("Hata:"+e);
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
        public static void main(String args[]) {
            new techsupport("Teknik Destek Sunucu").show();
        public void actionPerformed(ActionEvent e) {
            boolean status = false;
            String komut = e.getActionCommand();
                if (komut.equals("Start"))
                    try
                        port = Integer.parseInt(jTextField1.getText());
                        jButton1.setEnabled(false);
                    catch(NumberFormatException err)
                        jTextArea1.append("Hatali Port Numarasi"+"\n");
                        jButton1.setEnabled(true);                   
                    Thread uygulama = new Thread(this);
                    uygulama.start();
                else if (komut.equals("Stop"))
                    calisiyor=false;
                    dispose();
        public void run()
            try
                servsocket = new MulticastSocket(port);
                servsocket.joinGroup(group);
                jTextArea1.append("Kullanici Girisi Bekleniyor.\n");
            catch(IOException e)
                jTextArea1.append("Sunucu Uzerinde Socket Acilamadi.\n"+e.toString());
        public void printstring(String s)
            jTextArea1.append(s+"\n");
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JTextArea jTextArea1;
        private javax.swing.JTextField jTextField1;
        // End of variables declaration
    }

  • Client-Server using RMI on Win2000

    I have a client server application using RMI that works on Win NT4.0 when I am connected
    to a network or when the it is not connected (workstation is client and server).
    This same application does not work as a standalone (not connected to network) when running
    on Win2000. I've been able to start the server (still under Win2000) by adding a Microsoft
    Loopback Adapter but the client do (can) not communicate ( see) the server(s) at all.
    Does anyone knows the difference between WinNT4.0 and Win2000 network,
    configure Win2000 for client-server on RMI loopback?
    Thanks,
    Isagani

    Yes, I did. But let me expand on the problem and observations.
    Running under Win2000 and connected to the network and working.
    - I use netstat -n (a util ) to see how my application is running when it is working.
    The port (1101) the apps uses eventually loops back to the system and the app is able
    create the multicast sockets it needs and can join the group. And everyone is happy.
    When not connected to the network, port 1101 makes a connection back to the system
    but somehow the system breaks the loop back, basically throwing an exception.
    I do not these problem with WinNT4.0
    Any ideas?
    Thanks,
    Isagani

  • Design Pattern for multithreaded client server program

    I asked this question in another post, but with other stuff, so I'll distill this one.
    I am creating a multi-threaded client server program (just for learning - a chat program at this point). I built the server and client in swing, and I'm wondering what the best design pattern is for this setup. Right now all the swing stuff is in the MyServer class. In that class I have a loop accepting client connections to the serverSocket and creating a new MyServerThread (threaded client connection).
    The problem is that all the work of creating input streams, interacting with the server, all that stuff is done in the MyServerThread class, but I want that text to be written up to the Swing objects - which is in the MyServer class. So right now in the MyServerThread class I pass the MyServer object into it, but I'm not sure if that is really the most robust thing to do. Does anybody have any suggestions as to how this should be done. If somebody has an article they'd like to point to I'll check it out too. But if it's just the run-of-the-mill multithreaded client-server article, I've read alot and most don't specifically address my question.

    Thanks for the reply Kaj, and I think I'll keep my design for now, since it's just quick and dirty. I've read the MVC concept a while ago and I'll revisit it again when I get more serious. But I have a question, why should I be using a callback interface, why an interface at all? And then make MyServer implement that interface...why not just pass MyServer to the thread object? Or is there something down the line that I did not forsee?

  • New WSUS on Server 2012 - problem with win8 clients

    Hi,
    Two weeks ago we created a new Server 2012 and installed the WSUS role from scratch on it.  Its version number is:  6.2.9200.16384.  It replaced a Server 2008 WSUS server.  After some time all the win7 clients updated and reported as
    they did on the old and replaced server.
    However all our win8 clients refuse to update against this server.  They show correctly up in WSUS server console each with 107 needed updates day after day.  We have rebooted them and done numerous wuauclt /resetauthorization /detectnow and wuauclt
    /detectnow /reportnow, but to no avail.
    I paste in some lines from a win8 client winupdate log at the end of this message if someone can figure out what I have to do to get these clients update as they did against the old wsus server.  Thanks for help on this issue.
    regards Tor
    2014-02-03    08:33:38:008     920    153c    Agent    *************
    2014-02-03    08:33:38:008     920    153c    Agent    ** START **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:38:008     920    153c    Agent    *********
    2014-02-03    08:33:38:008     920    153c    Agent      * Online = Yes; Ignore download priority = No
    2014-02-03    08:33:38:008     920    153c    Agent      * Criteria = "IsInstalled=0 and DeploymentAction='Installation' or IsPresent=1 and DeploymentAction='Uninstallation'
    or IsInstalled=1 and DeploymentAction='Installation' and RebootRequired=1 or IsInstalled=0 and DeploymentAction='Uninstallation' and RebootRequired=1"
    2014-02-03    08:33:38:008     920    153c    Agent      * ServiceID = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} Third party service
    2014-02-03    08:33:38:008     920    153c    Agent      * Search Scope = {Machine & All Users}
    2014-02-03    08:33:38:008     920    153c    Agent      * Caller SID for Applicability: S-1-5-18
    2014-02-03    08:33:38:008     920    153c    Misc    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\9482F4B4-E343-43B6-B170-9A65BC822C77\wuredir.cab:
    2014-02-03    08:33:38:008     920    1990    AU    >>##  RESUMED  ## AU: Search for updates [CallId = {ABC7E77F-635F-4192-9B92-CBF9B1CB8AB0} ServiceId = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}]
    2014-02-03    08:33:38:008     920    1990    AU      # 0 updates detected
    2014-02-03    08:33:38:008     920    1990    AU    #########
    2014-02-03    08:33:38:008     920    1990    AU    ##  END  ##  AU: Search for updates  [CallId = {ABC7E77F-635F-4192-9B92-CBF9B1CB8AB0} ServiceId = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}]
    2014-02-03    08:33:38:008     920    1990    AU    #############
    2014-02-03    08:33:38:023     920    153c    Misc     Microsoft signed: Yes
    2014-02-03    08:33:38:023     920    153c    Misc     Infrastructure signed: Yes
    2014-02-03    08:33:38:023     920    153c    EP    Got 9482F4B4-E343-43B6-B170-9A65BC822C77 redir SecondaryServiceAuth URL: "http://fe1.ws.microsoft.com/w8/2/redir/storeauth.cab"
    2014-02-03    08:33:38:023     920    153c    Misc    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\117CAB2D-82B1-4B5A-A08C-4D62DBEE7782\wuredir.cab:
    2014-02-03    08:33:38:039     920    153c    Misc     Microsoft signed: Yes
    2014-02-03    08:33:38:039     920    153c    Misc     Infrastructure signed: Yes
    2014-02-03    08:33:38:039     920    153c    EP    Got 117CAB2D-82B1-4B5A-A08C-4D62DBEE7782 redir Client/Server URL: "https://fe2.ws.microsoft.com/v6/ClientWebService/client.asmx"
    2014-02-03    08:33:38:055     920    153c    PT    +++++++++++  PT: Synchronizing server updates  +++++++++++
    2014-02-03    08:33:38:055     920    153c    PT      + ServiceId = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782}, Server URL = https://fe2.ws.microsoft.com/v6/ClientWebService/client.asmx
    2014-02-03    08:33:38:055     920    153c    Agent    Reading cached app categories using lifetime 604800 seconds
    2014-02-03    08:33:38:055     920    153c    Agent    Read 0 cached app categories
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {E7FF661C-6A03-4387-A1EE-1D723B52EF60}.3 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {E8B477DF-479E-4BCA-B8F8-2D987A509009}.2 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {BB85CCA0-88DC-4DA7-8E81-B7F7E5E73B81}.100 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {18DEF1D9-4513-467E-9D7E-E1772855BB9E}.100 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {971D9BE4-5145-4DB5-962C-CEE2EE3A2842}.3 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {CCB380C9-29F5-4305-96DD-86DE2D00438B}.2 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {455BDD67-9ED0-4DE7-94F1-3480EA942414}.12 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {ADFBFCE0-FFD4-4826-B9CF-50AE8182E3C5}.2 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {BFA8C8B8-EEF7-4A82-A36C-8F760F792430}.3 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {3F05DE38-92BC-44B6-B06B-5217E5CF12CA}.1 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {A9A0E183-0667-46D6-84E4-17CEBCEE5A22}.1 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {36BEF0D5-80ED-4942-8457-6F9C88546E06}.1 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Added update {A292CD86-AB4E-4388-8C7B-CFB392EDE6AC}.1 to search result
    2014-02-03    08:33:39:211     920    153c    Agent      * Found 13 updates and 31 categories in search; evaluated appl. rules of 69 out of 94 deployed entities
    2014-02-03    08:33:39:211     920    153c    Agent    *********
    2014-02-03    08:33:39:211     920    153c    Agent    **  END  **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:211     920    153c    Agent    *************
    2014-02-03    08:33:39:211     920    1a64    Report    REPORT EVENT: {0786C161-F6DC-4842-85D6-9506124654AD}    2014-02-03 08:33:38:008+0100    1  
     147 [AGENT_DETECTION_FINISHED]    101    {00000000-0000-0000-0000-000000000000}    0    0    Windows Update Command Line    Success    Software Synchronization  
     Windows Update Client successfully detected 0 updates.
    2014-02-03    08:33:39:211     920    1a64    Report    REPORT EVENT: {1E5D9728-220F-44A3-8BCC-ADE69687531D}    2014-02-03 08:33:38:008+0100    1  
     156 [AGENT_STATUS_30]    101    {00000000-0000-0000-0000-000000000000}    0    0    Windows Update Command Line    Success    Pre-Deployment Check  
     Reporting client status.
    2014-02-03    08:33:39:211     920    1a64    Report    REPORT EVENT: {57BAB7D0-685B-4D73-BDF7-82AFCE8675B0}    2014-02-03 08:33:39:211+0100    1  
     147 [AGENT_DETECTION_FINISHED]    101    {00000000-0000-0000-0000-000000000000}    0    0    Windows Update Command Line    Success    Software Synchronization  
     Windows Update Client successfully detected 13 updates.
    2014-02-03    08:33:39:211     920    1a64    Report    CWERReporter finishing event handling. (00000000)
    2014-02-03    08:33:39:227     920    153c    Agent    *************
    2014-02-03    08:33:39:227     920    153c    Agent    ** START **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:227     920    153c    Agent    *********
    2014-02-03    08:33:39:227     920    153c    Agent      * Online = No; Ignore download priority = No
    2014-02-03    08:33:39:227     920    153c    Agent      * Criteria = "IsInstalled=0 and DeploymentAction='Installation' or IsPresent=1 and DeploymentAction='Uninstallation'
    or IsInstalled=1 and DeploymentAction='Installation' and RebootRequired=1 or IsInstalled=0 and DeploymentAction='Uninstallation' and RebootRequired=1"
    2014-02-03    08:33:39:227     920    153c    Agent      * ServiceID = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} Third party service
    2014-02-03    08:33:39:227     920    153c    Agent      * Search Scope = {Current User}
    2014-02-03    08:33:39:227     920    153c    Agent      * Caller SID for Applicability: S-1-5-21-4260610346-2664610402-3334891387-1155
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {E8B477DF-479E-4BCA-B8F8-2D987A509009}.2 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {BB85CCA0-88DC-4DA7-8E81-B7F7E5E73B81}.100 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {18DEF1D9-4513-467E-9D7E-E1772855BB9E}.100 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {971D9BE4-5145-4DB5-962C-CEE2EE3A2842}.3 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {CCB380C9-29F5-4305-96DD-86DE2D00438B}.2 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {455BDD67-9ED0-4DE7-94F1-3480EA942414}.12 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {ADFBFCE0-FFD4-4826-B9CF-50AE8182E3C5}.2 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {3F05DE38-92BC-44B6-B06B-5217E5CF12CA}.1 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {A9A0E183-0667-46D6-84E4-17CEBCEE5A22}.1 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {36BEF0D5-80ED-4942-8457-6F9C88546E06}.1 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Added update {A292CD86-AB4E-4388-8C7B-CFB392EDE6AC}.1 to search result
    2014-02-03    08:33:39:258     920    153c    Agent      * Found 11 updates and 29 categories in search; evaluated appl. rules of 58 out of 94 deployed entities
    2014-02-03    08:33:39:258     920    153c    Agent    *********
    2014-02-03    08:33:39:258     920    153c    Agent    **  END  **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:258     920    153c    Agent    *************
    2014-02-03    08:33:39:258     920    153c    Agent    *************
    2014-02-03    08:33:39:258     920    153c    Agent    ** START **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:258     920    153c    Agent    *********
    2014-02-03    08:33:39:258     920    153c    Agent      * Online = No; Ignore download priority = No
    2014-02-03    08:33:39:258     920    153c    Agent      * Criteria = "IsInstalled=0 and DeploymentAction='Installation' or IsPresent=1 and DeploymentAction='Uninstallation'
    or IsInstalled=1 and DeploymentAction='Installation' and RebootRequired=1 or IsInstalled=0 and DeploymentAction='Uninstallation' and RebootRequired=1"
    2014-02-03    08:33:39:258     920    153c    Agent      * ServiceID = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} Third party service
    2014-02-03    08:33:39:258     920    153c    Agent      * Search Scope = {Current User}
    2014-02-03    08:33:39:258     920    153c    Agent      * Caller SID for Applicability: S-1-5-21-2212025170-3189117132-1219651784-500
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {E8B477DF-479E-4BCA-B8F8-2D987A509009}.2 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {BB85CCA0-88DC-4DA7-8E81-B7F7E5E73B81}.100 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {18DEF1D9-4513-467E-9D7E-E1772855BB9E}.100 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {971D9BE4-5145-4DB5-962C-CEE2EE3A2842}.3 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {CCB380C9-29F5-4305-96DD-86DE2D00438B}.2 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {455BDD67-9ED0-4DE7-94F1-3480EA942414}.12 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {ADFBFCE0-FFD4-4826-B9CF-50AE8182E3C5}.2 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {BFA8C8B8-EEF7-4A82-A36C-8F760F792430}.3 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {3F05DE38-92BC-44B6-B06B-5217E5CF12CA}.1 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {36BEF0D5-80ED-4942-8457-6F9C88546E06}.1 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Added update {A292CD86-AB4E-4388-8C7B-CFB392EDE6AC}.1 to search result
    2014-02-03    08:33:39:305     920    153c    Agent      * Found 11 updates and 30 categories in search; evaluated appl. rules of 60 out of 94 deployed entities
    2014-02-03    08:33:39:305     920    153c    Agent    *********
    2014-02-03    08:33:39:305     920    153c    Agent    **  END  **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:305     920    153c    Agent    *************
    2014-02-03    08:33:39:305     920    153c    Agent    *************
    2014-02-03    08:33:39:305     920    153c    Agent    ** START **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:305     920    153c    Agent    *********
    2014-02-03    08:33:39:305     920    153c    Agent      * Online = No; Ignore download priority = No
    2014-02-03    08:33:39:305     920    153c    Agent      * Criteria = "IsInstalled=0 and DeploymentAction='Installation' or IsPresent=1 and DeploymentAction='Uninstallation'
    or IsInstalled=1 and DeploymentAction='Installation' and RebootRequired=1 or IsInstalled=0 and DeploymentAction='Uninstallation' and RebootRequired=1"
    2014-02-03    08:33:39:305     920    153c    Agent      * ServiceID = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} Third party service
    2014-02-03    08:33:39:305     920    153c    Agent      * Search Scope = {Current User}
    2014-02-03    08:33:39:305     920    153c    Agent      * Caller SID for Applicability: S-1-5-21-4260610346-2664610402-3334891387-1323
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {E8B477DF-479E-4BCA-B8F8-2D987A509009}.2 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {BB85CCA0-88DC-4DA7-8E81-B7F7E5E73B81}.100 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {18DEF1D9-4513-467E-9D7E-E1772855BB9E}.100 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {971D9BE4-5145-4DB5-962C-CEE2EE3A2842}.3 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {CCB380C9-29F5-4305-96DD-86DE2D00438B}.2 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {455BDD67-9ED0-4DE7-94F1-3480EA942414}.12 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {ADFBFCE0-FFD4-4826-B9CF-50AE8182E3C5}.2 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {BFA8C8B8-EEF7-4A82-A36C-8F760F792430}.3 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {3F05DE38-92BC-44B6-B06B-5217E5CF12CA}.1 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {36BEF0D5-80ED-4942-8457-6F9C88546E06}.1 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Added update {A292CD86-AB4E-4388-8C7B-CFB392EDE6AC}.1 to search result
    2014-02-03    08:33:39:352     920    153c    Agent      * Found 11 updates and 30 categories in search; evaluated appl. rules of 60 out of 94 deployed entities
    2014-02-03    08:33:39:352     920    153c    Agent    *********
    2014-02-03    08:33:39:352     920    153c    Agent    **  END  **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:352     920    153c    Agent    *************
    2014-02-03    08:33:39:352     920    153c    Agent    *************
    2014-02-03    08:33:39:352     920    153c    Agent    ** START **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:352     920    153c    Agent    *********
    2014-02-03    08:33:39:352     920    153c    Agent      * Online = No; Ignore download priority = No
    2014-02-03    08:33:39:352     920    153c    Agent      * Criteria = "IsInstalled=0 and DeploymentAction='Installation' or IsPresent=1 and DeploymentAction='Uninstallation'
    or IsInstalled=1 and DeploymentAction='Installation' and RebootRequired=1 or IsInstalled=0 and DeploymentAction='Uninstallation' and RebootRequired=1"
    2014-02-03    08:33:39:352     920    153c    Agent      * ServiceID = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782} Third party service
    2014-02-03    08:33:39:352     920    153c    Agent      * Search Scope = {Current User}
    2014-02-03    08:33:39:352     920    153c    Agent      * Caller SID for Applicability: S-1-5-21-4260610346-2664610402-3334891387-1282
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {E8B477DF-479E-4BCA-B8F8-2D987A509009}.2 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {BB85CCA0-88DC-4DA7-8E81-B7F7E5E73B81}.100 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {18DEF1D9-4513-467E-9D7E-E1772855BB9E}.100 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {971D9BE4-5145-4DB5-962C-CEE2EE3A2842}.3 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {CCB380C9-29F5-4305-96DD-86DE2D00438B}.2 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {455BDD67-9ED0-4DE7-94F1-3480EA942414}.12 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {ADFBFCE0-FFD4-4826-B9CF-50AE8182E3C5}.2 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {BFA8C8B8-EEF7-4A82-A36C-8F760F792430}.3 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {3F05DE38-92BC-44B6-B06B-5217E5CF12CA}.1 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {36BEF0D5-80ED-4942-8457-6F9C88546E06}.1 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Added update {A292CD86-AB4E-4388-8C7B-CFB392EDE6AC}.1 to search result
    2014-02-03    08:33:39:383     920    153c    Agent      * Found 11 updates and 30 categories in search; evaluated appl. rules of 60 out of 94 deployed entities
    2014-02-03    08:33:39:383     920    153c    Agent    *********
    2014-02-03    08:33:39:383     920    153c    Agent    **  END  **  Agent: Finding updates [CallerId = Windows Update Command Line]
    2014-02-03    08:33:39:383     920    153c    Agent    *************
    2014-02-03    08:33:39:383     920    1990    AU    >>##  RESUMED  ## AU: Search for updates [CallId = {66AF0139-896D-4607-8660-B66D2B58EA26} ServiceId = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782}]
    2014-02-03    08:33:39:383     920    1990    AU      # 12 updates detected
    2014-02-03    08:33:39:383     920    1990    AU    #########
    2014-02-03    08:33:39:383     920    1990    AU    ##  END  ##  AU: Search for updates  [CallId = {66AF0139-896D-4607-8660-B66D2B58EA26} ServiceId = {117CAB2D-82B1-4B5A-A08C-4D62DBEE7782}]
    2014-02-03    08:33:39:383     920    1990    AU    #############
    2014-02-03    08:33:39:383     920    1990    AU    All AU searches complete.
    2014-02-03    08:33:39:383     920    1990    AU    AU setting next detection timeout to 2014-02-03 10:18:51
    2014-02-03    08:33:44:211     920    1a64    Report    CWERReporter finishing event handling. (00000000)
    2014-02-03    08:41:39:472     920    1a64    EP    Got WSUS Client/Server URL: "http://elias:8530/ClientWebService/client.asmx"
    2014-02-03    08:41:39:472     920    1a64    PT    WARNING: Cached cookie has expired or new PID is available
    2014-02-03    08:41:39:472     920    1a64    EP    Got WSUS SimpleTargeting URL: "http://elias:8530"
    2014-02-03    08:41:39:472     920    1a64    PT    Initializing simple targeting cookie, clientId = c5e26849-287b-4b96-ba5d-1489d6fad2f2, target group = , DNS name = dt-ikt-tor.framnes.lan
    2014-02-03    08:41:39:472     920    1a64    PT      Server URL = http://elias:8530/SimpleAuthWebService/SimpleAuth.asmx
    2014-02-03    08:41:39:519     920    1a64    EP    Got WSUS Reporting URL: "http://elias:8530/ReportingWebService/ReportingWebService.asmx"
    2014-02-03    08:41:39:519     920    1a64    Report    Uploading 2 events using cached cookie, reporting URL = http://elias:8530/ReportingWebService/ReportingWebService.asmx
    2014-02-03    08:41:39:566     920    1a64    Report    Reporter successfully uploaded 2 events.
    2014-02-03    08:42:13:212     920    178c    Report    WARNING: CSerializationHelper:: InitSerialize failed : 0x80070002
    2014-02-03    08:43:40:450     920    178c    AU    ###########  AU: Uninitializing Automatic Updates  ###########
    2014-02-03    08:43:40:450     920    178c    WuTask    Uninit WU Task Manager
    2014-02-03    08:43:40:513     920    178c    Service    *********
    2014-02-03    08:43:40:513     920    178c    Service    **  END  **  Service: Service exit [Exit code = 0x240001]
    2014-02-03    08:43:40:513     920    178c    Service    *************

    Today I opened Control Panel / Windows Updates and first did a check for new updates (from the WSUS server).  Nothing was found and it reported Windows is Updated.   Then I clicked the link Check for updates from Microsoft via internet, and
    it found around 24 updates.
    This is confirmation of the point that I made in the previous post. The updates are *NEEDED* by this system, but the updates were not *AVAILABLE* from the assigned WSUS Server. You were able to get them from Windows Update, but that does not fix your continuing
    issue with the WSUS Server.
    but it still reported the original 108 Needed updates.
    Exactly. As previously noted, the client is functioning perfectly. The problem is NOT with the client; the problem is with the WSUS Server. The updates that this client needed were not AVAILABLE to be downloaded from the WSUS server.
    Why this is the case requires further investigation on your part, but is either because the updates are not properly approved, or the update FILES are not yet downloaded from Microsoft to the WSUS server.
    It appears that the wsus server doesn't get any information back from the client despite that it displays new Last contact and Last Status report timestamps.
    This conclusion is incorrect. The WSUS Server got every bit of information available from the client -- you've confirmed this by the number of updates reported as "Needed" by the Windows Update Agent to the WSUS Server.
    I assumed that the log would display if the updates were downloaded or not.
    It will log when the updates are actually downloaded. If there's no log entries for updates being downloaded, then they're not being downloaded. If the logfile says "Found 0 updates", then that means exactly what it says: It couldn't find any approved/available
    updates to download.
    In your case it "Found 11 updates", but now it will be impossible to diagnose that fault, because you went and got them from Windows Update.
    All Win8 versions are checked in the WSUS server's Product list so the updates should at least have been downloaded to the server.
    This is why understanding the infrastructure is so critical. Your conclusion is invalid based on the premise given, and you may be using improper terminology which only confuses the rest of us as well.
    First, selecting updates for synchronization only gets the update metadata (i.e. the detection logic) downloaded to the WSUS database.
    The Second Step in this process is to Approve those updates for one or more WSUS Target Groups that contain the appropriate client systems. Following the approval of an update, the WSUS Server downloads the INSTALLATION FILE for that update.
    Once the WUAgent sees an approved update and the installation file is available, then the WUAgent will download the file and schedule the update for installation.
    Most of the post I read about my problem is about upgrading a 2008 WSUS server to support Win8 / Server 12 clients.  When I try to run this update on my Server 12 WSUS it refuses to run (probably because it is for Server 2008).
    Yeah.. totally different issue in those posts than what you're describing here.
    What should I do to try to track down the problem?
    Well.... now that it's 11 days since the logfile was posted, and you've already updated that system, we'll first need to find another system exhibiting the same issue.
    Then I'll need to ask a number of questions to properly understand the environment, as well as what you have or have not done.
    Then, from there, we can attempt to figure out why your Windows 8 client apparently sees some updates as approved/available but is still not downloading them. We do not yet have sufficient information to even speculate on a possible cause -- there are several.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

Maybe you are looking for

  • Error message when installing Uniden PC software

    I am running Windows 7 x64 on my 27" iMac.  I have a Uniden UDS655 video surveillance system connected to the apple via USB cable and this woulr allow a PC connection of the video to the internet for remote viewing.  Unfortunately, the Uniden softwar

  • MOS Excel 2007/2010/2013

    I am currently considering the Microsoft Office Specialist certification for Microsoft Excel. At the moment, I work on MO Excel 2007. I have purchased the study guide for MO Excel 2010 and I have access to E-Learning for MO Excel 2013! With office 20

  • Trouble with MS SQL Server 2000 vs. Java

    Hi, how do i store binary files in database MS SQL Server 2000 ? How do I attach it to some information stored in the database? Can I do some sql statement in my java application to do this or do I have to use some MS SQL Server 2000 tools ?

  • Missing driver PCI\VEN_1180

    Missing drivers PCI\VEN_1180--..Help!!!! After upgrading to Windows 8.1 from Vista: I am missing the following drivers for Base System Devices here is the information for the driver. I am unable to use my Built in Camera, CD/ROM Drive, System speaker

  • Windows 7 ignoring my pagefile settings

    I have Windows 7 Professional 64bit set up on a system with a mirrored system drive, and two non-mirrored drives, including an SSD drive that is configured with ReadyBoost. Because mirroring is for data integrity, and has a performance cost associate