strange problem with jetty

Per Bothner per@bothner.com
Fri Dec 2 23:05:00 GMT 2011


On 12/02/2011 11:58 AM, Răzvan Rotaru wrote:
> Thank you. I added jetty-util and servlet-api and it worked.
>
> It is strange though, that a missing jetty-util library makes kawa
> behave like jetty is missing as well (when in fact it doesn't). If I
> have only jetty and jetty util in classpath, but no servlet-api, I get
> a NoClassDefFoundError, which is great because I know what's wrong.

I agree if Kawa should provide a more helpful error message.  So
I added a special catch for NoClassDefFoundError so I can emit a warning.
Now (i.e. in the checked-in SVN sources) you get:

#|kawa:1|# (org.mortbay.jetty.Server 8080)
/dev/stdin:1:1: warning - error loading class org.mortbay.jetty.Server - 
org/mortbay/util/Attributes not found
/dev/stdin:1:1: warning - no declaration seen for org.mortbay.jetty.Server
/dev/stdin:1:1: unbound location org.mortbay.jetty.Server
	at gnu.mapping.Location.get(Location.java:67)
	at atInteractiveLevel$1.run(stdin:1)
	at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:279)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java:180)
	at kawa.Shell.run(Shell.java:280)
	at kawa.Shell.run(Shell.java:194)
	at kawa.Shell.run(Shell.java:175)
	at kawa.repl.main(repl.java:884)

Perhaps not ideal, but hopefully the extra warning will be helpful.
I can tweak the error message if that would make it better.
I figured this was better than the raw NoClassDefFoundError#toString.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list