I just looked at the code, and there can be 2 possible problems;

a: tomcat's security won't allow you to write to disk, check your policy
file

b: the "http://www.localhost/cocoon/test/a1.html"; url will get you maaaaaany
problems because you most certainly haven't registered www.localhost :-) and
secondly it doesn't state the port tomcat is running on (then again you
might have tomcat running on port 80, or you might be using apache to server
static files...) anyway, try "http://localhost:8080/cocoon/test/a1.html";
instead, and if you are running a machine without loopback(both linux and
win should have...) you could try your ip adress instead
"http://111.222.333.444:8080/cocoon/test/a1.html";

see if this helps!

mvh karl

> -----Original Message-----
> From: cib [mailto:[EMAIL PROTECTED]]
> Sent: 23. september 2001 16:18
> To: Cocoon User Mail List
> Subject: everything down
>
>
> Hi,
> In my attempts to write the output of an xsp to the disk,
> my code makes Tomcat/4.0-b5 and Cocoon2b2 go completely down
> (every page is
> 404), the only message I get is in the dos window (nothing in log files):
>
> CheckedIODemo: java.net.UnknownHostException: www.localhost
>
> The only way is to restart Tomcat.
> Here is my make2.xsp (mainly from Karl Řie in his answer in thread "RE:
> Nobody Knows HOW TO SAVE STREAM ON DISK!!"):
>
> <?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.localhost/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>
>
> My previous attempt (many thanks to Christian Haul) worked but only if the
> input file (a1.html) was in Tomcat/bin directory , otherwise, everything
> would get down, and  the only solution was to restart Tomcat:
>
> 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);
>        }
>
>      }
> }
>
> Mario Muja also mentioned his interest in finding a way of saving
> output of
> xsp on the disk.
> Thanks to anyone helping us.
> I'll maybe give this mail a try on tomcat users mailing list.
> Cib
>
> France, Bordeaux, xml and gay pride.
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to