1 Reply Latest reply on Apr 24, 2002 9:54 AM by J. Wolfgang Kaltz

    Whether this forum is alive or not?

    ditto Newbie

      hi guys i posted my question long back still i'm expecting the answer,can anyone help me to figure out this..

      I'm getting an exception like this while i'm executing a servlet.For better insight i attached the code also.

      java.net.SocketException: Connection aborted by peer: socket write error.

      Note:In WAS 3.5.2 it is executing in a very nice manner.

      The servlet code:

      public class InternalPriceSheetPDF extends HttpServlet {
      private static final String CONTENT_TYPE = "application/pdf";

      /**Initialize global variables*/
      public void init() throws ServletException {
      /**Process the HTTP Get request*/
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      HttpSession session = null;
      try {
      response.setHeader("Pragma", "No-cache");
      response.setHeader("Cache-Control", "no-cache");
      response.setDateHeader("Expires", -1);
      System.out.println("The Buffer Size is :"+ response.getBufferSize());
      //System.out.println("The Buffer Size is :"+ response.getBufferSize());
      session = request.getSession();
      PartyManagement partyManagement = (PartyManagement)session.getAttribute("partyManagement");
      String loginURL = com.jbakr.cosi.Utils.getPropertyValue("loginURL");
      String returnURL = com.jbakr.cosi.Utils.getPropertyValue("ReturnURL");
      if(partyManagement == null) {
      response.sendRedirect(response.encodeRedirectURL(loginURL+"?ReturnUrl="+returnU RL));
      String productLine = (String)session.getAttribute("productLine");
      SelecCon SelecCon = (SelecCon)session.getAttribute(productLine);
      Product product = SelecCon.getProduct();
      if(!product.isCompatible()) {
      } else {
      File xmlFile = SelecCon.getConfigXML(partyManagement);
      XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File(com.jbakr.cosi.Utils.getPropertyValue("fileLocation")+partyManagement.getX SLApp()+"internal-price-sheet-pdf.xsl"));
      renderXML(input, response);
      } catch (Exception e) {
      //session.setAttribute("appError" , e);
      /**Process the HTTP Post request*/
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      doGet(request, response);
      public void renderXML(XSLTInputHandler input,
      HttpServletResponse response) throws Exception {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Driver driver = new Driver();
      driver.render(input.getParser(), input.getInputSource());
      byte[] content = out.toByteArray();
      /**Clean up resources*/
      public void destroy() {

      Any help appreciated.

        • 1. Re: Whether this forum is alive or not?
          J. Wolfgang Kaltz Novice

          It doesn't seem your problem has anything to do with JBoss; since you're only referring to a servlet.

          So the question is, what servlet engine are you using ? In what version ? On which operating system ? I have had socket errors in Tomcat under Windows, so maybe this is your problem ? (I haven't pursued the socket errors as in production our Tomcat runs under Solaris anyway, and there's no socket errors there)

          By the way, there is a forum HTTPD, Servlets & JSP which would be better suited to your question so you might have a better chance at getting help there.