Re: Jetty on J2ME-CDC

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Jetty on J2ME-CDC

Niclas Hedhman
On Friday 22 April 2005 22:08, Chia Chang wrote:
> * How to shrink the size of and optimize Jetty for J2ME-CDC?

Look into which classes that are actually used and drop the rest in Jetty.
Some J2ME kits can do this automatically, otherwise a manual analysis (a.k.a.
trial/error :o) ) should reveal that Jetty is fairly modular.

> * Got a SQLException ClassNotFound error even though I am not using SQL.
> To workaround this problem, I have to use the entire foundation_jdbc.jar
> which increased the total size unnecessary.

IIRC, this is required by one of the authentication systems available. I am
pretty sure that the problem disappears when the classes are removed.

> * Got a JspServlet ClassNotFound warning if I didn't include the
> jasper-compiler.jar and jasper-runtime.jar.

Jasper is needed for web-application support. If you only need servlets, then
this will also disappear if webapplicationcontext and associated classes are
removed.

> * How hard is it to replace xercesImpl.jar and xml-apis.jar with kXML2?

Hard. I would instead recommend something like Aelfred, which is built into
Saxon, but can be extracted and used. kXML is practically dead project, and
should not be used for general-purpose parsing, as the API is pull instead of
push (or is it the other way around?).

> * What's the runtime memory requirements?

I have implemented a jetty-like clone, without the Servlet support and instead
using HttpHandler system from Jetty, complete with Saxon (for XSLT
transforms) in ~300kB flash storage (never checked RAM). Saxon was about two
thirds of that, and Saxon was heavily modified as I needed to run the entire
thing on CLDC (which explains the Jetty clone as well).


Cheers
Niclas


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Jetty on J2ME-CDC

Greg Wilkins-5

If you are interested in small footprint and servlets (as well as HTTP) then
I recommend looking at the Jetty 6 alpha release I just made.

Jetty 6 uses the serlvet API natively, but you can strip out the bits you
don't want and the xml stuff etc.

I've built a jar 333kb that has HTTP/1.1 using bio, servlet API with
session support and a default servlet for static content.  Note this includes
the javax API in this size and the only other jar needed is a slf4j jar (5kb)

The other good feature is that Jetty 6 manages buffers so that Idle connections
do not have large buffers allocated to them.  This should also greatly reduce
the runtime footprint.

NB. this is an ALPHA release and you still need to manually down-size the
jars needed.

cheers



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Jetty on J2ME-CDC

Chia Chang
Jetty 6 sounds like exactly what I need.

Without changing the codes, I was able to strip Jetty 4 down to ~400K
(Http + Servlet) and ran on J2ME-CDC without any error. However, I have
to use my own version of xercesImpl.jar which adds another ~600K.
Originally I was planning to modify Jetty 4's codes to shrink more.
Changing the codes is not a problem but I don't want to mainaint and
update my own version of Jetty. Looks like I don't need to do it with
Jetty 6. This is great and I'll give it a try.

Thanks,
~chia

Greg Wilkins wrote:

>If you are interested in small footprint and servlets (as well as HTTP) then
>I recommend looking at the Jetty 6 alpha release I just made.
>
>Jetty 6 uses the serlvet API natively, but you can strip out the bits you
>don't want and the xml stuff etc.
>
>I've built a jar 333kb that has HTTP/1.1 using bio, servlet API with
>session support and a default servlet for static content.  Note this includes
>the javax API in this size and the only other jar needed is a slf4j jar (5kb)
>
>The other good feature is that Jetty 6 manages buffers so that Idle connections
>do not have large buffers allocated to them.  This should also greatly reduce
>the runtime footprint.
>
>NB. this is an ALPHA release and you still need to manually down-size the
>jars needed.
>
>cheers
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: NEC IT Guy Games.
>Get your fingers limbered up and give it your best shot. 4 great events, 4
>opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>_______________________________________________
>jetty-discuss mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>  
>


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Jetty on J2ME-CDC

Chia Chang
I downloaded Jetty 6 ALPHA. It ran fine on J2SE. However, when I ran it
on J2ME-CDC, since J2ME-CDC doesn't support java.nio package, I got the
"java.lang.NoClassDefFoundError: java.nio.ByteBuffer" exception. The
DefaultServlet calls java.nio indirectly.

