JNI Error with SNAPP+MODEL_SELECTION on cluster

97 views
Skip to first unread message

Nichelle Van Tassel

unread,
Mar 5, 2023, 1:48:23 PM3/5/23
to beast-users
Hello, 

I am attempting to run BFD on the cluster. I am able to run the same xml on my personal computer with no errors. 

When I run on hpc cluster, it will make all the subdirectories and then I get a JNI error when I try to run the batch scripts. I can go into each subdirectory and execute each beast.xml file just fine, but that's not a practical solution when I need to run 6 models and 100 steps each. Anyone have an idea of what's going on and what I can try? 

Error below:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: beast/pkgmgmt/launcher/BeastLauncher has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)


Best, 
Nichelle

Nichelle Van Tassel

unread,
Mar 7, 2023, 2:05:17 AM3/7/23
to beast-users
Update: I worked with a HPC tech and we were able to fix this problem by uninstalling/reinstalling beast and then loading the beagle library since it wasn't loading before. This seemed to fix the issue.

I now have a new error. The .xml executes, all the steps 'start' and 'finish', but I get this error. This happens on the cluster, but not on my personal computer  (OSX) with the same file.

Loading /path/step0/likelihood.log java.io.FileNotFoundException: /path/step0/likelihood.log (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 java.base/java.io.FileInputStream.<init>(Unknown Source)

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

        at beastfx.app.tools.LogAnalyser.readLogFile(Unknown Source)

        at beastfx.app.tools.LogAnalyser.<init>(Unknown Source)

        at beastfx.app.tools.LogAnalyser.<init>(Unknown Source)

        at modelselection.inference.PathSampleAnalyser.estimateMarginalLikelihood(Unknown Source)

        at modelselection.inference.PathSampleAnalyser.estimateMarginalLikelihood(Unknown Source)

        at modelselection.inference.PathSampler.analyse(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)



There is another thread with a few people who've gotten similar errors when using the cluster but not their personal computers 

Nichelle Van Tassel

unread,
Mar 13, 2023, 7:21:33 PM3/13/23
to beast-users
Update again:

The problem seems to stem from  java -cp "/path/beast/lib/launcher.jar" beast.pkgmgmt.launcher.BeastLauncher in the run.sh files.

I was able to fix this and run the analysis on the cluster 2 ways. 

A. change that line in the run.sh files
     1. Add donotrun='true' to the <run> chunk of the xml file
     2. In each run.sh file, change java -cp "/path/beast/lib/launcher.jar" beast.pkgmgmt.launcher.BeastLauncher to beast
     3. Submit each of those ruh.sh jobs by creating a job file with the code below:

               echo + `date` job $JOB_NAME started in $QUEUE with jobID=$JOB_ID on $HOSTNAME
               echo + NSLOTS = $NSLOTS
              if [ -z $1 ]; then
              echo "Give the run number as an argument: e.g. qsub jobfilename.sb 0"
              exit 1
              fi 
             source ./run${1}.sh
             echo = `date` job $JOB_NAME done

     4. And submitting those with the code below:

       for x in $(seq 0 23); do   qsub -o run${x}.log jobfilename.sb ${x}; done


B. change that line in the xml file and then run as normal
           1. change the lines from:
               cd $(dir)
               java -cp $(java.class.path) beast.app.beastapp.BeastMain $(resume/overwrite) -java -seed $(seed) beast.xml
                to:
               cd $(dir)
               beast $(resume/overwrite) -java -seed $(seed) beast.xml 
 
          2. Submit job as normal
Reply all
Reply to author
Forward
0 new messages