Tapestry 500 error: EnvironmentImpl.stackFor(EnvironmentImpl.java:47) may no longer be invoked

Tapestry 500 error: EnvironmentImpl.stackFor(EnvironmentImpl.java:47) may no longer be invoked

昨晚我有一个非常好的 Tapestry 5.4 应用程序,在提交一些工作并切换到另一个分支后,我开始收到一个我以前从未见过的 random/transient 错误:一个 500 错误,仅访问某些页面时有时会出现。

当我使用浏览器命令重新加载页面时,它永远不会发生,但奇怪的是,如果我单击该页面的导航项或单击其他页面的导航链接,它发生, 随后重新加载将清除它。

一个线索是,在我将大量工作提交给一个分支,然后签出另一个分支,并合并我的新分支之前,这并没有发生。

HTTP ERROR 500

Problem accessing /inventory. Reason:

    Method org.apache.tapestry5.internal.services.EnvironmentImpl.stackFor(EnvironmentImpl.java:47) may no longer be invoked.
Caused by:

java.lang.IllegalStateException: Method org.apache.tapestry5.internal.services.EnvironmentImpl.stackFor(EnvironmentImpl.java:47) may no longer be invoked.
    at org.apache.tapestry5.ioc.internal.util.OneShotLock.innerCheck(OneShotLock.java:58)
    at org.apache.tapestry5.ioc.internal.util.OneShotLock.check(OneShotLock.java:37)
    at org.apache.tapestry5.internal.services.EnvironmentImpl.stackFor(EnvironmentImpl.java:47)
    at org.apache.tapestry5.internal.services.EnvironmentImpl.push(EnvironmentImpl.java:111)
    at $Environment_19d467107466.push(Unknown Source)
    at $Environment_19d467107398.push(Unknown Source)
    at org.apache.tapestry5.modules.TapestryModule.renderMarkup(TapestryModule.java:1746)
    at $MarkupRenderer_19d467107465.renderMarkup(Unknown Source)
    at org.apache.tapestry5.internal.services.javascript.AddBrowserCompatibilityStyles.renderMarkup(AddBrowserCompatibilityStyles.java:45)
    at $MarkupRenderer_19d467107465.renderMarkup(Unknown Source)
    at org.apache.tapestry5.internal.services.javascript.ConfigureHTMLElementFilter.renderMarkup(ConfigureHTMLElementFilter.java:45)
    at $MarkupRenderer_19d467107465.renderMarkup(Unknown Source)
    at $MarkupRenderer_19d467107461.renderMarkup(Unknown Source)
    at org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:47)
    at $PageMarkupRenderer_19d46710745f.renderPageMarkup(Unknown Source)
    at org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:64)
    at $PageResponseRenderer_19d4671073fa.renderPageResponse(Unknown Source)
    at org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.renderException(DefaultRequestExceptionHandler.java:262)
    at org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:145)
    at $RequestExceptionHandler_19d4671073bc.handleRequestException(Unknown Source)
    at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
    at $RequestHandler_19d4671073be.service(Unknown Source)
    at org.apache.tapestry5.modules.TapestryModule.service(TapestryModule.java:846)
    at $RequestHandler_19d4671073be.service(Unknown Source)
    at org.apache.tapestry5.modules.TapestryModule.service(TapestryModule.java:836)
    at $RequestHandler_19d4671073be.service(Unknown Source)
    at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:89)
    at $RequestHandler_19d4671073be.service(Unknown Source)
    at edu.colostate.cs.cs414.project.jzw.webui.services.AppModule.service(AppModule.java:118)
    at $RequestFilter_19d4671073b8.service(Unknown Source)
    at $RequestHandler_19d4671073be.service(Unknown Source)
    at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.invoke(CheckForUpdatesFilter.java:105)
    at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.invoke(CheckForUpdatesFilter.java:95)
    at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83)
    at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)
    at $RequestHandler_19d4671073be.service(Unknown Source)
    at $RequestHandler_19d4671073b2.service(Unknown Source)
    at org.apache.tapestry5.modules.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:256)
    at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:59)
    at $HttpServletRequestHandler_19d4671073b4.service(Unknown Source)
    at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
    at $HttpServletRequestFilter_19d4671073af.service(Unknown Source)
    at $HttpServletRequestHandler_19d4671073b4.service(Unknown Source)
    at org.apache.tapestry5.modules.TapestryModule.service(TapestryModule.java:796)
    at $HttpServletRequestHandler_19d4671073b4.service(Unknown Source)
    at $HttpServletRequestHandler_19d4671073ae.service(Unknown Source)
    at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:166)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

我的日志中有一个我以前从未见过的 Hibernate 错误,但我之前可能错过了它:

[INFO] InternalModule.PageLoader Loaded page 'core/PropertyEditBlocks' (en) in 78.808 ms
[INFO] AppModule.TimingFilter Request time: 2435 ms
[ERROR] Error for /customers
java.lang.NoSuchMethodError: org.hibernate.Session.close()Ljava/sql/Connection;
    at org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:71)
    at org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.run(PerthreadManagerImpl.java:107)
    at org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl.cleanup(PerthreadManagerImpl.java:135)
    at org.apache.tapestry5.ioc.internal.RegistryImpl.cleanupThread(RegistryImpl.java:522)
    at org.apache.tapestry5.ioc.internal.RegistryWrapper.cleanupThread(RegistryWrapper.java:39)
    at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:175)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

答案是从我的依赖项中删除 hibernate-java8。

- <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-java8</artifactId> - <version>5.1.0.Final</version> - </dependency>