DefaultServlet -> org.mortbay.io.nio.NIOBuffer -> java.nio.ByteBuffer
(and java.nio.channels.FileChannel)

I commented out the reference of nio in jetty.xml by it didn't help. Is
there anyway that I can use Jetty 6 without using of java.nio?

Thanks,
~chia

> java.lang.NoClassDefFoundError: java.nio.ByteBuffer
>         at
> org.mortbay.jetty.servlet.DefaultServlet.getContent(DefaultServlet.java:458)
>         at
> org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:361)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:420)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:307)
>         at
> org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:162)
>         at
> org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:291)
>         at org.mortbay.jetty.Server.handle(Server.java:205)
>         at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:397)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:467)
>         at
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:198)
>         at
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:219)
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:127)
>         at
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:415)
>         at java.lang.Thread.startup(Thread.java:733)



Chia Chang wrote:

> Jetty 6 sounds like exactly what I need.
>
> Without changing the codes, I was able to strip Jetty 4 down to ~400K
> (Http + Servlet) and ran on J2ME-CDC without any error. However, I
> have to use my own version of xercesImpl.jar which adds another ~600K.
> Originally I was planning to modify Jetty 4's codes to shrink more.
> Changing the codes is not a problem but I don't want to mainaint and
> update my own version of Jetty. Looks like I don't need to do it with
> Jetty 6. This is great and I'll give it a try.
>
> Thanks,
> ~chia
>
> Greg Wilkins wrote:
>
>> If you are interested in small footprint and servlets (as well as
>> HTTP) then
>> I recommend looking at the Jetty 6 alpha release I just made.
>>
>> Jetty 6 uses the serlvet API natively, but you can strip out the bits
>> you
>> don't want and the xml stuff etc.
>>
>> I've built a jar 333kb that has HTTP/1.1 using bio, servlet API with
>> session support and a default servlet for static content.  Note this
>> includes
>> the javax API in this size and the only other jar needed is a slf4j
>> jar (5kb)
>>
>> The other good feature is that Jetty 6 manages buffers so that Idle
>> connections
>> do not have large buffers allocated to them.  This should also
>> greatly reduce
>> the runtime footprint.
>>
>> NB. this is an ALPHA release and you still need to manually down-size
>> the
>> jars needed.
>>
>> cheers
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: NEC IT Guy Games.
>> Get your fingers limbered up and give it your best shot. 4 great
>> events, 4
>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>> _______________________________________________
>> jetty-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>  
>>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great
> events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
> _______________________________________________
> jetty-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-discuss



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Jetty on J2ME-CDC

Chia Chang
I have been running my servlet and client programs with Jetty 4.2.24
without any problem. However, when I used the same programs with Jetty 6
ALPHA (without changing anything), I got the following error:

HTTP Status-Code 405: HTTP method POST is not supported by this URL

Does anyone have the solution? Thanks in advance.

Regards,
~chia


Chia Chang wrote:

> I downloaded Jetty 6 ALPHA. It ran fine on J2SE. However, when I ran
> it on J2ME-CDC, since J2ME-CDC doesn't support java.nio package, I got
> the "java.lang.NoClassDefFoundError: java.nio.ByteBuffer" exception.
> The DefaultServlet calls java.nio indirectly.
>
> DefaultServlet -> org.mortbay.io.nio.NIOBuffer -> java.nio.ByteBuffer
> (and java.nio.channels.FileChannel)
>
> I commented out the reference of nio in jetty.xml by it didn't help.
> Is there anyway that I can use Jetty 6 without using of java.nio?
>
> Thanks,
> ~chia
>
>> java.lang.NoClassDefFoundError: java.nio.ByteBuffer
>>         at
>> org.mortbay.jetty.servlet.DefaultServlet.getContent(DefaultServlet.java:458)
>>
>>         at
>> org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:361)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>         at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:420)
>>         at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:307)
>>         at
>> org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>>         at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:162)
>>         at
>> org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>>         at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:291)
>>         at org.mortbay.jetty.Server.handle(Server.java:205)
>>         at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:397)
>>
>>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:467)
>>         at
>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:198)
>>         at
>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:219)
>>         at
>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:127)
>>
>>         at
>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:415)
>>
>>         at java.lang.Thread.startup(Thread.java:733)
>
>
>
>
> Chia Chang wrote:
>
>> Jetty 6 sounds like exactly what I need.
>>
>> Without changing the codes, I was able to strip Jetty 4 down to ~400K
>> (Http + Servlet) and ran on J2ME-CDC without any error. However, I
>> have to use my own version of xercesImpl.jar which adds another
>> ~600K. Originally I was planning to modify Jetty 4's codes to shrink
>> more. Changing the codes is not a problem but I don't want to
>> mainaint and update my own version of Jetty. Looks like I don't need
>> to do it with Jetty 6. This is great and I'll give it a try.
>>
>> Thanks,
>> ~chia
>>
>> Greg Wilkins wrote:
>>
>>> If you are interested in small footprint and servlets (as well as
>>> HTTP) then
>>> I recommend looking at the Jetty 6 alpha release I just made.
>>>
>>> Jetty 6 uses the serlvet API natively, but you can strip out the
>>> bits you
>>> don't want and the xml stuff etc.
>>>
>>> I've built a jar 333kb that has HTTP/1.1 using bio, servlet API with
>>> session support and a default servlet for static content.  Note this
>>> includes
>>> the javax API in this size and the only other jar needed is a slf4j
>>> jar (5kb)
>>>
>>> The other good feature is that Jetty 6 manages buffers so that Idle
>>> connections
>>> do not have large buffers allocated to them.  This should also
>>> greatly reduce
>>> the runtime footprint.
>>>
>>> NB. this is an ALPHA release and you still need to manually
>>> down-size the
>>> jars needed.
>>>
>>> cheers
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.Net email is sponsored by: NEC IT Guy Games.
>>> Get your fingers limbered up and give it your best shot. 4 great
>>> events, 4
>>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>> _______________________________________________
>>> jetty-discuss mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>>  
>>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: NEC IT Guy Games.
>> Get your fingers limbered up and give it your best shot. 4 great
>> events, 4
>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>> _______________________________________________
>> jetty-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great
> events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
> _______________________________________________
> jetty-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-discuss



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Jetty on J2ME-CDC

Greg Wilkins-5

Chia,

I'll try to change the build this weekend so that the nio classes are
kept separate from the bio classes.   I'll probably have to factor out
the Default servlet to remove NIO references from that class.

as for the 405 problem... I need more information.
What servlet is it hitting that is saying this?
Are you currently trying to use filters or Request dispatches, as these
are not yet supported.

cheers



Chia Chang wrote:

