| Summary: | NoSuchFieldException thrown during stopping an embedded jetty instance | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | David Carver <d_a_carver> |
| Component: | server | Assignee: | Jan Bartel <janb> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | janb, jetty-inbox |
| Version: | 7.6.0.RC3 | ||
| Target Milestone: | 7.5.x | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Hi Dave, What's the jvm version? And I guess this is being run as a unit test inside Eclipse? ta Jan Nevermind, I was getting this cleaner mixed up with the IntrospectorCleaner. The problem is that you have some other javax.el api jar on the classpath in eclipse that contains a BeanELResolver that does not have a field called "properties". Maybe I should change the error message, because if you don't have a field called "properties", it won't have cached the beans and therefore it doesn't need cleaning :) cheers Jan Warning changed to info for 7.6.0-RC4/8.1.0-RC4 |
When calling the server.stop() from an embedded jetty server being used during unit tests, the following stacktrace is logged as a warning: 2012-01-10 14:49:29.856:WARN:oejsl.ELContextCleaner:Cannot purge classes from javax.el.BeanELResolver java.lang.NoSuchFieldException: properties at java.lang.Class.getDeclaredField(Class.java:1882) at org.eclipse.jetty.servlet.listener.ELContextCleaner.getField(ELContextCleaner.java:91) at org.eclipse.jetty.servlet.listener.ELContextCleaner.contextDestroyed(ELContextCleaner.java:53) at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:769) at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:144) at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:479) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:84) at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:102) at org.eclipse.jetty.server.Server.doStop(Server.java:322) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:84) at com.intalio.core.email.test.BaseTestCase.stopWebapp(BaseTestCase.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Nothing fancy being done with the setup, it's pretty basic. private static final String contextPath = "/test-rest"; private static final String warLocation = "src/test/webapp"; private static final int RANDOM_PORT = 0; @BeforeClass public static void startWebapp() throws Exception { server = new Server(RANDOM_PORT); WebAppContext webAppContext = new WebAppContext(); webAppContext.setContextPath(contextPath); webAppContext.setWar(warLocation); server.setHandler(webAppContext); server.start(); } @AfterClass public static void stopWebapp() throws Exception { server.stop(); }