This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strange problem with jetty


That looks good to me.

Two thoughts:

1. The second warning stanza "no declaration seen for org.mortbay.jetty.Server" could be prefixed with "Consequently" or "Therefore" or "Due to the above warning".

So the first two lines would read:
/dev/stdin:1:1: warning - error loading class org.mortbay.jetty.Server - org/mortbay/util/Attributes not found
/dev/stdin:1:1: warning - Therefore no declaration seen for org.mortbay.jetty.Server


2. What about adding a note in the documentation.

Along the lines of "if you want a class you just call it, but that if its chain of dependencies are not present due to inadequate classpath (something known only at runtime?) then pay close attention to the error message."

Coders coming to Kawa from Java may appreciate this extra hand-holding.

John.


----- Original Message -----
From: Per Bothner <per@bothner.com>
To: RÄzvan Rotaru <razvan.rotaru@gmail.com>
Cc: "kawa@sourceware.org" <kawa@sourceware.org>
Sent: Friday, 2 December 2011, 22:38
Subject: Re: strange problem with jetty

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]