1 Reply Latest reply on Oct 26, 2004 11:32 AM by Michael Decker

    JBoss kills

    Michael Decker Newbie

      I'm using jboss-3.2.6 with its jbossweb-tomcat50.sar.

      Now i'm testing gzip-compression of http-requests...

      Using this web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
       <!-- Struts Tag Library Descriptors -->

      this is my com.jspbook.GZIPFilter:
       * Copyright 2003 Jayson Falkner (jayson@jspinsider.com)
       * This code is from "Servlets and JavaServer pages; the J2EE Web Tier",
       * http://www.jspbook.com. You may freely use the code both commercially
       * and non-commercially. If you like the code, please pick up a copy of
       * the book and help support the authors, development of more free code,
       * and the JSP/Servlet/J2EE community.
      package com.jspbook;
      import java.io.*;
      import java.util.Enumeration;
      import javax.servlet.*;
      import javax.servlet.http.*;
      public class GZIPFilter implements Filter {
       public void doFilter(ServletRequest req, ServletResponse res,
       FilterChain chain) throws IOException, ServletException {
       if (req instanceof HttpServletRequest) {
       HttpServletRequest request = (HttpServletRequest) req;
       HttpServletResponse response = (HttpServletResponse) res;
       System.out.println("Http-Request: "+ request.getRequestURI());
       for (Enumeration e = request.getHeaderNames(); e.hasMoreElements(); )
       String headerName = (String)e.nextElement();
       System.out.println("Header '" + headerName + "': '" + request.getHeader(headerName) + "'");
       for (Enumeration e = request.getAttributeNames(); e.hasMoreElements(); )
       String attributeName = (String)e.nextElement();
       System.out.println("Attributes '" + attributeName + "': '" + request.getHeader(attributeName) + "'");
       System.out.println("AuthTyp: " + request.getAuthType());
       System.out.println("CharacterEncoding: " + request.getCharacterEncoding());
       System.out.println("Method: " + request.getMethod());
       System.out.println("Protocol: " + request.getProtocol());
       System.out.println("QueryString: " + request.getQueryString());
       System.out.println("Scheme: " + request.getScheme());
       String ae = request.getHeader("accept-encoding");
       if (ae != null && ae.indexOf("gzip") != -1) {
       System.out.println("GZIP supported, compressing.");
       GZIPResponseWrapper wrappedResponse =
       new GZIPResponseWrapper(response);
       chain.doFilter(req, wrappedResponse);
       chain.doFilter(req, res);
       public void init(FilterConfig filterConfig) {
       // noop
       public void destroy() {
       // noop

      Now, if I use jboss with tomcat I get this sysout-logs:
      17:07:35,186 INFO [STDOUT] Http-Request: /ImageBrowser/TestGZIP.jsp
      17:07:35,186 INFO [STDOUT] Header 'accept': 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*'
      17:07:35,186 INFO [STDOUT] Header 'referer': 'http://localhost:8080/ImageBrowser/TestGZIP.jsp'
      17:07:35,186 INFO [STDOUT] Header 'accept-language': 'de'
      17:07:35,206 INFO [STDOUT] Header 'content-type': 'application/x-www-form-urlencoded'
      17:07:35,206 INFO [STDOUT] Header '---------------': '----- -------'
      17:07:35,206 INFO [STDOUT] Header 'user-agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
      17:07:35,206 INFO [STDOUT] Header 'host': 'localhost:8080'
      17:07:35,206 INFO [STDOUT] Header 'content-length': '60'
      17:07:35,206 INFO [STDOUT] Header 'connection': 'Keep-Alive'
      17:07:35,206 INFO [STDOUT] Header 'cache-control': 'no-cache'
      17:07:35,206 INFO [STDOUT] Header 'cookie': 'JSESSIONID=F966E4735EDF169F90FA45F9FB7F8A1B; JSESSIONID=BB1A785FCD8C58DCF2E2AFF9CED4FD87'
      17:07:35,206 INFO [STDOUT] AuthTyp: null
      17:07:35,206 INFO [STDOUT] CharacterEncoding: null
      17:07:35,206 INFO [STDOUT] Method: POST
      17:07:35,206 INFO [STDOUT] Protocol: HTTP/1.1
      17:07:35,206 INFO [STDOUT] QueryString: null
      17:07:35,206 INFO [STDOUT] Scheme: http

      But if I use a standalone tomcat 5, I get this:
      Http-Request: /ImageBrowser/TestGZIP.jsp
      Header 'accept': '*/*'
      Header 'referer': 'http://localhost:7777/ImageBrowser/TestGZIP.jsp'
      Header 'accept-language': 'de'
      Header 'content-type': 'application/x-www-form-urlencoded'
      Header 'accept-encoding': 'gzip, deflate'
      Header 'user-agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
      Header 'host': 'localhost:7777'
      Header 'content-length': '63'
      Header 'connection': 'Keep-Alive'
      Header 'cache-control': 'no-cache'
      Header 'cookie': 'JSESSIONID=1573AC233C47BF7D21A8F606B11B24D0; JSESSIONID=BB1A785FCD8C58DCF2E2AFF9CED4FD87'
      AuthTyp: null
      CharacterEncoding: null
      Method: POST
      Protocol: HTTP/1.1
      QueryString: null
      Scheme: http
      GZIP supported, compressing.

      Why loose jboss that Header 'accept-encoding': 'gzip, deflate'???

        • 1. Re: test
          Michael Decker Newbie

          Again, thank you very much Vishal!

          This tutorial on Web Services will most certainly come in handy when I'm a bit more experienced on J2EE as a whole. That will take a day or two though :-)

          Actually, a couple of days ago after finishing most of the first eight chapters I seriously thought I started to get the hang of it. Then, trying my wings, I settled for expanding the project with some Applet-Servlet-EJB communication functionality. Nothing fancy. It should be nothing to it, really...

          However, let us say I did not even come close.

          I think I have all the java code put together correctly, but when I add my Applet class to the web module, OnlineStore, the class files persist to locate under the WEB-INF folder where it (to my knowledge) cannot be reached from the client. I do not seem to be able to reach it anyway.

          Of course I could manually put the class files where they are visible to the client. I could probably even instruct Ant to do it for me. However, since I am an optimist in general I believe there must be a simpler way of adding an Applet to a J2EE project within Eclipse. The question, though, is: How is it done?

          Maybe there is no simple answer to this question except for me to study the manuals. In that case I would be most grateful for every book title or other resource that you would recommend.

          Best Regards,