Donate Share

Tiny Java Web Server

Subscribe

IO error: java.net.SocketException

  1. 2009-10-30 16:59:02 UTC

    Hi! Thank for you awesome software! I was trying to use TJWS as runner for GWT .war project on arm linux operation system. Code is simple, and TJWS generally working, but sometimes i got an error like this:

    [Fri Oct 30 18:34:29 GMT+02:00 2009] IO error: java.net.SocketException: Socket Closed in processing a request from /192.168.0.1:-1 / java.net.Socket

    Sometimes this error causes lost connection of some serverside classes. This error has no dependency about matter of war file.

    My code is:

    public class StartTJWS {
    public static void main(String... args) {
        class MyServ extends Acme.Serve.Serve {
    
                        public void setMappingTable(PathTreeDictionary mappingtable) { 
                              super.setMappingTable(mappingtable);
                        }
    
                        public void addWarDeployer(String deployerFactory, String throttles) {
                              super.addWarDeployer(deployerFactory, throttles);
                        }
                };
    
        final MyServ srv = new MyServ();
        java.util.Properties properties = new java.util.Properties();
        properties.put("port", 8888);
        properties.setProperty(Acme.Serve.Serve.ARG_NOHUP, "nohup");
        System.setProperty("tjws.webappdir", "/opt/tjws/");
        srv.arguments = properties;
    
        srv.addWarDeployer(null, null);
        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
            public void run() {
                try {
                    srv.notifyStop();
                } catch (java.io.IOException ioe) {
    
                }
                srv.destroyAllServlets();
            }
        }));
        srv.serve();
    }
    

    Can you give me a hand with my situation?

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.