Skip to content

Fix NullPointerException in Mesquite headless initialization during nexus file upload#400

Merged
rvosa merged 3 commits intomasterfrom
copilot/fix-nullpointer-exception
Jan 13, 2026
Merged

Fix NullPointerException in Mesquite headless initialization during nexus file upload#400
rvosa merged 3 commits intomasterfrom
copilot/fix-nullpointer-exception

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

Nexus file uploads fail with NullPointerException: Cannot invoke "mesquite.lib.MesquiteModule.getProject()" because "ownerModule" is null in HelpSearchManager.makeWindow(). The Mesquite library's main() checks MesquiteWindow.headless before processing args, but we only passed -w (suppressAllWindows) without setting headless mode first.

Changes

  • Set MesquiteWindow.headless = true before calling Mesquite.main() in both parseOneFile() and processLoadFile()
  • Added import for mesquite.lib.MesquiteWindow
synchronized (MesquiteConverter.class) {
    if (!isInitMesquite()) {
        // Set headless mode before initializing Mesquite to prevent GUI window creation
        MesquiteWindow.headless = true;
        Mesquite.main(new String[] {"-w", "-b"});
        setInitMesquite(true);
    }
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • getahead.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/treebase/.codeql-scratch/dbs/java/working/files-to-index7953826755503419578.list --sourceArchiveDir=/home/REDACTED/work/treebase/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/treebase/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

When I try to upload a nexus file, I see this in the log:

treebase-web-dev | java.lang.NullPointerException: Cannot invoke "mesquite.lib.MesquiteModule.getProject()" because "ownerModule" is null
treebase-web-dev | at mesquite.lib.MesquiteWindow.(MesquiteWindow.java:128)
treebase-web-dev | at mesquite.lib.MesquiteHTMLWindow.(MesquiteHTMLWindow.java:39)
treebase-web-dev | at mesquite.lib.MesquiteHTMLWindow.(MesquiteHTMLWindow.java:36)
treebase-web-dev | at mesquite.lib.HSWindow.(HelpSearchManager.java:1068)
treebase-web-dev | at mesquite.lib.HelpSearchManager.makeWindow(HelpSearchManager.java:44)
treebase-web-dev | at mesquite.Mesquite.init(Mesquite.java:468)
treebase-web-dev | at mesquite.Mesquite.(Mesquite.java:2033)
treebase-web-dev | at mesquite.Mesquite.main(Mesquite.java:2088)
treebase-web-dev | at org.cipres.treebase.domain.nexus.mesquite.MesquiteConverter.parseOneFile(MesquiteConverter.java:233)
treebase-web-dev | at org.cipres.treebase.service.nexus.NexusServiceMesquite.parseNexus(NexusServiceMesquite.java:179)
treebase-web-dev | at org.cipres.treebase.service.study.SubmissionServiceImpl.addNexusFile(SubmissionServiceImpl.java:680)
treebase-web-dev | at org.cipres.treebase.service.study.SubmissionServiceImpl.addNexusFilesJDBC(SubmissionServiceImpl.java:604)
treebase-web-dev | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
treebase-web-dev | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
treebase-web-dev | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
treebase-web-dev | at java.base/java.lang.reflect.Method.invoke(Method.java:569)
treebase-web-dev | at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
treebase-web-dev | at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
treebase-web-dev | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
treebase-web-dev | at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
treebase-web-dev | at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
treebase-web-dev | at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
treebase-web-dev | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
treebase-web-dev | at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
treebase-web-dev | at jdk.proxy3/jdk.proxy3.$Proxy141.addNexusFilesJDBC(Unknown Source)
treebase-web-dev | at org.cipres.treebase.web.controllers.UploadFileController.onSubmit(UploadFileController.java:219)
treebase-web-dev | at org.cipres.treebase.web.compat.CancellableFormController.processFormSubmission(CancellableFormController.java:209)
treebase-web-dev | at org.cipres.treebase.web.compat.CancellableFormController.handleRequestInternal(CancellableFormController.java:112)
treebase-web-dev | at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
treebase-web-dev | at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51)
treebase-web-dev | at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
treebase-web-dev | at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
treebase-web-dev | at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
treebase-web-dev | at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
treebase-web-dev | at javax.servlet.http.HttpServlet.service(HttpServlet.java:555)
treebase-web-dev | at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
treebase-web-dev | at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
treebase-web-dev | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
treebase-web-dev | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)
treebase-web-dev | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
treebase-web-dev | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
treebase-web-dev | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.ja...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 13, 2026 18:10
…teWindow.headless=true before Mesquite.main()

Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix NullPointerException on nexus file upload Fix NullPointerException in Mesquite headless initialization during nexus file upload Jan 13, 2026
Copilot AI requested a review from rvosa January 13, 2026 18:15
@rvosa rvosa marked this pull request as ready for review January 13, 2026 18:22
@rvosa rvosa merged commit 885590d into master Jan 13, 2026
3 checks passed
@rvosa rvosa deleted the copilot/fix-nullpointer-exception branch January 13, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants