Chris Haynes | 1 Aug 2005 08:56
Picon

Re: Could not create cipher AES (error -12229 with Netscape/FireFox)

No solutions, only observations / questions:

1) This is the first I've seen of a Jetty-Netscape/Firefox problem re SSL. That 
combination works fine for me with the server being Suse Linux and with clients 
of Suse & WXP pro. Is there something unusual about your JVM/OS?

1) The stack trace and your commentary indicate that the SSL hand-shake is 
completing OK. The problem seems to come when content encryption starts.

2) Have you tried putting Bouncy Castle first in the provider sequence? It's jus 
a thought that the JVM SSL implementation may stick with the provider which gave 
it what it needed to fix the handshake, and not re-search the providers when the 
encryption algorithm is needed.

3) These operational details of the way SSL operates are way below Jetty. It 
just feeds the parameters into the JVM's security provider interface and let's 
it get on with it.  The Jetty code is very short (see the source code - about 30 
liones, from memory). However that config. interface is somewhat rich and 
confusing, so it is possible that Jetty is missing an opportunity to 'tweak' the 
info provided . Do you know of other web servers, with an identical JVM/OS/SP, 
on which this does work.

HTH

Chris Haynes

>I have spent hours researching this problem but the answer has eluded  me...
>
> I have Jetty configured for SSL support and it is working on browsers  other 
> than Netscape/Firefox.  I receive a -12229 error code from  Netscape after 
(Continue reading)

Chris | 3 Aug 2005 00:09
Picon
Favicon

Problem serving pdf

I'm having a problem getting a Jetty server to serve up a large (1 mb) pdf
file. When I click on a link that points to the pdf, IE downloads about half
of it (according to the kb count in the status bar) and then freezes. If you
try it a couple more times then sometimes IE will display it. Firefox
immediately says "stopped" in the toolbar and displays nothing.

The server is running locally, so this is not a problem getting the file
across a bad connection.

I can open the pdf fine in Acrobat directly. I can also serve it up fine
under Resin -- both IE and Firefox can connect to a Resin server and display
the file without a problem.

I see the problem with both Jetty 5.1.1 and Jetty 5.1.4.

Now here's the really tricky part: I'm running Jetty in my app as an
embedded server. If instead I run it from a default Jetty installation,
using start.jar, then there is no problem. The pdf displays fine. So my
guess is that this is configuration issue. I'm having the server load
webdefaults.xml, so that configuration should be correct.

Where else should I be looking for this problem?

Here's the code I use to run the server in the app (slightly edited). I can
make the pdf available, if necessary.
******************************************************************

/**
 * This class runs Jetty.
 */
(Continue reading)

Ron hahne | 3 Aug 2005 10:38

Re: Problem serving pdf

Try the following it helped us:
-Dorg.mortbay.http.HttpRequest.maxFormContentSize=${MAXFORMCONTENTSIZE}