> I have been running my servlet and client programs with Jetty 4.2.24
> without any problem. However, when I used the same programs with Jetty 6
> ALPHA (without changing anything), I got the following error:
>
> HTTP Status-Code 405: HTTP method POST is not supported by this URL
>
> Does anyone have the solution? Thanks in advance.
>
> Regards,
> ~chia
>
>
> Chia Chang wrote:
>
>> I downloaded Jetty 6 ALPHA. It ran fine on J2SE. However, when I ran
>> it on J2ME-CDC, since J2ME-CDC doesn't support java.nio package, I got
>> the "java.lang.NoClassDefFoundError: java.nio.ByteBuffer" exception.
>> The DefaultServlet calls java.nio indirectly.
>>
>> DefaultServlet -> org.mortbay.io.nio.NIOBuffer -> java.nio.ByteBuffer
>> (and java.nio.channels.FileChannel)
>>
>> I commented out the reference of nio in jetty.xml by it didn't help.
>> Is there anyway that I can use Jetty 6 without using of java.nio?
>>
>> Thanks,
>> ~chia
>>
>>> java.lang.NoClassDefFoundError: java.nio.ByteBuffer
>>>         at
>>> org.mortbay.jetty.servlet.DefaultServlet.getContent(DefaultServlet.java:458)
>>>
>>>         at
>>> org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:361)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>>         at
>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:420)
>>>         at
>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:307)
>>>         at
>>> org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>>>         at
>>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:162)
>>>         at
>>> org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>>>         at
>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:291)
>>>         at org.mortbay.jetty.Server.handle(Server.java:205)
>>>         at
>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:397)
>>>
>>>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:467)
>>>         at
>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:198)
>>>         at
>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:219)
>>>         at
>>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:127)
>>>
>>>         at
>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:415)
>>>
>>>         at java.lang.Thread.startup(Thread.java:733)
>>
>>
>>
>>
>>
>> Chia Chang wrote:
>>
>>> Jetty 6 sounds like exactly what I need.
>>>
>>> Without changing the codes, I was able to strip Jetty 4 down to ~400K
>>> (Http + Servlet) and ran on J2ME-CDC without any error. However, I
>>> have to use my own version of xercesImpl.jar which adds another
>>> ~600K. Originally I was planning to modify Jetty 4's codes to shrink
>>> more. Changing the codes is not a problem but I don't want to
>>> mainaint and update my own version of Jetty. Looks like I don't need
>>> to do it with Jetty 6. This is great and I'll give it a try.
>>>
>>> Thanks,
>>> ~chia
>>>
>>> Greg Wilkins wrote:
>>>
>>>> If you are interested in small footprint and servlets (as well as
>>>> HTTP) then
>>>> I recommend looking at the Jetty 6 alpha release I just made.
>>>>
>>>> Jetty 6 uses the serlvet API natively, but you can strip out the
>>>> bits you
>>>> don't want and the xml stuff etc.
>>>>
>>>> I've built a jar 333kb that has HTTP/1.1 using bio, servlet API with
>>>> session support and a default servlet for static content.  Note this
>>>> includes
>>>> the javax API in this size and the only other jar needed is a slf4j
>>>> jar (5kb)
>>>>
>>>> The other good feature is that Jetty 6 manages buffers so that Idle
>>>> connections
>>>> do not have large buffers allocated to them.  This should also
>>>> greatly reduce
>>>> the runtime footprint.
>>>>
>>>> NB. this is an ALPHA release and you still need to manually
>>>> down-size the
>>>> jars needed.
>>>>
>>>> cheers
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> This SF.Net email is sponsored by: NEC IT Guy Games.
>>>> Get your fingers limbered up and give it your best shot. 4 great
>>>> events, 4
>>>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>>> _______________________________________________
>>>> jetty-discuss mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>>>  
>>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.Net email is sponsored by: NEC IT Guy Games.
>>> Get your fingers limbered up and give it your best shot. 4 great
>>> events, 4
>>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>> _______________________________________________
>>> jetty-discuss mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: NEC IT Guy Games.
>> Get your fingers limbered up and give it your best shot. 4 great
>> events, 4
>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>> _______________________________________________
>> jetty-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Jetty on J2ME-CDC

Chia Chang
Hi Greg,

Thanks. That explained. I used the request dispatches.

Due to our project time and resource constraints, I'll stick with Jetty4
for now and will give Jetty6 another try later on.

Regards,
~chia

Greg Wilkins wrote:

