Model Selection ClassNotFoundException

89 views
Skip to first unread message

Christopher Griffin

unread,
Dec 15, 2025, 9:43:00 PM12/15/25
to beast-users
Hello all,

I am attempting to run a path sampling analysis using the Model Selection package in BEAST2. When I try to either launch it through the AppLauncher GUI, or edit the XML file and run it on BEAST manually, I get this output and error message (in bold):

Loading package starbeast3 v1.2.1
Loading package CCD v1.0.3
Loading package SA v2.1.1
Loading package BEAST.base v2.7.8
Loading package BEASTLabs v2.0.3
Loading package BEAST.app v2.7.8
Loading package MM v1.2.1
Loading package ORC v1.2.1
Loading package MODEL_SELECTION v1.6.0
/Users/cg0566/Desktop/Brownstein and Griffin_2025_Early Burst of Skeletal Evolution/For SI/Fonseca_et_al_2024/Path_Sampling/step0/run.sh
java.lang.ClassNotFoundException: beastfx.app.beast.BeastMain
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at beast.pkgmgmt.BEASTClassLoader.forName(Unknown Source)
at beast.pkgmgmt.launcher.BeastLauncher.run(Unknown Source)
at beast.pkgmgmt.launcher.BeastLauncher.main(Unknown Source)


Opening the run.sh and running it line-by-line into Terminal results in this same error message comes after this command:

java -cp "/Applications/BEAST 2.7.7/BEAST.app/Contents/Resources/Java/launcher.jar" beast.pkgmgmt.launcher.BeastLauncher -overwrite -java -seed 7840029810045659296 beast.xml

I am working with Java 17, and I have tried this with Model Selection 1.6.2 and 1.6.0, and I have uninstalled and reinstalled BEAST 2.7.7. 

Happy to share the XML file if need be, thanks for any help,

Chris 

Erika

unread,
Feb 24, 2026, 8:46:40 PMFeb 24
to beast-users
Hi Chris,
  Were you able to figure this out and get it to run? I'd also like to know how you edited your xml file to run path sampling using v2.7.7. I'm trying to run path sampling for bayes factor delimitation but can't figure out how to edit my xml file. It says here (https://www.beast2.org/path-sampling/) to "insert </run> after the closing </mcmc> element" but there is no </mcmc> element in the xml file produced by BEAST 2.7.7....
 Erika

Christopher Griffin

unread,
Feb 25, 2026, 1:27:19 PMFeb 25
to beast-users
Hi Erika,

I can't attach my XML file, unfortunately, but here's the code block that I but just before the <mcmc> tag (the path is for running on a cluster):

<run id="PathSampler.0" spec="modelselection.inference.PathSampler" chainLength="300000000" deleteOldLogs="true" nrOfSteps="20" preBurnin="150000000" rootdir="/scratch/gpfs/CHRISGRIFFIN/BEAST2/Griffin_et_al_2022/Langer_et_al_2017/Path_Sampling/RLC">
        <mcmc id="mcmc" spec="MCMC" chainLength="40000000" preBurnin="20000000">

And here's the end of my XML file, I had to insert </mcmc> before </run>:

                <log id="TreeWithMetaDataLogger.t:Langer" spec="beast.base.evolution.TreeWithMetaDataLogger" branchratemodel="@RandomLocalClock.c:Langer" tree="@Tree.t:Langer"/>
            </logger>
            <operatorschedule id="OperatorSchedule" spec="OperatorSchedule"/>
        </mcmc>

cd $(dir)

beast $(resume/overwrite) -java -seed $(seed) beast.xml    
    </run>

</beast>

This is in v2.7.7, hope this helps! 

Erika

unread,
Mar 2, 2026, 5:08:02 PM (14 days ago) Mar 2
to beast-users
Hi Chris,
That did seem to help some. I can at least get the path sampling started, a run0.sh file is created, along with step0 - step11 folders. This is what I'm getting now:

Loading package starbeast3 v1.2.1
Loading package CCD v1.0.3
Loading package SA v2.1.1
Loading package BEAST.base v2.7.8
Loading package BEASTLabs v2.0.3
Loading package BEAST.app v2.7.8
Loading package ORC v1.2.1
Loading package SNAPP v1.6.1
Loading package MODEL_SELECTION v1.6.2
/Users/Bayes Factor Delimitation/topology - SNAPP/step0/run.sh
/Users/Bayes Factor Delimitation/topology - SNAPP/step0/run.sh: line 3: beast: command not found
java.io.FileNotFoundException: /Users/Bayes Factor Delimitation/topology - SNAPP/step0/beast.xml.state (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(Unknown Source)
at java.base/java.io.FileInputStream.<init>(Unknown Source)
at modelselection.inference.PathSampler.copyStateFile(Unknown Source)
at modelselection.inference.PathSampler.doRuns(Unknown Source)
at modelselection.inference.PathSampler.run(Unknown Source)
at beastfx.app.beast.BeastMCMC.run(Unknown Source)
at beastfx.app.beast.Controller$2.run(Unknown Source)


It now seems to not like the "beast" in the below line in the edited xml file:

beast $(resume/overwrite) -java -seed $(seed) beast.xml


because it's not able to produce a beast.xml.state file. Do you have any experience with this error?

Erika

unread,
Mar 2, 2026, 7:30:15 PM (14 days ago) Mar 2
to beast-users
Sorry to bombard. I changed that "beast" in the line to find the beast on my computer as such:

~/Applications/BEAST\ 2.7.7/bin/beast $(resume/overwrite) -java -seed $(seed) beast.xml


That seemed to help a bit. I can get run0.sh - run3.sh files created but now I just get this error:

Starting step 0

Starting step 3

Starting step 2

Starting step 1

Finished step 2

Finished step 3

Finished step 1

Finished step 0

java.io.FileNotFoundException: /Users/Bayes Factor Delimitation/topology - SNAPP/step3/beast.xml.state (No such file or directory)

at java.base/java.io.FileInputStream.open0(Native Method)

at java.base/java.io.FileInputStream.open(Unknown Source)

at java.base/java.io.FileInputStream.<init>(Unknown Source)

at modelselection.inference.PathSampler.copyStateFile(Unknown Source)

at modelselection.inference.PathSampler.doRuns(Unknown Source)

at modelselection.inference.PathSampler.run(Unknown Source)

at beastfx.app.beast.BeastMCMC.run(Unknown Source)

at beastfx.app.beast.BeastMain.main(Unknown Source)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at beast.pkgmgmt.launcher.BeastLauncher.run(Unknown Source)

at beast.pkgmgmt.launcher.BeastLauncher.main(Unknown Source)


I cannot get beast to make the beast.xml.state files. It says it's getting hung up on step 3 because there is no beast.xml.state file being produced but this file was not made in steps 0 - 2 either... Did you have any problem like this?


Erika

unread,
Mar 4, 2026, 8:56:48 PM (12 days ago) Mar 4
to beast-users
Nevermind. I was able to get speedemon to work and that satisfies the need to use model selection.

Christopher T. Griffin

unread,
Mar 15, 2026, 2:47:28 PM (yesterday) Mar 15
to beast...@googlegroups.com
Hi,

I didn’t, sorry. I was going to suggest adding the whole path to the beast command, glad that helped! I ran these on our cluster and did not have this issue, sorry I couldn’t be more help.

Chris 

-- 

Chris Griffin

Assistant Professor of Geosciences

Princeton University

www.griffinlabpaleo.com

 

--
You received this message because you are subscribed to a topic in the Google Groups "beast-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beast-users/H1v0Ud3YYSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beast-users/df2df1bf-5e19-4503-ac30-0f3e54bb91ecn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages