[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [jetty-users] Issue loading classes from JARs used by Jetty.
- From: RÃbert KohÃnyi <kohanyi.robert@xxxxxxxxx>
- Date: Mon, 17 Oct 2011 08:47:07 +0200
- Delivered-to: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Twn/BmYZBPO6PTgynxGkljnV2m64j4UW3LMrJyJ9sMA=; b=vMRzof2V9VHhceXIdbJ6l3g7TX28TLysAXKBgYHaW7Fs7GTxzSse63wU+7LKE6l7Zi DrSegB64oqcvrEFjnhundanlSOSxVZWdIGODQKyUEfjGleFI4ePthQYmGOdw2tRwi3Sr /rkExNtQjzJBPbT5ss7uMtGganXoR3JDZ6PIM=
Thank you Jan! You've helped me big time!
Basically I only had to add the following to the list of server classes: "-org.eclipse.jetty.deploy.". (Mind the '-' prefix, and the '.' suffix.).
If one would like to add only a single class (with it's fully qualified name), care must be taken to insert the "pattern" for it, before any enclosing package pattern. So for example, adding "-org.eclipse.server.handler.ContextHander" to the end of the server classes array would beÂoverriddenÂby the last entry in the array ("org.eclipse.jetty.").
I've queried the default server classes with WebAppContext.getServerClasses() and tweak the array returned by it, then calledÂWebAppContext.setServerClasses(String) method with the tweaked array. I don't know what are the implications of removing (overriding) the default entries, or using WebAppContext.addServerClass(String). The latter would probably just append the pattern at hand to the end of the default server classes array, which isn't always appropriate. Maybe someone can clarify this.
Anyway, thanks again Jan and I hope somebody can benefit from my little "description".
On Mon, Oct 17, 2011 at 7:30 AM, Jan Bartel <janb@xxxxxxxxxxx>
Have a read of this wiki page, as I think it will answer you questions:
I'm trying to create a servlet which tries to use classes included in Jetty's lib/ directory. Namely the class org.eclipse.jetty.deploy.DeploymentManager which is included in lib/jetty-deploy-8.0.3.v20111011.jar.
Instantiating the DeploymentManager in the constructor generates no errors, but doing the same in the doPut method always throws:Âjava.lang.NoClassDefFoundError: org/eclipse/jetty/deploy/DeploymentManager.
I'v tried saving Thread.currentThread().getContextClassLoader() (in the constructor) in a static variable and load the DeploymentManager's class in doPut, however it still threw an exception (same as above).
I haven't got the faintest idea what could the problem be and that how can I solve this.
If anyone has an idea please let me know about it! Thanks!
jetty-users mailing list
jetty-users mailing list