Announcement Announcement Module
Collapse
No announcement yet.
Using a MultiActionController as a Web Service Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using a MultiActionController as a Web Service

    Hello,

    I have a producction system working on a JBoss server. Part of the system is working in this way:

    I have a lot of clients requesting a web page and processing the response (Ideally this would be a Web Service, I'm waiting for Spring Framework Web Services). This is the client code (this is a fragment):

    /************ Client *****************/
    private URL url;
    private URLConnection urlConn;
    private DataInputStream input;

    url = new URL("THIS IS A REQUEST TO A WEB PAGE");
    urlConn = url.openConnection();
    urlConn.setDoOutput (true);
    urlConn.setUseCaches (false);
    urlConn.setRequestProperty("Content-Type", "application/html");
    input = new DataInputStream (urlConn.getInputStream ());
    if (input.available() != 0) {
    input.read(resultado);
    }
    input.close();
    urlConn = null;
    /************* We process "resultado" ***************/

    This is the server part...

    /***************************/
    public ModelAndView paqueteNuevo(HttpServletRequest request, HttpServletResponse response) {
    // Params
    String terminal = request.getParameter("terminal");
    try {
    response.getWriter().write("RETURN STRING");
    }
    catch (IOException e) {
    logger.fatal("Error." + e.getMessage() + ")");
    }
    return null;
    }
    /**************************************/

    I return a null value as a ModelAndView....

    Sometimes JBoss stops responding... If I undeploy the App JBoss works again, then I deploy the App again and it's working the right way for two or three days... Any idea what's working wrong?

    Thanks in advance.

    PD: Sorry for my English...

  • #2
    More information...

    More information:

    When everything is working the right way this is the end log for a request:

    /*********************/
    2006-01-09 14:07:57,355 DEBUG [org.springframework.web.servlet.DispatcherServlet] Null ModelAndView returned to DispatcherServlet with name 'xxxx': assuming HandlerAdapter completed request handling
    2006-01-09 14:07:57,355 DEBUG [org.springframework.web.servlet.DispatcherServlet] Successfully completed request
    /***********************/

    Then I have 250 request without response. This is the log in this case, there is no response...

    /**************/
    2006-01-09 14:08:20,798 DEBUG [org.springframework.web.servlet.DispatcherServlet] Testing handler map [org.springframework.web.servlet.handler.SimpleUrlH andlerMapping@16e0d3f] in DispatcherServlet with name 'xxxxxx'
    2006-01-09 14:08:20,798 DEBUG [org.springframework.web.servlet.handler.SimpleUrlH andlerMapping] Looking up handler for [/comunicaciones.html]
    2006-01-09 14:08:20,799 DEBUG [org.springframework.web.servlet.DispatcherServlet] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter@27ba66]
    2006-01-09 14:08:20,799 DEBUG [org.springframework.web.servlet.DispatcherServlet] Last-Modified value for [/xxxxxx/comunicaciones.html] is [-1]
    2006-01-09 14:08:20,799 DEBUG [org.springframework.web.servlet.DispatcherServlet] DispatcherServlet with name 'xxxxxx' received request for [/xxxxxx/comunicaciones.html]
    2006-01-09 14:08:20,799 DEBUG [org.springframework.web.servlet.DispatcherServlet] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter@27ba66]
    2006-01-09 14:08:20,808 DEBUG [xxxxxServiceImpl] paqueteNuevo(T0741,10.32.174.1,w2k)

    /************/

    Comment

    Working...
    X