Skip to main content

TestGeneious.initializeAllPlugins() causes java.lang.reflect.InvocationTargetException



  • Jeff Gentry

    Digging in more, a couple of things:

    1. I've managed to get this to work on Windows
    2. I think I've narrowed it down to the following issue after fiddling with it a bit: `
      Caused by: java.lang.IllegalStateException: Could not find resource: libMacFontBundler.dylib for class: com.biomatters.geneious.laf.b$b`. 
  • Matthew Cheung

    Hi Jeff, 

    For the geneious-mira project it looks like the problem is that the native_libs directory is missing from the classpath when running tests (it is there when using runGeneious).

    Modifying line 58 in geneiousplugin.gradle to the following seems to work (addition in bold).

    environment "DYLD_LIBRARY_PATH", "/Library/Application Support/Geneious/Frameworks:native_libs/macos"

    Try that for your plugin.  If that doesn't work can you:

    • Let me know how you're running the test e.g. Gradle vs IDE vs something else
    • Attach the full console output

    Hope that helps.  


  • Jeff Gentry

    Hmm, thanks, this moved things in the right direction at least. For context, I'm using Gradle. I have the `GeneiousFiles` downloaded in `build`, in a similar manner to the Mira plugin. What I currently have in gradle, also cribbed heavily from the Mira plugin is:

    tasks.test {
    workingDir file("$buildDir/$geneiousFilesName")
    minHeapSize '256M'
    maxHeapSize '2048M'
    jvmArgs '-ea',
    environment "DYLD_LIBRARY_PATH", "native_libs/macos:resources/com/biomatters/geneious/laf"


    Now the stack trace is failing related to fonts. Which I do see in `resources/com/biomatters/geneious/fonts`

    Caused by: java.lang.AssertionError: Failed to initialize bundled font. expected=Noto Sans, got=Dialog
    	at com.biomatters.geneious.laf.b$a.a(
    	at com.biomatters.geneious.laf.g.a(
    	at com.biomatters.geneious.laf.g.d(
    	at com.biomatters.geneious.laf.GeneiousFlatLafTheme.setGeneiousCustomProperties(
    	at com.biomatters.geneious.laf.GeneiousFlatLafTheme.setup(
    	at com.biomatters.geneious.laf.g.f(
    	at com.biomatters.geneious.publicapi.utilities.ThreadUtilities.lambda$invokeAndWait$0(
    	at org.virion.jam.util.Utils$
    	at java.desktop/java.awt.event.InvocationEvent.dispatch(
    	at java.desktop/java.awt.EventQueue.dispatchEventImpl(
    	at java.desktop/java.awt.EventQueue$
    	at java.desktop/java.awt.EventQueue$
    	at java.base/ Method)
    	at java.base/$JavaSecurityAccessImpl.doIntersectionPrivilege(
    	at java.desktop/java.awt.EventQueue.dispatchEvent(
    	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(
    	at java.desktop/


  • Matthew Cheung

    Hard to know why the font isn't being loaded there. Make sure that one of the TestGeneious.initialize() methods being called before anything else in your test.  That can sometimes be the problem.

    If that isn't the problem, could you share the code with us at and I can take a look to see what the problem is.

  • Matthew Cheung

    Not sure if the problem was resolved in the end, but one of my team mentioned that it can also be caused by a bug in Java that has been fixed in Java 11.0.22 at least.

  • Jeff Gentry

    Hi - to be honest I just shifted my workflow to use a Windows Remote Desktop where I have Geneious installed instead. However this is interesting, and my version of Java is 11.0.17, so I'll give this a try.

  • Jeff Gentry

    It did not change the issue, using 11.0.23+9. I will say that I've been suspicious it's the lack of having Geneious installed at all on this machine. 

  • Matthew Cheung

    Hmm OK.  Let us know if you end up confirming by installing Geneious on your Mac.

  • Jeff Gentry

    Yeah, unfortunately I don't have access to the license server being used via my Mac, thus the lack of the install. Unless you think the only issue is the files need to be present. For instance, when I run tests on the windows remote desktop I get a popup that says it can't connect to the license server - so I was assuming it needed at least something "real". That said, lack of connectivity doesn't affect the tests so perhaps it doesn't matter.


Please sign in to leave a comment.