Ron Hahne
On Tue, 2005-08-02 at 18:09, Chris wrote:
I'm having a problem getting a Jetty server to serve up a large (1 mb) pdf file. When I click on a link that points to the pdf, IE downloads about half of it (according to the kb count in the status bar) and then freezes. If you try it a couple more times then sometimes IE will display it. Firefox immediately says "stopped" in the toolbar and displays nothing. The server is running locally, so this is not a problem getting the file across a bad connection. I can open the pdf fine in Acrobat directly. I can also serve it up fine under Resin -- both IE and Firefox can connect to a Resin server and display the file without a problem. I see the problem with both Jetty 5.1.1 and Jetty 5.1.4. Now here's the really tricky part: I'm running Jetty in my app as an embedded server. If instead I run it from a default Jetty installation, using start.jar, then there is no problem. The pdf displays fine. So my guess is that this is configuration issue. I'm having the server load webdefaults.xml, so that configuration should be correct. Where else should I be looking for this problem? Here's the code I use to run the server in the app (slightly edited). I can make the pdf available, if necessary. ****************************************************************** /** * This class runs Jetty. */ public class JettyInvoker { private Server server; public JettyInvoker() {} /** * Returns true if Jetty started. */ public boolean run(String home, int port, String host) throws IOException, Exception { // test to see if we're on a read-only CD File logDir = new File(home, "logs"); boolean readOnly = !logDir.canWrite(); System.setProperty("org.apache.commons.logging.LogFactory","org.mortbay.log. Factory"); LogFactory factory = LogFactory.getFactory(); LogImpl log = (LogImpl)factory.getInstance(""); // error and event log if (readOnly) { NullLogSink nullLogSink = new NullLogSink(); // defined below nullLogSink.start(); log.add(nullLogSink); // this is the only way to turn off logging completely } else { if (!logDir.exists()) logDir.mkdirs(); OutputStreamLogSink sink = new OutputStreamLogSink(dieselHome + "logs/yyyy_mm_dd.jetty.log"); sink.setAppend(true); sink.setRetainDays(1000000); sink.start(); log.add(sink); } // jsp server server = new Server(); SocketListener listener; if (host == null || host.length() == 0 || host.equals("0.0.0.0")) { listener = new SocketListener(); listener.setPort(port); } else { InetAddrPort addr = new InetAddrPort(); addr.setPort(port); addr.setHost(host); listener = new SocketListener(addr); } // this file contains user names/passwords for authentication String realmFilename = home + "users.properties"; if ((new File(realmFilename)).exists()) { HashUserRealm realm = new HashUserRealm("users", realmFilename); server.addRealm(realm); } server.addListener(listener); server.setRootWebApp("root"); //WebApplicationContext [] webapps = server.addWebApplications(null, // virtual host dieselHome + "webapps/", // webapps dir dieselHome + "webdefault.xml", // defaults true); // extract wars File docFile = new File(home, "doc"); if (docFile.exists()) { server.addWebApplication("/doc", docFile.toString()); } // request log if (!readOnly) { NCSARequestLog requestLog = new NCSARequestLog(home + "logs/yyyy_mm_dd.request.log"); // Greg Wilkins of Jetty claims that you get better performance // with buffering off, strangely enough //requestLog.setBuffered(true); requestLog.setAppend(true); requestLog.setRetainDays(1000000); requestLog.setExtended(true); // the ignore paths code only works with trailing * or // *.extension. It's not generalized wildcard matching String [] ignorePaths = {"/images/*", "/admin/images/*", "*.css"}; requestLog.setIgnorePaths(ignorePaths); server.setRequestLog(requestLog); } try { server.start(); } catch (MultiException e) { // if it's a bind exception, that is, it can't get // port 8080, this means that it's probably already // running. Not a problem, just return and launch browser Exception orig = e.getException(0); if (!(orig instanceof BindException)) { e.printStackTrace(); return false; } } return true; } public void stop() { if (server != null) { try { server.stop(); } catch (InterruptedException e) {} } } } ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Jetty-support mailing list Jetty-support <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jetty-support
Thanks,
                       \/
Ron Hahne            (* *)
C3C032             oo0()0oo
Brooker Creek : (813) 366-4052
Cell Phone    : (727) 638-0690
Christian Catchpole | 3 Aug 2005 11:05
Picon
Favicon

Super Slim Embedded Jetty


Hi,

I've been using Jetty in my project..

http://atomic.catchpole.net/

What I like about Jetty is that it's a nice clean, simple web server that I can 
invoke from within my Java application (rather than the normal approach of a 
web server with web-apps).

The only think I don't like about it, is that there are still some JAR and 
directory dependencies.  You may think I am over reacting, but I am 
purposefully designing Atomic to have as few dependencies as possible.  Atomic 
itself is not file system centric – objects exist in an abstract database and 
nothing is sourced from individual files per se.  The Servlet for the web 
interface sources all content from the object database and the Servlet is 
mapped to the "/" root.

I have accepted that I have to give the web-app an empty directory to bind to, 
but this is of course not optimal (although technically a directory is required 
to conform to the Servlet API).

As for JARs, I am forced to include commons logging and jasper (for JSP) even 
though I use neither.  I understand why we use things like commons logging – 
for general software architecture it makes perfect sense.

But for me, it has meant, to add Jetty to my application I have been forced to 
include (and support the upgrades of) all these third party libraries.

Maybe the solution is to gut the HTTP and Servlet specific code from Jetty, 
remove the logging and create my own "micro-server".

I have built simple HTTP 1.0 servers right down to the socket listener, but 
HTTP 1.1 features like chunking and persistent connections are not so trivial.

If anyone has any suggestions, I would love to hear them.

Thanks,
Christian

PS. My friend’s band needs a google indexing plug.. 
http://www.hellinahandbasketband.com/

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Chris Haynes | 3 Aug 2005 14:07
Picon

Re: Super Slim Embedded Jetty

Non-authoritative answer...

You certainly don't need to include Jasper - remove references to JSP from 
webdefaults.xml (I think that's what it's called).

Have you checked out the entire Jetty download site? Greg has been working on an 
experimental version which is said to be very small, and there are also 
instructions in README files about building minimal configs.  I'm also pretty 
sure that there are lotsof logging options (with some releases not requiring 
commons logging).

Chris

----- Original Message ----- 
From: "Christian Catchpole" <christiancatchpole <at> hotmail.com>
To: <jetty-support <at> lists.sourceforge.net>
Sent: Wednesday, August 03, 2005 10:05 AM
Subject: [Jetty-support] Super Slim Embedded Jetty

Hi,

I've been using Jetty in my project..

http://atomic.catchpole.net/

What I like about Jetty is that it's a nice clean, simple web server that I can
invoke from within my Java application (rather than the normal approach of a
web server with web-apps).

The only think I don't like about it, is that there are still some JAR and
directory dependencies.  You may think I am over reacting, but I am
purposefully designing Atomic to have as few dependencies as possible.  Atomic
itself is not file system centric – objects exist in an abstract database and
nothing is sourced from individual files per se.  The Servlet for the web
interface sources all content from the object database and the Servlet is
mapped to the "/" root.

I have accepted that I have to give the web-app an empty directory to bind to,
but this is of course not optimal (although technically a directory is required
to conform to the Servlet API).

As for JARs, I am forced to include commons logging and jasper (for JSP) even
though I use neither.  I understand why we use things like commons logging –
for general software architecture it makes perfect sense.

But for me, it has meant, to add Jetty to my application I have been forced to
include (and support the upgrades of) all these third party libraries.

Maybe the solution is to gut the HTTP and Servlet specific code from Jetty,
remove the logging and create my own "micro-server".

I have built simple HTTP 1.0 servers right down to the socket listener, but
HTTP 1.1 features like chunking and persistent connections are not so trivial.

If anyone has any suggestions, I would love to hear them.

Thanks,
Christian

PS. My friend’s band needs a google indexing plug..
http://www.hellinahandbasketband.com/

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Eric Rizzo | 3 Aug 2005 17:36
Picon

Re: Super Slim Embedded Jetty

On 8/3/05, Christian Catchpole <christiancatchpole <at> hotmail.com> wrote:
> As for JARs, I am forced to include commons logging and jasper (for JSP) even
> though I use neither.  I understand why we use things like commons logging 
> for general software architecture it makes perfect sense.
> 
> But for me, it has meant, to add Jetty to my application I have been forced to
> include (and support the upgrades of) all these third party libraries.

As someone else mentioned, you don't need Jasper if you aren't using JSP.
Also, I used Jetty 4.2.x on a previous project and I'm pretty sure it
did not have any dependency on commons logging. In fact, other than
javax.servlet I don't think it had any external dependencies at all
(assuming you're using a 1.4 JVM that includes the XML parser). I know
it is a generation or two behind, but you might look at using Jetty
4.2 instead of
5.x

HTH,
Eric
HS^隊X'u(j̋{2(+jب+kjנb"^Z0Flڊm~jZ؜"+bmƬƧvj+xgzbwv z۩)y_jalgri؝;eȝ^j)brB^ܬhٚXX+.+X(~zwilqzlX)ߣ޶ܬh
Chris | 3 Aug 2005 19:09
Picon
Favicon

Re: Problem serving pdf

Thanks for the suggestion. It does not seem to help, though. I think the
issue has less to do with form content going from the browser to the server
than it does with large hunks of pdf content going from the server to the
browser.

"Ron hahne" <Ronald_D_Hahne <at> NielsenMedia.com> wrote in message
news:1123058319.32712.12.camel <at> npowerdevrdh...
Try the following it helped us:
-Dorg.mortbay.http.HttpRequest.maxFormContentSize=${MAXFORMCONTENTSIZE}

Ron Hahne
On Tue, 2005-08-02 at 18:09, Chris wrote:
I'm having a problem getting a Jetty server to serve up a large (1 mb) pdf
file. When I click on a link that points to the pdf, IE downloads about half
of it (according to the kb count in the status bar) and then freezes. If you
try it a couple more times then sometimes IE will display it. Firefox
immediately says "stopped" in the toolbar and displays nothing.

The server is running locally, so this is not a problem getting the file
across a bad connection.

I can open the pdf fine in Acrobat directly. I can also serve it up fine
under Resin -- both IE and Firefox can connect to a Resin server and display
the file without a problem.

I see the problem with both Jetty 5.1.1 and Jetty 5.1.4.

Now here's the really tricky part: I'm running Jetty in my app as an
embedded server. If instead I run it from a default Jetty installation,
using start.jar, then there is no problem. The pdf displays fine. So my
guess is that this is configuration issue. I'm having the server load
webdefaults.xml, so that configuration should be correct.

Where else should I be looking for this problem?

Here's the code I use to run the server in the app (slightly edited). I can
make the pdf available, if necessary.
******************************************************************

/**
 * This class runs Jetty.
 */
public class JettyInvoker {
    private Server server;

    public JettyInvoker() {}

    /**
     * Returns true if Jetty started.
     */
    public boolean run(String home, int port, String host) throws
IOException, Exception {

        // test to see if we're on a read-only CD
        File logDir = new File(home, "logs");
        boolean readOnly = !logDir.canWrite();

System.setProperty("org.apache.commons.logging.LogFactory","org.mortbay.log.
Factory");
        LogFactory factory = LogFactory.getFactory();
        LogImpl log = (LogImpl)factory.getInstance("");

        // error and event log
        if (readOnly) {
            NullLogSink nullLogSink = new NullLogSink(); // defined below
            nullLogSink.start();
            log.add(nullLogSink); // this is the only way to turn off
logging completely
        } else {
            if (!logDir.exists())
                logDir.mkdirs();
            OutputStreamLogSink sink =
                new OutputStreamLogSink(dieselHome +
"logs/yyyy_mm_dd.jetty.log");
            sink.setAppend(true);
            sink.setRetainDays(1000000);
            sink.start();
            log.add(sink);
        }

        // jsp server
        server = new Server();
        SocketListener listener;
        if (host == null || host.length() == 0 || host.equals("0.0.0.0")) {
            listener = new SocketListener();
            listener.setPort(port);
        } else {
            InetAddrPort addr = new InetAddrPort();
            addr.setPort(port);
            addr.setHost(host);
            listener = new SocketListener(addr);
        }

        // this file contains user names/passwords for authentication
        String realmFilename = home + "users.properties";
        if ((new File(realmFilename)).exists()) {
            HashUserRealm realm = new HashUserRealm("users", realmFilename);
            server.addRealm(realm);
        }

        server.addListener(listener);
        server.setRootWebApp("root");

        //WebApplicationContext [] webapps =
        server.addWebApplications(null, // virtual host
            dieselHome + "webapps/", // webapps dir
            dieselHome + "webdefault.xml", // defaults
            true); // extract wars

        File docFile = new File(home, "doc");
        if (docFile.exists()) {
            server.addWebApplication("/doc", docFile.toString());
        }

        // request log
        if (!readOnly) {
            NCSARequestLog requestLog =
                new NCSARequestLog(home + "logs/yyyy_mm_dd.request.log");

            // Greg Wilkins of Jetty claims that you get better performance
            // with buffering off, strangely enough
            //requestLog.setBuffered(true);

            requestLog.setAppend(true);
            requestLog.setRetainDays(1000000);
            requestLog.setExtended(true);

            // the ignore paths code only works with trailing * or
            // *.extension. It's not generalized wildcard matching
            String [] ignorePaths = {"/images/*", "/admin/images/*",
"*.css"};
            requestLog.setIgnorePaths(ignorePaths);

            server.setRequestLog(requestLog);
        }

        try {
            server.start();
        } catch (MultiException e) {
            // if it's a bind exception, that is, it can't get
            // port 8080, this means that it's probably already
            // running. Not a problem, just return and launch browser
            Exception orig = e.getException(0);
            if (!(orig instanceof BindException)) {
                e.printStackTrace();
                return false;
            }
        }
        return true;
    }

    public void stop() {
        if (server != null) {
            try {
                server.stop();
            } catch (InterruptedException e) {}
        }
    }

}

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support
Thanks,                       \/Ron Hahne            (* *)C3C032
oo0()0ooBrooker Creek : (813) 366-4052Cell Phone    : (727) 638-0690

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Chris Haynes | 3 Aug 2005 21:07
Picon

Re: Problem serving pdf

Are you serving it using a GET or a POST? . Does the request have data values in
it (x=...&y=.. and so on).

Has the PDF file been 'optimized' - an option available when saving the PDF
file.

Chris Haynes

"Chris" <shef31 <at> yahoo.com> asked:

> I'm having a problem getting a Jetty server to serve up a large (1 mb) pdf
> file. When I click on a link that points to the pdf, IE downloads about half
> of it (according to the kb count in the status bar) and then freezes. If you
> try it a couple more times then sometimes IE will display it. Firefox
> immediately says "stopped" in the toolbar and displays nothing.
>
> The server is running locally, so this is not a problem getting the file
> across a bad connection.
>
> I can open the pdf fine in Acrobat directly. I can also serve it up fine
> under Resin -- both IE and Firefox can connect to a Resin server and display
> the file without a problem.
>
> I see the problem with both Jetty 5.1.1 and Jetty 5.1.4.
>
> Now here's the really tricky part: I'm running Jetty in my app as an
> embedded server. If instead I run it from a default Jetty installation,
> using start.jar, then there is no problem. The pdf displays fine. So my
> guess is that this is configuration issue. I'm having the server load
> webdefaults.xml, so that configuration should be correct.
>
> Where else should I be looking for this problem?
>
> Here's the code I use to run the server in the app (slightly edited). I can
> make the pdf available, if necessary.
> ******************************************************************
>
> /**
> * This class runs Jetty.
> */
> public class JettyInvoker {
>    private Server server;
>
>    public JettyInvoker() {}
>
>    /**
>     * Returns true if Jetty started.
>     */
>    public boolean run(String home, int port, String host) throws
> IOException, Exception {
>
>        // test to see if we're on a read-only CD
>        File logDir = new File(home, "logs");
>        boolean readOnly = !logDir.canWrite();
>
>
> System.setProperty("org.apache.commons.logging.LogFactory","org.mortbay.log.
> Factory");
>        LogFactory factory = LogFactory.getFactory();
>        LogImpl log = (LogImpl)factory.getInstance("");
>
>        // error and event log
>        if (readOnly) {
>            NullLogSink nullLogSink = new NullLogSink(); // defined below
>            nullLogSink.start();
>            log.add(nullLogSink); // this is the only way to turn off
> logging completely
>        } else {
>            if (!logDir.exists())
>                logDir.mkdirs();
>            OutputStreamLogSink sink =
>                new OutputStreamLogSink(dieselHome +
> "logs/yyyy_mm_dd.jetty.log");
>            sink.setAppend(true);
>            sink.setRetainDays(1000000);
>            sink.start();
>            log.add(sink);
>        }
>
>        // jsp server
>        server = new Server();
>        SocketListener listener;
>        if (host == null || host.length() == 0 || host.equals("0.0.0.0")) {
>            listener = new SocketListener();
>            listener.setPort(port);
>        } else {
>            InetAddrPort addr = new InetAddrPort();
>            addr.setPort(port);
>            addr.setHost(host);
>            listener = new SocketListener(addr);
>        }
>
>        // this file contains user names/passwords for authentication
>        String realmFilename = home + "users.properties";
>        if ((new File(realmFilename)).exists()) {
>            HashUserRealm realm = new HashUserRealm("users", realmFilename);
>            server.addRealm(realm);
>        }
>
>        server.addListener(listener);
>        server.setRootWebApp("root");
>
>        //WebApplicationContext [] webapps =
>        server.addWebApplications(null, // virtual host
>            dieselHome + "webapps/", // webapps dir
>            dieselHome + "webdefault.xml", // defaults
>            true); // extract wars
>
>        File docFile = new File(home, "doc");
>        if (docFile.exists()) {
>            server.addWebApplication("/doc", docFile.toString());
>        }
>
>        // request log
>        if (!readOnly) {
>            NCSARequestLog requestLog =
>                new NCSARequestLog(home + "logs/yyyy_mm_dd.request.log");
>
>            // Greg Wilkins of Jetty claims that you get better performance
>            // with buffering off, strangely enough
>            //requestLog.setBuffered(true);
>
>            requestLog.setAppend(true);
>            requestLog.setRetainDays(1000000);
>            requestLog.setExtended(true);
>
>            // the ignore paths code only works with trailing * or
>            // *.extension. It's not generalized wildcard matching
>            String [] ignorePaths = {"/images/*", "/admin/images/*",
> "*.css"};
>            requestLog.setIgnorePaths(ignorePaths);
>
>            server.setRequestLog(requestLog);
>        }
>
>        try {
>            server.start();
>        } catch (MultiException e) {
>            // if it's a bind exception, that is, it can't get
>            // port 8080, this means that it's probably already
>            // running. Not a problem, just return and launch browser
>            Exception orig = e.getException(0);
>            if (!(orig instanceof BindException)) {
>                e.printStackTrace();
>                return false;
>            }
>        }
>        return true;
>    }
>
>    public void stop() {
>        if (server != null) {
>            try {
>                server.stop();
>            } catch (InterruptedException e) {}
>        }
>    }
>
> }
>

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Chris | 4 Aug 2005 01:12
Picon
Favicon

Re: Problem serving pdf

We're using a GET. There are no parameters in the URL.

I do not know if the program we're using to generate the pdf optimizes it. I
did try several other random, large pdfs, though, from a variety of sources.
Some of them crash Firefox and IE and some don't. Firefox will sometime
display the status bar message "Waiting for locahost..." before choking.

I reconfirmed that all of the large pdfs are served up by Resin without a
problem.

I seem to recall that we saw a problem like this before. It had to do with
the way Jetty serves chunks or ranges of a pdf. Is there a way to turn off
the ability to return ranges? That might help us diagnose the problem.

"Chris Haynes" <chris <at> harvington.org.uk> wrote in message
news:013001c5985e$9737c710$0600000a <at> john...
> Are you serving it using a GET or a POST? . Does the request have data
values in
> it (x=...&y=.. and so on).
>
> Has the PDF file been 'optimized' - an option available when saving the
PDF
> file.
>
> Chris Haynes
>
> "Chris" <shef31 <at> yahoo.com> asked:
>
> > I'm having a problem getting a Jetty server to serve up a large (1 mb)
pdf
> > file. When I click on a link that points to the pdf, IE downloads about
half
> > of it (according to the kb count in the status bar) and then freezes. If
you
> > try it a couple more times then sometimes IE will display it. Firefox
> > immediately says "stopped" in the toolbar and displays nothing.
> >
> > The server is running locally, so this is not a problem getting the file
> > across a bad connection.
> >
> > I can open the pdf fine in Acrobat directly. I can also serve it up fine
> > under Resin -- both IE and Firefox can connect to a Resin server and
display
> > the file without a problem.
> >
> > I see the problem with both Jetty 5.1.1 and Jetty 5.1.4.
> >
> > Now here's the really tricky part: I'm running Jetty in my app as an
> > embedded server. If instead I run it from a default Jetty installation,
> > using start.jar, then there is no problem. The pdf displays fine. So my
> > guess is that this is configuration issue. I'm having the server load
> > webdefaults.xml, so that configuration should be correct.
> >
> > Where else should I be looking for this problem?
> >
> > Here's the code I use to run the server in the app (slightly edited). I
can
> > make the pdf available, if necessary.
> > ******************************************************************
> >
> > /**
> > * This class runs Jetty.
> > */
> > public class JettyInvoker {
> >    private Server server;
> >
> >    public JettyInvoker() {}
> >
> >    /**
> >     * Returns true if Jetty started.
> >     */
> >    public boolean run(String home, int port, String host) throws
> > IOException, Exception {
> >
> >        // test to see if we're on a read-only CD
> >        File logDir = new File(home, "logs");
> >        boolean readOnly = !logDir.canWrite();
> >
> >
> >
System.setProperty("org.apache.commons.logging.LogFactory","org.mortbay.log.
> > Factory");
> >        LogFactory factory = LogFactory.getFactory();
> >        LogImpl log = (LogImpl)factory.getInstance("");
> >
> >        // error and event log
> >        if (readOnly) {
> >            NullLogSink nullLogSink = new NullLogSink(); // defined below
> >            nullLogSink.start();
> >            log.add(nullLogSink); // this is the only way to turn off
> > logging completely
> >        } else {
> >            if (!logDir.exists())
> >                logDir.mkdirs();
> >            OutputStreamLogSink sink =
> >                new OutputStreamLogSink(dieselHome +
> > "logs/yyyy_mm_dd.jetty.log");
> >            sink.setAppend(true);
> >            sink.setRetainDays(1000000);
> >            sink.start();
> >            log.add(sink);
> >        }
> >
> >        // jsp server
> >        server = new Server();
> >        SocketListener listener;
> >        if (host == null || host.length() == 0 || host.equals("0.0.0.0"))
{
> >            listener = new SocketListener();
> >            listener.setPort(port);
> >        } else {
> >            InetAddrPort addr = new InetAddrPort();
> >            addr.setPort(port);
> >            addr.setHost(host);
> >            listener = new SocketListener(addr);
> >        }
> >
> >        // this file contains user names/passwords for authentication
> >        String realmFilename = home + "users.properties";
> >        if ((new File(realmFilename)).exists()) {
> >            HashUserRealm realm = new HashUserRealm("users",
realmFilename);
> >            server.addRealm(realm);
> >        }
> >
> >        server.addListener(listener);
> >        server.setRootWebApp("root");
> >
> >        //WebApplicationContext [] webapps =
> >        server.addWebApplications(null, // virtual host
> >            dieselHome + "webapps/", // webapps dir
> >            dieselHome + "webdefault.xml", // defaults
> >            true); // extract wars
> >
> >        File docFile = new File(home, "doc");
> >        if (docFile.exists()) {
> >            server.addWebApplication("/doc", docFile.toString());
> >        }
> >
> >        // request log
> >        if (!readOnly) {
> >            NCSARequestLog requestLog =
> >                new NCSARequestLog(home + "logs/yyyy_mm_dd.request.log");
> >
> >            // Greg Wilkins of Jetty claims that you get better
performance
> >            // with buffering off, strangely enough
> >            //requestLog.setBuffered(true);
> >
> >            requestLog.setAppend(true);
> >            requestLog.setRetainDays(1000000);
> >            requestLog.setExtended(true);
> >
> >            // the ignore paths code only works with trailing * or
> >            // *.extension. It's not generalized wildcard matching
> >            String [] ignorePaths = {"/images/*", "/admin/images/*",
> > "*.css"};
> >            requestLog.setIgnorePaths(ignorePaths);
> >
> >            server.setRequestLog(requestLog);
> >        }
> >
> >        try {
> >            server.start();
> >        } catch (MultiException e) {
> >            // if it's a bind exception, that is, it can't get
> >            // port 8080, this means that it's probably already
> >            // running. Not a problem, just return and launch browser
> >            Exception orig = e.getException(0);
> >            if (!(orig instanceof BindException)) {
> >                e.printStackTrace();
> >                return false;
> >            }
> >        }
> >        return true;
> >    }
> >
> >    public void stop() {
> >        if (server != null) {
> >            try {
> >                server.stop();
> >            } catch (InterruptedException e) {}
> >        }
> >    }
> >
> > }
> >
>
>
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Jetty-support mailing list
> Jetty-support <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Christian Catchpole | 4 Aug 2005 01:34
Picon
Favicon

Re: Super Slim Embedded Jetty

Eric Rizzo <eric.rizzo.backup <at> gmail.com> writes:

> 
> On 8/3/05, Christian Catchpole <christiancatchpole <at> hotmail.com> wrote:
> > As for JARs, I am forced to include commons logging and jasper (for JSP) 
even
> > though I use neither.  I understand why we use things like commons logging –
> > for general software architecture it makes perfect sense.
> > 
> > But for me, it has meant, to add Jetty to my application I have been forced 
to
> > include (and support the upgrades of) all these third party libraries.
> 
> As someone else mentioned, you don't need Jasper if you aren't using JSP.
> Also, I used Jetty 4.2.x on a previous project and I'm pretty sure it
> did not have any dependency on commons logging. In fact, other than
> javax.servlet I don't think it had any external dependencies at all
> (assuming you're using a 1.4 JVM that includes the XML parser). I know
> it is a generation or two behind, but you might look at using Jetty
> 4.2 instead of 5.x
> 
> HTH,
> Eric
> HS^µéšŠX¬²š'²ŠÞu¼ƒŠÇ(½êÄjÌ‹Š{±2(+jب

Hi Eric,

I have been using 4. something and recently downloaded the latest stable 
release - and noticed it uses commons logging.  So perhaps your right in that I 
should revert to the old one - although it would be nice to keep up with other 
developments.  I cant have everything I guess :)

As for Jasper, another post suggests removing JSP from Web Defaults.  The 
problem with that is I'm instantiating the Jetty Web Server object and 
configuring it programaticlay.  But i'm sure i'll find the switch to turn JSP 
off. :)

Thanks,
Christian

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support


Gmane