Java 20/21 support (OD-1373)
Released
Ben Cooper opened 1 year ago

I am getting a HTTP 500 internal server error when creating an issue. This was initially reported by a user who had Code Writer permissions on a project, but can also be recreated by myself with Project Owner and site admin permissions.

OneDev version: 8.2.0 and 8.2.1 (self-hosted)

The text displayed to the user in the browser is:

HTTP ERROR 500 Internal server error: check server log for details
URI:	/<project_name>/~issues/new
STATUS:	500
MESSAGE:	Internal server error: check server log for details
SERVLET:	io.onedev.server.web.DefaultWicketServlet$$EnhancerByGuice$$157356420-5f1e4890
Powered by Jetty:// 9.4.51.v20230217

server.log output is:

2023-05-10 14:58:47,487 ERROR [qtp197016824-216] io.onedev.server.util.ExceptionUtils Error serving request
java.lang.RuntimeException: BUG! exception in phase 'semantic analysis' in source unit 'Script_49ad8a260adad875f2482744e11b4f29.groovy' Unsupported class file major version 64
	at io.onedev.commons.bootstrap.Bootstrap.unchecked(Bootstrap.java:337)
	at io.onedev.commons.utils.ExceptionUtils.unchecked(ExceptionUtils.java:35)
	at io.onedev.server.persistence.SessionInterceptor$1.call(SessionInterceptor.java:25)
	at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
	at io.onedev.server.persistence.SessionInterceptor.invoke(SessionInterceptor.java:18)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656)
	at com.google.inject.servlet.DefaultFilterPipeline.dispatch(DefaultFilterPipeline.java:47)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at io.onedev.server.git.GoGetFilter.doFilter(GoGetFilter.java:87)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at io.onedev.server.git.GitLfsFilter.doFilter(GitLfsFilter.java:455)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at io.onedev.server.git.GitFilter.doFilter(GitFilter.java:377)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:458)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:373)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:370)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at io.onedev.server.jetty.DisableTraceFilter.doFilter(DisableTraceFilter.java:28)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:772)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.base/java.lang.Thread.run(Thread.java:1623)
Caused by: org.codehaus.groovy.GroovyBugError: BUG! exception in phase 'semantic analysis' in source unit 'Script_49ad8a260adad875f2482744e11b4f29.groovy' Unsupported class file major version 64
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:905)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332)
	at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
	at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:314)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:257)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
	at io.onedev.server.util.GroovyUtils.compile(GroovyUtils.java:31)
	at io.onedev.server.util.GroovyUtils.evalScript(GroovyUtils.java:102)
	at io.onedev.server.buildspecmodel.inputspec.InputSpec.defineClass(InputSpec.java:259)
	at io.onedev.server.model.support.issue.field.FieldUtils.defineFieldBeanClass(FieldUtils.java:76)
	at io.onedev.server.model.support.issue.field.FieldUtils.getFieldBeanClass(FieldUtils.java:64)
	at io.onedev.server.web.component.issue.create.NewIssueEditor.onInitialize(NewIssueEditor.java:95)
	at org.apache.wicket.Component.fireInitialize(Component.java:878)
	at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1077)
	at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1073)
	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)
	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)
	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)
	at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:984)
	at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1072)
	at org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:1048)
	at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:242)
	at io.onedev.server.web.page.project.issues.create.NewIssuePage.onInitialize(NewIssuePage.java:114)
	at org.apache.wicket.Component.fireInitialize(Component.java:878)
	at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1071)
	at org.apache.wicket.Page.isPageStateless(Page.java:465)
	at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.getPageInfo(AbstractBookmarkableMapper.java:498)
	at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:443)
	at org.apache.wicket.core.request.mapper.MountedMapper.mapHandler(MountedMapper.java:160)
	at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:210)
	at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:210)
	at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:443)
	at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:233)
	at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:917)
	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:274)
	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:231)
	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:302)
	at org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70)
	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
	at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at io.onedev.server.web.DefaultWicketServlet.service(DefaultWicketServlet.java:43)
	at io.onedev.server.persistence.SessionInterceptor$1.call(SessionInterceptor.java:23)
	... 67 common frames omitted
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 64
	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:199)
	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:180)
	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:166)
	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:287)
	at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
	at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
	at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
	at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
	at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
	at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:869)
	at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:506)
	at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:468)
	at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:338)
	at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1466)
	at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:262)
	at org.codehaus.groovy.control.CompilationUnit.lambda$new$16(CompilationUnit.java:738)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:901)
	... 116 common frames omitted
Ben Cooper changed fields 1 year ago
Name Previous Value Current Value
Priority
Major
Normal
Ben Cooper commented 1 year ago

Setting my JRE from 20 to 17 has resolved this problem (running on Archlinux).

It appears Archlinux updated from JRE 19 to 20 on or around April 30th and this is likely the first issue that's been opened since then, I imagine that may be the cause.

Robin Shen commented 1 year ago

OneDev internally uses Groovy which does not support Java 20 yet.

Please make sure to always use Java LTS versions for OneDev which has been tested.

Robin Shen changed fields 1 year ago
Name Previous Value Current Value
Type
Bug
Improvement
Robin Shen changed title 1 year ago
Previous Value Current Value
Error 500 when creating issue
Java 20 support
Robin Shen changed title 6 months ago
Previous Value Current Value
Java 20 support
Java 20/21 support
OneDev changed state to 'Closed' 6 months ago
Previous Value Current Value
Open
Closed
OneDev commented 6 months ago

State changed as code fixing the issue is committed (bc776b28f96b180eb4c06f655b86405c3ab9b357)

OneDev changed state to 'Released' 6 months ago
Previous Value Current Value
Closed
Released
OneDev commented 6 months ago

State changed as build #4330 is successful

issue 1 of 1
Type
Improvement
Priority
Normal
Assignee
Issue Votes (0)
Watchers (4)
Reference
OD-1373
Please wait...
Page is in error, reload to recover