Re: [jetty-user] Usage of String.split in HttpConnection

Jan Bartel <[email protected]>
Newsgroups gmane.comp.java.jetty.support
Organization Webtide
Message-ID <[email protected]>
Matt,

http://jira.codehaus.org/browse/JETTY-1293

This should make it into the current 6.1.26 release cycle.

cheers
Jan


On 20/10/10 09:33, Matt Tennant wrote:
> I have run across an issue in our usage of Jetty which I would like to
> bounce off this list.  We have an application that runs in an OSGi
> environment, and we use the Apache Felix Jetty OSGi bundle version 1.0.0
> to provide Jetty.  The Jetty version in that OSGi bundle is 6.1.14.  In
> a recent run, we got the following exception:
>
> java.lang.NoSuchMethodError: java.lang.String: method
>
> split(Ljava/lang/String;)[Ljava/lang/String; not found
>
>      at org.mortbay.jetty.HttpConnection$RequestHandler.parsedHeader(Unknown
>
> Source)
>
>      at org.mortbay.jetty.HttpParser.parseNext(Unknown Source)
>
>      at org.mortbay.jetty.HttpParser.parseAvailable(Unknown Source)
>
>      at org.mortbay.jetty.HttpConnection.handle(Unknown Source)
>
>      at org.mortbay.jetty.bio.SocketConnector$Connection.run(Unknown Source)
>
>      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(Unknown Source)
>
>      at java.lang.Thread.startup(Unknown Source)
>
> Note that we run with a JVM that supplies the Connected Device
> Configuration, and the CDC does not contain a split method for the
> String class, as you can see here:
>
> http://download.oracle.com/javame/config/cdc/ref-impl/cdc1.1.2/jsr218/java/lang/String.html
>
> After some looking around, it appears that Jetty is supposed to be
> CDC-compatible, as mentioned here:
>
>
>
> http://docs.codehaus.org/display/JETTY/J2ME+CDC
>
>
>
> I downloaded the 6.1.14 Jetty source, as well as the latest 6.1 source (6.1.25).  In both cases I found the String.split usage, as seen here in the 6.1.25 version of HttpConnection.java:
>
>
>
> grep -n --context=5 split HttpConnection.java
>
> 819-                    int ordinal = HttpHeaderValues.CACHE.getOrdinal(value);
>
> 820-                    switch (ordinal)
>
> 821-                    {
>
> 822-                        case -1:
>
> 823-                        {
>
> 824:                            String[] values = value.toString().split(",");
>
> 825-                            for (int i = 0; values != null&&  i<  values.length; i++)
>
> 826-                            {
>
> 827-                                CachedBuffer cb = HttpHeaderValues.CACHE.get(values[i].trim());
>
> 828-
>
> 829-                                if (cb != null)
>
>
>
> Some quick grepping shows that the String.split method is also used in a few other places.  So, can anyone tell me whether this is a bug?  Please give me any suggestions based on my research above.
>
>


-- 
Jan Bartel, Webtide LLC | [email protected] | http://www.webtide.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.