Hi

A check with my linux os admin showed that we run periodically cleaning of the 
temp directory. I will now modify the extracted directory and let it run for a 
period to see if NoClassDefFoundError will occur again. And Joakim Erdfelt have 
described «How to change the extracted directory?» :

You have few choices.

1) Specify your own java.io.tmpdir java system property location for jetty to 
use.
    $ java -Djava.io.tmpdir=/path/to/my/new/temp/ -jar start.jar

2) Create a "work" directory under the ${jetty.home} path (whereever that is).
    That will cause Jetty to use that work directory instead of whatever the 
java.io.tmpdir property is set to.

3) Specify the tempDir attribute on the WebAppProvider deployments.
    Only valid for war file deployment scenarios, NOT valid for context based 
deployment.
    If you have etc/jetty-webapps.xml in your start.ini you have war file 
deployments enabled.
    Edit the ${jetty.home}/etc/jetty-webapps.xml file and add 1 more attribute 
on the WebAppProvider.
    <Set name="tempDir">/path/to/my/preferred/temp/dir/for/all/webapps</Set>

4) Set the tempDirectory attribute on the WebAppContext with context based 
deployments.
    NOT valid for war file deployment scenarios.
    If you have etc/jetty-context.xml in your start.ini you have context based 
deployments enabled.
    Edit the ${jetty.home}/contexts/myapp.xml and add the tempDirectory 
attribute on the WebAppContext.
    <Set 
name="tempDirectory">/path/to/my/preferred/temp/dir/for/this/context</Set>

Note: the servlet context attribute "javax.servlet.context.tempdir" can be used 
by your webapp to find out temp directory path is being used for the webapp.
Unfortunately, you cannot use this servlet context in your web.xml to set the 
tempdir as by the time this value is read from the web.xml it is too late in 
the deployment process to affect this settings (in other words ... the webapp 
has already been unpacked into the temp directory before this context attribute 
is even read)

Thanks !
Per Jørgen.


From: [email protected] [mailto:[email protected]] 
On Behalf Of Per Jørgen Vigdal
Sent: 4. november 2014 12:46
To: JETTY user mailing list
Subject: Re: [jetty-users] NoClassDefFoundError

Hi

You might be on to something  !
The class files resides in a war file under 
/usr/local/oas/jetty-distribution-8.1.12.v20130726/webapps
and I find that the war file is unzipped to 
/tmp/jetty-0.0.0.0-8888-Rekvirent.war-_Rekvirent-any-/webapp/WEB-INF/classes
whenever the server starts. I will check with my linux os admin.
But it is perhaps a good idea anyway to let jetty extract the class files to 
another location. Do you know if it is possible?

Per Jørgen.

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Stefan Magnus Landrø
Sent: 4. november 2014 12:04
To: JETTY user mailing list
Subject: Re: [jetty-users] NoClassDefFoundError

Could it be that the classes are stored in your tmp folder and occasionally get 
wiped by your os (or your admin)?

Are the actual class files actually found on disk?

Stefan

2014-11-04 11:56 GMT+01:00 Per Jørgen Vigdal 
<[email protected]<mailto:[email protected]>>:
Hi

Here is an example of the stack trace :

java.lang.NoClassDefFoundError: 
no/ergo/reseptformidleren/webservices/rekvirent/m271/x20130416/vo/M27_1Vo
                at 
no.ergo.reseptformidleren.webservices.rekvirent.m271.x20130416.M271Impl.<init>(M271Impl.java:56)
 ~[classes/:na]
                at 
no.ergo.reseptformidleren.webservices.rekvirent.RekvirentWebService.getM271Common(RekvirentWebService.java:1049)
 ~[classes/:na]
                at 
no.ergo.reseptformidleren.webservices.rekvirent.RekvirentWebService.m27_1(RekvirentWebService.java:1011)
 ~[classes/:na]
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.6.0_18]
                at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
~[na:1.6.0_18]
                at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ~[na:1.6.0_18]
                at java.lang.reflect.Method.invoke(Method.java:597) 
~[na:1.6.0_18]
                at 
com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:250) 
[webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149) 
[webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88) 
[webservices-rt.jar:2.2.1]
                at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1063) 
[webservices-rt.jar:2.2.1]
                at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:979) 
[webservices-rt.jar:2.2.1]
                at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:950) 
[webservices-rt.jar:2.2.1]
                at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:825) 
[webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:380) 
[webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:651)
 [webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:264) 
[webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:218)
 [webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:159)
 [webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:194)
 [webservices-rt.jar:2.2.1]
                at 
com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:80) 
[webservices-rt.jar:2.2.1]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) 
[servlet-api-3.0.jar:na]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) 
[servlet-api-3.0.jar:na]
                at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686) 
[jetty-servlet-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
 [jetty-servlet-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
no.ergo.reseptformidleren.webservices.felles.util.SOAPServletFilter.doFilter(SOAPServletFilter.java:145)
 [classes/:na]
                at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
 [jetty-servlet-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499) 
[jetty-servlet-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) 
[jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) 
[jetty-security-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) 
[jetty-servlet-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) 
[jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) 
[jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at org.eclipse.jetty.server.Server.handle(Server.java:370) 
[jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:651) 
[jetty-http-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 
[jetty-http-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
 [jetty-server-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
 [jetty-io-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
 [jetty-io-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
 [jetty-util-8.1.12.v20130726.jar:8.1.12.v20130726]
                at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) 
[jetty-util-8.1.12.v20130726.jar:8.1.12.v20130726]
                at java.lang.Thread.run(Thread.java:619) [na:1.6.0_18]

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Christoph Läubrich
Sent: 4. november 2014 11:19
To: [email protected]<mailto:[email protected]>
Subject: Re: [jetty-users] NoClassDefFoundError

You should provide the full stack trace including the cause. 
NoClassDefFoundError can have several reasons (e.g. serialization issues).

Am 04.11.2014 10:54, schrieb Per Jørgen Vigdal:
Hi.

I am occasionally getting a NoClassDefFoundError on classes defined in my 
web-service.
I am running a jax-ws 2.2 on jetty-distribution-8.1.12.v20130726 with 
jdk1.6.0_18.
The NoClassDefFoundError occurs when the class has not been in “use” for some 
time, typically more than 7 days.
To me it looks like the class “drops” out of the classloader?
To fix this I have to restart the server.   Can someone help ?

Per Jørgen







_______________________________________________

jetty-users mailing list

[email protected]<mailto:[email protected]>

To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit

https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
[email protected]<mailto:[email protected]>
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
BEKK Open
http://open.bekk.no

TesTcl - a unit test framework for iRules
http://testcl.com
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to