Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.1.24, 7.0.2
-
Fix Version/s: 7.1.0
-
Labels:None
-
Environment:OS X (10.6.3), java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025) Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode), Maven3 Beta-1, Eclipse Galileo
-
Testcase included:yes
-
Number of attachments :2
Description
Pretty much what I said in the summary: "Sleeping a client thread when accessing a Jetty-hosted JAX-WS web service causes an IllegalStateException for the SessionManager"
I've included a very small web service that can reproduce the problem. Simply run "mvn verify" to run the integration tests.
This is a priority for me, so I appreciate any amount of time you can spend on it ASAP. Thanks!
FYI - I use the latest copy of jax-ws so you'll need to download the latest copies jax-ws and jaxb and "endorse" them (http://java.sun.com/j2se/1.4.2/docs/guide/standards/) by copying them to $JAVA_HOME/lib/endorsed.
Thanks again!
-
- org.eclipse.jetty.illegalstate.tar.gz
- 29/Apr/10 10:52 AM
- 39 kB
- Schley Andrew Kutz
-
- org.eclipse.jetty.illegalstate.tar.gz
- 29/Apr/10 9:29 AM
- 38 kB
- Schley Andrew Kutz
Activity
It appears the verify phase doesn't (always) invoke the generate-test-sources phase. So to be strict, run "mvn clean generate-test-sources verify" to reproduce the issue.
Here is the log from the "mvn clean generate-test-sources verify" command:
[1]akutz@legacy:illegalstate$ mvn clean generate-test-sources verify
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.eclipse.jetty.illegalstate 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Invalid POM for javax.xml.soap:saaj-api:jar:1.3.1, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] — maven-clean-plugin:2.4:clean (default-clean) @ illegalstate —
[INFO] Deleting /Users/akutz/Projects/workspaces/primary/illegalstate/target
[INFO]
[INFO] — maven-resources-plugin:2.4.2:resources (default-resources) @ illegalstate —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] — maven-compiler-plugin:2.1:compile (default-compile) @ illegalstate —
[INFO] Compiling 1 source file to /Users/akutz/Projects/workspaces/primary/illegalstate/target/classes
[INFO]
[INFO] — jaxws-maven-plugin:1.12:wsgen (jaxws-wsgen) @ illegalstate —
[WARNING] Invalid POM for javax.xml.soap:saaj-api:jar:1.3.1, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] — jaxws-maven-plugin:1.12:wsimport (jaxws-wsimport) @ illegalstate —
[INFO] Processing: /Users/akutz/Projects/workspaces/primary/illegalstate/target/generated-resources/main/IllegalStateService.wsdl
[INFO] jaxws:wsimport args: [-s, /Users/akutz/Projects/workspaces/primary/illegalstate/target/generated-sources/test, -d, /Users/akutz/Projects/workspaces/primary/illegalstate/target/test-classes, -p, org.eclipse.jetty.illegalstate.client, -Xnocompile, /Users/akutz/Projects/workspaces/primary/illegalstate/target/generated-resources/main/IllegalStateService.wsdl]
parsing WSDL...
generating code...
[INFO]
[INFO] — maven-resources-plugin:2.4.2:resources (default-resources) @ illegalstate —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] — maven-compiler-plugin:2.1:compile (default-compile) @ illegalstate —
[INFO] Compiling 6 source files to /Users/akutz/Projects/workspaces/primary/illegalstate/target/classes
[INFO]
[INFO] — jaxws-maven-plugin:1.12:wsgen (jaxws-wsgen) @ illegalstate —
[INFO]
[INFO] — jaxws-maven-plugin:1.12:wsimport (jaxws-wsimport) @ illegalstate —
[INFO]
[INFO] — maven-resources-plugin:2.4.2:testResources (default-testResources) @ illegalstate —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] — maven-compiler-plugin:2.1:testCompile (default-testCompile) @ illegalstate —
[INFO] Compiling 1 source file to /Users/akutz/Projects/workspaces/primary/illegalstate/target/test-classes
[INFO]
[INFO] — maven-surefire-plugin:2.5:test (default-test) @ illegalstate —
[INFO] Tests are skipped.
[INFO]
[INFO] — maven-war-plugin:2.1-beta-1:war (default-war) @ illegalstate —
[INFO] Packaging webapp
[INFO] Assembling webapp[illegalstate] in [/Users/akutz/Projects/workspaces/primary/illegalstate/target/illegalstate-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources[/Users/akutz/Projects/workspaces/primary/illegalstate/src/main/webapp]
[INFO] Webapp assembled in [122 msecs]
[INFO] Building war: /Users/akutz/Projects/workspaces/primary/illegalstate/target/illegalstate-0.0.1-SNAPSHOT.war
[INFO]
[INFO] >>> jetty-maven-plugin:7.0.2.v20100331:deploy-war (start-jetty) @ illegalstate >>>
[INFO]
[INFO] <<< jetty-maven-plugin:7.0.2.v20100331:deploy-war (start-jetty) @ illegalstate <<<
[INFO]
[INFO] — jetty-maven-plugin:7.0.2.v20100331:deploy-war (start-jetty) @ illegalstate —
[INFO] Configuring Jetty for project: org.eclipse.jetty.illegalstate
2010-04-29 09:38:56.346:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
[INFO] Context path = /
[INFO] Tmp directory = /Users/akutz/Projects/workspaces/primary/illegalstate/target/tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] Starting jetty 7.0.2.v20100331 ...
2010-04-29 09:38:56.402:INFO::jetty-7.0.2.v20100331
2010-04-29 09:38:56.920:INFO::No Transaction manager found - if your webapp requires one, please configure one.
Apr 29, 2010 9:38:56 AM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
INFO: WSSERVLET12: JAX-WS context listener initializing
Apr 29, 2010 9:38:57 AM com.sun.xml.ws.server.MonitorBase createRoot
INFO: Metro monitoring rootname successfully set to: null
Apr 29, 2010 9:38:57 AM com.sun.xml.ws.transport.http.servlet.WSServletDelegate <init>
INFO: WSSERVLET14: JAX-WS servlet initializing
2010-04-29 09:38:57.547:INFO::Started SelectChannelConnector@0.0.0.0:9996
[INFO] Started Jetty Server
[INFO] Console reloading is ENABLED. Hit ENTER on the console to restart the context.
[INFO]
[INFO] — maven-surefire-plugin:2.5:test (surefire-it) @ illegalstate —
[INFO] Surefire report directory: /Users/akutz/Projects/workspaces/primary/illegalstate/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
0 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - created IllegalStateService
204 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - created IllegalStateServicePort
204 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - set WebServicePort to maintain session state (cookies)
204 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - noop - start
0 [qtp64657786-20] INFO org.eclipse.jetty.illegalstate.IllegalStateServiceImpl - noop - enter
2 [qtp64657786-20] INFO org.eclipse.jetty.illegalstate.IllegalStateServiceImpl - noop - exit
331 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - noop - stop
332 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - sleeping client for 25 seconds - start
25330 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - sleeping client for 25 seconds - stop
25330 [main] INFO org.eclipse.jetty.illegalstate.IllegalStateTest - noop - start
Apr 29, 2010 9:39:24 AM com.sun.xml.ws.server.sei.EndpointMethodHandler invoke
SEVERE: No SessionManager
java.lang.IllegalStateException: No SessionManager
at org.eclipse.jetty.server.Request.getSession(Request.java:1096)
at org.eclipse.jetty.server.Request.getSession(Request.java:1086)
at org.eclipse.jetty.illegalstate.IllegalStateServiceImpl.getHttpSession(IllegalStateServiceImpl.java:77)
at org.eclipse.jetty.illegalstate.IllegalStateServiceImpl.getSessionLock(IllegalStateServiceImpl.java:45)
at org.eclipse.jetty.illegalstate.IllegalStateServiceImpl.noop(IllegalStateServiceImpl.java:83)
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 com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:295)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:515)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:155)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:189)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:426)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:931)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:361)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:337)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1020)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:775)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:228)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:417)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:474)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:437)
at java.lang.Thread.run(Thread.java:637)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 26.525 sec <<< FAILURE!
Results :
Failed tests:
doTest(org.eclipse.jetty.illegalstate.IllegalStateTest)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.477s
[INFO] Finished at: Thu Apr 29 09:39:24 CDT 2010
[INFO] Final Memory: 17M/80M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test (surefire-it) on project illegalstate: There are test failures.
Please refer to /Users/akutz/Projects/workspaces/primary/illegalstate/target/surefire-reports for the individual test results.
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The bug is present in 8.0.0.M0 as well. I started to examine older versions, but there too many ClassDefNotFound errors for that to be productive. The best I can hope for att his point is a patch on the 7.x branch or on the trunk.
It is not a Jetty bug. I was being stupid and stored the HttpServletRequest obtained from the WebService context in a class field. This eventually became invalid. I've updated the getHttpRequest() method such that it resembles:
/**
- Gets the current HTTP request.
- @return The current HTTP request.
*/
private HttpServletRequest getHttpRequest()Unknown macro: { logger.info("getting http request - enter"); HttpServletRequest request = (HttpServletRequest) this.wsContext.getMessageContext().get( MessageContext.SERVLET_REQUEST); if (request == null) { logger.info("http request is null"); } else { logger.info("http request is not null"); } logger.info("getting http request - exit"); return request; }
Now everything works.
This is the test project that can be used to reproduce the issue.