Closed kad closed 9 years ago
I'll take a look at it. Sounds like a problem with the way Wicket handles sessions. Which version do you use?
Thanks! Gerrit 2.9.1 with Gitblit plugin 2.9.1.161.1
It is a Wicket problem. This Wicket version used by GitBlit does not really like being unloaded and reloaded during an http session. Somehow I'll have to teach it that.
Note that you don't have to restart the Gerrit server, though. It's enough to kill the existing http session in the client.
I've pushed a new jar v2.9.1.161.2 that should have this bug fixed. In my tests, I observed no exceptions anymore after a plugin reload, and the web UI remained functional.
Can you please test?
Yes, looks a lot better now. at least properties file can be changed and plugin reloaded without issues.
On upgrade note, it probably would be good to mention of doing
ssh gerrit.public gerrit plugin install - -n gitblit < gitblit-plugin-2.9.1.161.2.jar ssh gerrit.public gerrit plugin reload gitblit
if somebody like me would be doing plugin upgrades without gerrit restarts.
Good idea. And also mention that this works only if remote plugin administration is switched on in Gerrit. (It's off by default since 2.9.)
If things look good on your end, can we close this issue?
Looks good. let's close it. Thanks for fix!
First of all: huge thanks for your work on Gitblit plugin.
I've tried to use it on some of my test instances of gerrit and stepped on issue: in case plugin needed to be reloaded, it would create crashes with logs like that:
[2014-10-22 19:29:58,408] ERROR org.apache.wicket.RequestCycle : unexpected exception when handling another exception: Can't instant iate page using constructor public org.apache.wicket.markup.html.pages.InternalErrorPage() org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public org.apache.wicket.markup.html.pages.Intern alErrorPage() at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1296) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1363) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) at com.googlesource.gerrit.plugins.gitblit.GerritWicketFilter.doFilter(GerritWicketFilter.java:99) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:132) at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:129) at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:206) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:129) at com.google.gerrit.httpd.plugins.HttpPluginServlet.service(HttpPluginServlet.java:227) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:278) at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:268) at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:180) at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:93) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:70) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:113) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.gerrit.httpd.RequireSslFilter.doFilter(RequireSslFilter.java:68) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:64) at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:57) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:132) at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:129) at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:206) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:129) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1539) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:219) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:459) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:280) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192) ... 57 more Caused by: java.lang.ClassCastException: com.gitblit.wicket.GitBlitWebSession cannot be cast to org.apache.wicket.Session at org.apache.wicket.protocol.http.AbstractHttpSessionStore.lookup(AbstractHttpSessionStore.java:245) at org.apache.wicket.Session.findOrCreate(Session.java:226) at org.apache.wicket.Session.findOrCreate(Session.java:214) at org.apache.wicket.Session.get(Session.java:253) at org.apache.wicket.Application$1.onInstantiation(Application.java:299) at org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:1093) at org.apache.wicket.Component.(Component.java:926)
at org.apache.wicket.MarkupContainer.(MarkupContainer.java:113)
at org.apache.wicket.MarkupContainer.(MarkupContainer.java:105)
at org.apache.wicket.Page.(Page.java:240)
at org.apache.wicket.markup.html.WebPage.(WebPage.java:185)
at org.apache.wicket.markup.html.pages.InternalErrorPage.(InternalErrorPage.java:37)
... 62 more
After that, only restarting whole gerrit server helps to restore plugin to work.