>Chia,
>
>I'll try to change the build this weekend so that the nio classes are
>kept separate from the bio classes.   I'll probably have to factor out
>the Default servlet to remove NIO references from that class.
>
>as for the 405 problem... I need more information.
>What servlet is it hitting that is saying this?
>Are you currently trying to use filters or Request dispatches, as these
>are not yet supported.
>
>cheers
>
>
>
>Chia Chang wrote:
>  
>
>>I have been running my servlet and client programs with Jetty 4.2.24
>>without any problem. However, when I used the same programs with Jetty 6
>>ALPHA (without changing anything), I got the following error:
>>
>>HTTP Status-Code 405: HTTP method POST is not supported by this URL
>>
>>Does anyone have the solution? Thanks in advance.
>>
>>Regards,
>>~chia
>>
>>
>>Chia Chang wrote:
>>
>>    
>>
>>>I downloaded Jetty 6 ALPHA. It ran fine on J2SE. However, when I ran
>>>it on J2ME-CDC, since J2ME-CDC doesn't support java.nio package, I got
>>>the "java.lang.NoClassDefFoundError: java.nio.ByteBuffer" exception.
>>>The DefaultServlet calls java.nio indirectly.
>>>
>>>DefaultServlet -> org.mortbay.io.nio.NIOBuffer -> java.nio.ByteBuffer
>>>(and java.nio.channels.FileChannel)
>>>
>>>I commented out the reference of nio in jetty.xml by it didn't help.
>>>Is there anyway that I can use Jetty 6 without using of java.nio?
>>>
>>>Thanks,
>>>~chia
>>>
>>>      
>>>
>>>>java.lang.NoClassDefFoundError: java.nio.ByteBuffer
>>>>        at
>>>>org.mortbay.jetty.servlet.DefaultServlet.getContent(DefaultServlet.java:458)
>>>>
>>>>        at
>>>>org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:361)
>>>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
>>>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>>>        at
>>>>org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:420)
>>>>        at
>>>>org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:307)
>>>>        at
>>>>org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>>>>        at
>>>>org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:162)
>>>>        at
>>>>org.mortbay.jetty.handler.WrappedHandler.handle(WrappedHandler.java:97)
>>>>        at
>>>>org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:291)
>>>>        at org.mortbay.jetty.Server.handle(Server.java:205)
>>>>        at
>>>>org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:397)
>>>>
>>>>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:467)
>>>>        at
>>>>org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:198)
>>>>        at
>>>>org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:219)
>>>>        at
>>>>org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:127)
>>>>
>>>>        at
>>>>org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:415)
>>>>
>>>>        at java.lang.Thread.startup(Thread.java:733)
>>>>        
>>>>
>>>
>>>
>>>
>>>Chia Chang wrote:
>>>
>>>      
>>>
>>>>Jetty 6 sounds like exactly what I need.
>>>>
>>>>Without changing the codes, I was able to strip Jetty 4 down to ~400K
>>>>(Http + Servlet) and ran on J2ME-CDC without any error. However, I
>>>>have to use my own version of xercesImpl.jar which adds another
>>>>~600K. Originally I was planning to modify Jetty 4's codes to shrink
>>>>more. Changing the codes is not a problem but I don't want to
>>>>mainaint and update my own version of Jetty. Looks like I don't need
>>>>to do it with Jetty 6. This is great and I'll give it a try.
>>>>
>>>>Thanks,
>>>>~chia
>>>>
>>>>Greg Wilkins wrote:
>>>>
>>>>        
>>>>
>>>>>If you are interested in small footprint and servlets (as well as
>>>>>HTTP) then
>>>>>I recommend looking at the Jetty 6 alpha release I just made.
>>>>>
>>>>>Jetty 6 uses the serlvet API natively, but you can strip out the
>>>>>bits you
>>>>>don't want and the xml stuff etc.
>>>>>
>>>>>I've built a jar 333kb that has HTTP/1.1 using bio, servlet API with
>>>>>session support and a default servlet for static content.  Note this
>>>>>includes
>>>>>the javax API in this size and the only other jar needed is a slf4j
>>>>>jar (5kb)
>>>>>
>>>>>The other good feature is that Jetty 6 manages buffers so that Idle
>>>>>connections
>>>>>do not have large buffers allocated to them.  This should also
>>>>>greatly reduce
>>>>>the runtime footprint.
>>>>>
>>>>>NB. this is an ALPHA release and you still need to manually
>>>>>down-size the
>>>>>jars needed.
>>>>>
>>>>>cheers
>>>>>
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by: NEC IT Guy Games.
>>>>>Get your fingers limbered up and give it your best shot. 4 great
>>>>>events, 4
>>>>>opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>>>>win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>>>>_______________________________________________
>>>>>jetty-discuss mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by: NEC IT Guy Games.
>>>>Get your fingers limbered up and give it your best shot. 4 great
>>>>events, 4
>>>>opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>>>win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>>>_______________________________________________
>>>>jetty-discuss mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>>>        
>>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by: NEC IT Guy Games.
>>>Get your fingers limbered up and give it your best shot. 4 great
>>>events, 4
>>>opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>>win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>>_______________________________________________
>>>jetty-discuss mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>>>      
>>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by: NEC IT Guy Games.
>>Get your fingers limbered up and give it your best shot. 4 great events, 4
>>opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
>>win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
>>    
>>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Oracle Space Sweepstakes
>Want to be the first software developer in space?
>Enter now for the Oracle Space Sweepstakes!
>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
>_______________________________________________
>jetty-discuss mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>  
>


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss