Michael Eastwood | 1 Oct 04:31 2003
Picon

[Jetty-support] Problem starting jetty plus

Hello.

Have been looking at the JettyPlus bits and pieces, and came across a 
couple of problems:

1.  Trying to start the jettyplus demo, ant exits with a xercesImpl 
parsing exception (can't put '--' inside a comment).  Specifically, 
lines 60-65 of jettyplus.xml contain 'comments' such as -- millis -- 
which interfere with parsing.  Changing these to - millis - allowed the 
demo to run correctly.

2.  Trying to weave JNDI Datasource lookups into my own code, I 
reconfigured the server to use the org.mortbay.jetty.plus.Server class, 
and edited start.config in start.jar as per instructions on 
http://jetty.mortbay.org/jetty/plus/.  Unfortunately, with these changes 
made start.jar becomes useless, exiting with NullPointerExceptions. 
Specifically, org/mortbay/plus/Server.java in its main method creates 
new Servers as per the xml configuration, then tries immediately to 
start each one.  Starting involves iterating over the service list. 
This service list is not initialized unless the xml configuration file 
contains at least one "addService" call.  This requirement isn't stated 
on the plus page above, or in the README file that comes in the plus 
section's build area.  Although it might seem obvious that you would 
want to congiure services to bother using the plus server, a more 
helpful error message, or a little doco might smooth the way.

Michael

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
(Continue reading)

Roland van Woerkom | 1 Oct 10:04 2003
Picon

[Jetty-support] request.getParameter in servlet

Hello,

When I submit a form to a servlet the euro-sign show up as '?' in request.getParameter.
When I submit this same form to a jsp all works ok and the '€' is displayed.
How is this possible?
 
I tried this in jboss 3.0.7 and 3.2.1 whith the same results.
I use a POST in the form, so that should be ok. In the java version of the jsp generated by Jetty, I can see that the character encoding of the response is set to ISO-8859-1 by response.setContentType("text/html;ISO-8859-1"). I did the same in the servlet, I think this should be OK.
 

Does anybody know how to solve this? 
regards,
 
Roland
Chris Haynes | 1 Oct 10:14 2003
Picon

Re: [Jetty-support] request.getParameter in servlet

Roland,

The character decoding applied to the request parameters can be set by
calling request.setCharacterEncoding() before asking for _any_ of the
parameters. This is probably what JSP is doing, and you need to do
this in your Servlet.

The whole process of handing non-ASCII characters is complex - see
http://jetty.mortbay.org/jetty/doc/international.html

Chris
p.s. Please don't send HTML to mailing lists

Roland van Woerkom  asked:

Hello,

When I submit a form to a servlet the euro-sign show up as '?' in
request.getParameter.
When I submit this same form to a jsp all works ok and the '€' is
displayed.
How is this possible?

I tried this in jboss 3.0.7 and 3.2.1 whith the same results.
I use a POST in the form, so that should be ok. In the java version of
the jsp generated by Jetty, I can see that the character encoding of
the response is set to ISO-8859-1 by
response.setContentType("text/html;ISO-8859-1"). I did the same in the
servlet, I think this should be OK.

Does anybody know how to solve this?
regards,

Roland

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Michael Eastwood | 1 Oct 10:44 2003
Picon

Re: [Jetty-support] request.getParameter in servlet

Character encoding does get tricky, and it depends what you're using to 
look at the character in question. In addition to Chris's advice, you 
might try setting your character encoding to UTF-8. I use it habitually 
instead of ISO-8559-1 to avoid problems like the one you're having.

Michael

Roland van Woerkom wrote:

> Hello,
>
> When I submit a form to a servlet the euro-sign show up as '?' in 
> request.getParameter.
> When I submit this same form to a jsp all works ok and the '€' is 
> displayed.
> How is this possible?
> I tried this in jboss 3.0.7 and 3.2.1 whith the same results.
> I use a POST in the form, so that should be ok. In the java version of 
> the jsp generated by Jetty, I can see that the character encoding of 
> the response is set to ISO-8859-1 by 
> response.setContentType("text/html;ISO-8859-1"). I did the same in the 
> servlet, I think this should be OK.
>
> Does anybody know how to solve this?
> regards,
> Roland

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Wadge, Nick | 1 Oct 14:45 2003

[Jetty-support] Chunking

Hi
 
Does anyone know how to get chunking working with Jetty?  Spoofed requests such as this:
 
telnet localhost 80
GET /web-console/index.html HTTP/1.1
Host: localhost
Transfer-Encoding: chunked
Connection: close
 
do not seem to result in a chunked response.
 
TIA
 
Nick


PLEASE READ: The information contained in this email is confidential
and intended for the named recipient(s) only. If you are not an intended
recipient of this email you must not copy, distribute or take any
further action in reliance on it and you should delete it and notify the
sender immediately. Email is not a secure method of communication and
Nomura International plc cannot accept responsibility for the accuracy
or completeness of this message or any attachment(s). Please examine this
email for virus infection, for which Nomura International plc accepts
no responsibility. If verification of this email is sought then please
request a hard copy. Unless otherwise stated any views or opinions
presented are solely those of the author and do not represent those of
Nomura International plc. This email is intended for informational
purposes only and is not a solicitation or offer to buy or sell
securities or related financial instruments. Nomura International plc is
regulated by the Financial Services Authority and is a member of the
London Stock Exchange.

Wadge, Nick | 1 Oct 14:48 2003

[Jetty-support] Cache-control

I would like to specify the cache age for static content such as gifs and JPEGs, but cannot determine how to do this with Jetty.  I would appreciate any help.
 
TIA
 
Nick


PLEASE READ: The information contained in this email is confidential
and intended for the named recipient(s) only. If you are not an intended
recipient of this email you must not copy, distribute or take any
further action in reliance on it and you should delete it and notify the
sender immediately. Email is not a secure method of communication and
Nomura International plc cannot accept responsibility for the accuracy
or completeness of this message or any attachment(s). Please examine this
email for virus infection, for which Nomura International plc accepts
no responsibility. If verification of this email is sought then please
request a hard copy. Unless otherwise stated any views or opinions
presented are solely those of the author and do not represent those of
Nomura International plc. This email is intended for informational
purposes only and is not a solicitation or offer to buy or sell
securities or related financial instruments. Nomura International plc is
regulated by the Financial Services Authority and is a member of the
London Stock Exchange.

Jan Bartel | 1 Oct 15:18 2003

Re: [Jetty-support] Problem starting jetty plus

Michael Eastwood wrote:
> Hello.
> 
> Have been looking at the JettyPlus bits and pieces, and came across a 
> couple of problems:
> 
> 1.  Trying to start the jettyplus demo, ant exits with a xercesImpl 
> parsing exception (can't put '--' inside a comment).  Specifically, 
> lines 60-65 of jettyplus.xml contain 'comments' such as -- millis -- 
> which interfere with parsing.  Changing these to - millis - allowed the 
> demo to run correctly.
Which version of xerces are you using? I'll change the comment lines 
anyway to be on the safe side.

> 2.  Trying to weave JNDI Datasource lookups into my own code, I 
> reconfigured the server to use the org.mortbay.jetty.plus.Server class, 
> and edited start.config in start.jar as per instructions on 
> http://jetty.mortbay.org/jetty/plus/.  Unfortunately, with these changes 
> made start.jar becomes useless, exiting with NullPointerExceptions. 
> Specifically, org/mortbay/plus/Server.java in its main method creates 
> new Servers as per the xml configuration, then tries immediately to 
> start each one.  Starting involves iterating over the service list. This 
> service list is not initialized unless the xml configuration file 
> contains at least one "addService" call.  This requirement isn't stated 
> on the plus page above, or in the README file that comes in the plus 
> section's build area.  Although it might seem obvious that you would 
> want to congiure services to bother using the plus server, a more 
> helpful error message, or a little doco might smooth the way.
Funny how these things come in pairs .... just earlier this week there 
has been a thread on this list about this very problem. I've already 
promised to fix up the NullPointer ASAP in both HEAD and Jetty 4.2.x.

cheers
Jan

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Jan Bartel | 1 Oct 15:44 2003

Re: [Jetty-support] Class Loader / Class Path Questions

Joe,
> 
> 	   Second, here is the batch file I'm using to startup
> 	The http server and register my selvlet:
> 
>  <at> echo off
> set CP=%JETTY_HOME%\lib\javax.servlet.jar
> set CP=%CP%;%JETTY_HOME%\lib\org.mortbay.jetty.jar
> set CP=%CP%;%JETTY_HOME%\lib\org.mortbay.jmx.jar
> set CP=%CP%;%JETTY_HOME%\ext\jasper-runtime.jar
> set CP=%CP%;%JETTY_HOME%\ext\jasper-compiler.jar
> set CP=%CP%;%JETTY_HOME%\ext\crimson.jar
> set CP=%CP%;%JETTY_HOME%\ext\javax.xml.jaxp.jar
> set CP=%CP%;%JETTY_HOME%\ext\jnet.jar
> set CP=%CP%;%JETTY_HOME%\ext\jcert.jar
> set CP=%CP%;%JETTY_HOME%\ext\jsse.jar
> set CP=%CP%;%JETTY_HOME%\ext\ant.jar
> set CP=%CP%;%JAVA_HOME%\lib\tools.jar
> set CP=%CP%;%JAVA_HOME%\jre\lib
> set CP=%CP%;c:\tools\formalogix\classes
> set CP=%CP%;C:\tools\formalogix\lib\log4j-1.2.8.jar
> set CP="%CP%"
> 
> %JAVA_HOME%\bin\java -Djetty.home=c:\tools\Jetty -cp %CP% -jar
> %JETTY_HOME%\start.jar formalogix.xml
> 
> 	When I startup the http server, I'm getting a classDefNotFound error
> On my Ping servlet.  The class file exists in 
> c:\tools\formalogix\classes\com\questerra\formalogix\web\util\Ping.class

Dont' set the classpath and use start.jar at the same time - the idea of 
start.jar is that it removes the necessity for explicitly setting up the 
classpath. In fact, I think if you use start.jar, the classpath you've 
set up is ignored.

> 
> 	So, given that error, I have a few questions:
> 
> 	1) Why is the class loader not able to locate my Ping servlet?
Because you're using start.jar and haven't put your servlet class into 
one of the standard places that start.jar looks to find classfiles, eg
$JETTY_HOME/ext or $JETTY_HOME/extra/ext, or as you point out, setting 
the jetty.class.path property.

> 	2) What is the difference between setting the class path as -cp on
> the Java exe, versus using -Djetty.class.path ?? 
I think this one is covered above.

