You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Murat Kasikcioglu <mu...@innovaconsulting.com> on 2000/11/07 09:58:21 UTC

xml on the fly

hi all,
i'm trying to produce xml file from servlet in tomcat.
but i could not pass data to cocoon.

do you have any comments?
best regards,

my code is like this:

.....
....
public class menu extends HttpServlet {
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
  }
  public void doGet(HttpServletRequest request, HttpServletResponse
response) throws
ServletException, IOException {
    response.setContentType("text/xml");
    PrintWriter out = new PrintWriter (response.getOutputStream());
    out.println(
      "<?xml version=\"1.0\"?>" +
      "<?xml-stylesheet href=\"hello-page-html.xsl\"
type=\"text/xsl\"?>" +
      "<?cocoon-process type=\"xslt\"?>" +
      "<!DOCTYPE page [" +
      " <!ELEMENT page (title?, content)>" +
      " <!ELEMENT title (#PCDATA)>" +
      " <!ELEMENT content (paragraph+)>" +
      " <!ELEMENT paragraph (#PCDATA)>]>" +
      "<page>" +
      "  <title>Hello</title>" +
      "    <content>" +
      "      <paragraph>This is my first Cocoon page!</paragraph>" +
      "    </content>" +
      "</page>");


    out.close();
  }


--
Murat Kasikcioglu
Innova Consulting Company
http://www.innovaconsulting.com



SocketException on Linux JDK1.3 Tomcat3.1

Posted by St�phane Lauri�re <al...@cybercable.fr>.
Hello,
I'm using Tomcat successfully as standalone jsp/servlet server on WindowsNT
with no reboot from the server during several weeks.
However I'm facing big problems on Linux Mandrake, JDK1.3 by Sun, Tomcat3.1
running as standalone
server: I sometimes get a SocketException that makes the server shut down
whereas there are a maximum of two concurrent connections to the server. The
main pb is Tomcat not only misses the connection, it also crashes
completely.
I have pasted the stack trace below. Has any of you already faced such a pb?
Thanks,
Stéphane


java.net.SocketException: Connection reset by peer
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:413)
        at java.net.ServerSocket.implAccept(ServerSocket.java:243)
        at java.net.ServerSocket.accept(ServerSocket.java:222)
        at
org.apache.tomcat.service.SimpleTcpEndpoint.acceptSocket(SimpleTcpEndpoint.j
ava:267)
        at
org.apache.tomcat.service.SimpleTcpEndpoint.acceptConnections(SimpleTcpEndpo
int.java:248)
        at
org.apache.tomcat.service.TcpListenerThread.run(SimpleTcpEndpoint.java:319)
        at java.lang.Thread.run(Thread.java:484)
Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] shutdown
due to exception: java.net.SocketException: Connection reset by peer