tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: xsp kills Tomcat and Cocoon2
Date Fri, 28 Sep 2001 02:00:37 GMT
Why are you calling System.exit()?  *That* is what kills Tomcat!

Craig


On Thu, 27 Sep 2001, cib wrote:

> Date: Thu, 27 Sep 2001 22:30:33 +0200
> From: cib <c.cib@laposte.net>
> Reply-To: tomcat-user@jakarta.apache.org, cib <vendo1@caramail.com>
> To: Tomcat User Mail List <tomcat-user@jakarta.apache.org>
> Subject: xsp kills Tomcat and Cocoon2
>
> Hi,
> I've modified "localhost" to "mydomain" as Karl Øie suggested, but each time
> I try this, I can't get any other request, even Tomcat home index is down,
> and the only message is in the dos-java window:
>
> CheckedIODemo: java.net.UnknownHostException: www.mydomain
>
> Here is make2.xsp:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsp:page
>           language="java"
>           xmlns:xsp="http://apache.org/xsp"
>           xmlns:esql="http://apache.org/cocoon/SQL/v2">
>
> <xsp:structure>
>   <xsp:include>java.io.*</xsp:include>
>   <xsp:include>java.net.*</xsp:include>
> </xsp:structure>
>
>
>
> <xsp:logic>
>
>
>
> class make_xsl {
>    public void main() {
>
> try {
> URL myurl = new URL( "http://www.mydomain/cocoon/test/a1.html" );
> BufferedInputStream inn = new BufferedInputStream(myurl.openStream());
> BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new
> FileOutputStream("output2.txt") ) );
> for(;;) {
>      int data = inn.read();
> if (data == -1) {
> break;
> }
> else {
> out.write((char) data);
> }
> }
> out.flush();
>
>
>        } catch (FileNotFoundException e) {
>            System.err.println("CheckedIODemo: " + e);
>            System.exit(-1);
>        } catch (java.io.IOException e) {
>            System.err.println("CheckedIODemo: " + e);
>            System.exit(-1);
>  } catch (NoSuchMethodError e) {
>            System.err.println("CheckedIODemo: " + e);
>            System.exit(-1);
>  } catch (Exception e) {
>            System.err.println("CheckedIODemo: " + e);
>            System.exit(-1);
>       }
>  }
> }
>
> </xsp:logic>
>
>
>   <page>
>
> <xsp:logic>
>     make_xsl anObject = new make_xsl();
>     anObject.main();
> </xsp:logic>
>
>
> If you see this, it works.
>
>   </page>
> </xsp:page>
>
> As I said in a rather private thread to Karl (on Cocoon user mailing list),
> my previous attempt worked but the input filed wasn't accessed through an
> url. This previous code also killed Tomcat and cocoon2 if the input file
> wasn't in Tomcat/bin directory (I found out by puting a file a1.html in
> every directory one by one). The file "output.txt" was also be created in
> Tomcat/bin.
>
>
> class make_xsl {
>    public void main() throws IOException {
>  try {
>  FileReader entree = new FileReader("a1.html");
>   FileWriter sortie = new FileWriter("output.txt");
>  int c;
>  while ( (c = entree.read()) != -1 )
> sortie.write(c);
> sortie.close();
> entree.close();
>  } catch (FileNotFoundException e) {
>            System.err.println("CheckedIODemo: " + e);
>            System.exit(-1);
>        } catch (java.io.IOException e) {
>            System.err.println("CheckedIODemo: " + e);
>            System.exit(-1);
>        }
>
>      }
> }
>
> If someone knows how to get the input file through an url without killing
> Tomcat...
> Thanks in advance.
>
> Cib,
>
> France, Bordeaux, xml and gay pride.
>
>


Mime
View raw message