> 	3) What is the format for supplying multiple class paths in the
> -Djetty.class.path ?  Separating them by semi-colons causes other problems.
I think the formats supported are any ONE of the following:
  blah/
    - puts the contents of the directory blah onto the classpath (cf 
'classes/')

  blah/*
    - puts all jars in blah directory onto the classpath

  blah.class
    - puts the blah.class onto the classpath

  blah.jar
    - puts the blah.jar onto the classpath

good luck,
Jan

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Javier Soques | 1 Oct 15:54 2003
Picon

[Jetty-support] Newbie: problems starting JettyPlus

Im trying to get Jetty to use the Plus library as per
instructions on the Jetty web site but I get some
errors when starting. Here is my output:

09:47:13.063 EVENT  Checking Resource aliases
09:47:14.585 WARN!!
java.lang.NullPointerException
        at
org.mortbay.jetty.plus.Server.start(Server.java:113)
        at
org.mortbay.jetty.plus.Server.main(Server.java:176)
        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.mortbay.start.Main.invokeMain(Main.java:150)
        at org.mortbay.start.Main.start(Main.java:468)
        at org.mortbay.start.Main.main(Main.java:88)

09:47:14.635 EVENT  Shutdown hook executing
09:47:14.635 EVENT  Stopped
WebApplicationContext[/jetty,D:\Jetty-4.2.12/demo/we
bapps/jetty]
09:47:14.635 EVENT  Stopped
ServletHttpContext[/cgi-bin]
09:47:14.635 EVENT  Stopped
WebApplicationContext[/,D:\Jetty-4.2.12/demo/webapps
/root]
09:47:14.635 EVENT  Stopped ServletHttpContext[/demo]
09:47:14.635 EVENT  Stopped
WebApplicationContext[/examples,D:\Jetty-4.2.12/demo
/webapps/examples]
09:47:14.635 EVENT  Stopped
ServletHttpContext[/javadoc]
09:47:14.635 EVENT  Stopped
org.mortbay.jetty.plus.Server <at> 1908ca1
09:47:14.635 WARN!!
java.lang.NullPointerException
        at
org.mortbay.jetty.plus.Server.stop(Server.java:147)
        at
org.mortbay.http.HttpServer.stop(HttpServer.java:700)
        at
org.mortbay.jetty.plus.Server$1.run(Server.java:202)

This is how I started Jetty:
D:\Jetty-4.2.12>java
-Djetty.server=org.mortbay.jetty.plus.Server
-Dlog4j.config
uration=log4j.xml -jar start.jar etc/demo.xml

Thanks
Javier

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support

Jan Bartel | 1 Oct 17:27 2003

Re: [Jetty-support] Newbie: problems starting JettyPlus

Javier,
> I´m trying to get Jetty to use the Plus library as per
> instructions on the Jetty web site but I get some
> errors when starting. Here is my output:
<snip>
> This is how I started Jetty:
> D:\Jetty-4.2.12>java
> -Djetty.server=org.mortbay.jetty.plus.Server
> -Dlog4j.config
> uration=log4j.xml -jar start.jar etc/demo.xml
Firstly, the standard etc/demo.xml file is not, properly speaking, a 
JettyPlus configuration file, as it is configuring the standard 
o.m.j.Server class, not the o.m.j.p.Server class ie:

etc/demo.xml:
<Configure class="org.mortbay.jetty.Server">

a valid jettyplus xml file:
<Configure class="org.mortbay.jetty.plus.Server">

etc/demo.xml will kind of work because o.m.j.p.Server is a subclass of 
o.m.j.Server (all the standard Jetty features will be configured ok, but 
all JettyPlus features will be missing).

Your real problem is the NullPointer exception that is caused by not 
having any services configured in the xml file . There have been 2 or 3 
other postings on this topic this week (seems it's a popular bug!). In 
your case, you don't have any services configured because you've used a 
standard jetty config file rather than a jettyplus one as explained 
above. Have a look at the $JETTY_HOME/extra/etc/jettyplus.xml config 
file for an example of how to set up a jettyplus config file.

As regards the NullPointer exception, I've now fixed this problem and 
committed it to the Jetty_4_2 branch and HEAD. Releases should follow soon.

cheers,
Jan

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support


Gmane