LinguaPhylo / LPhyBeast

Convert LPhy scripts to BEAST 2 XML
GNU Lesser General Public License v2.1
3 stars 1 forks source link

Extension loading issue while running LPhyBEAST 1.1.0 via cmd #152

Closed CSTE7007 closed 1 month ago

CSTE7007 commented 2 months ago

I was trying to follow LPhyBEAST mentioned at the usage section at https://linguaphylo.github.io/setup/

I copied the lphybeast file to my beast/bin directory

and then in my terminal I wrote

./lphybeast ~/lphy-studio-1.5.0/tutorials/RSV2.lphy

The lphybeast script would have generate the “RSV2.xml”

But instead I am facing the following exception and error:

openjdk version "17.0.3" 2022-04-19 LTS
OpenJDK Runtime Environment Zulu17.34+19-CA (build 17.0.3+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.34+19-CA (build 17.0.3+7-LTS, mixed mode, sharing)

Guessing LPHY_LIB on Linux ...
BEAST_LIB = /home/user/Desktop/2024/beast/lib
BEAST_EXTRA_LIBS =
LPHY_LIB = /home/user/lphy-studio-1.5.0/lib

Loading package Mascot v3.0.7 BDSKY v1.5.0 BASTA v4.0.0 BEASTLabs v2.0.2 CCD v1.0.0 LPhyBeastExt v0.3.0 GEO_SPHERE v1.4.1 feast v10.3.1 phylonco v1.0.1 BREAK_AWAY v1.2.0 ORC v1.2.0 FastRelaxedClockLogNormal v1.2.0 lphybeast v1.1.0 SNAPP v1.6.1 BEAST.app v2.7.7 BEAST.base v2.7.7 CoupledMCMC v1.2.1 snapper v1.1.4 BEAST_CLASSIC v1.6.3 bdtree v0.0.1 SA v2.1.1 starbeast3 v1.1.8 MODEL_SELECTION v1.6.2 phylodynamics v1.4.0 SSM v1.2.0 MM v1.2.1    
About to invoke lphybeast.LPhyBeastCMD public static void lphybeast.LPhyBeastCMD.main(java.lang.String[])
Args:[/home/user/lphy-studio-1.5.0/tutorials/RSV2.lphy]
Registering extension from lphybeast.spi.LPhyBEASTExtImpl
Registering extension from mascot.lphybeast.spi.MascotLBImpl
Registering extension from sa.lphybeast.spi.SALBImpl
Registering extension from phylonco.lphybeast.spi.LBPhylonco
java.lang.reflect.InvocationTargetException
    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 beastfx.app.tools.AppLauncher.runAppFromCMD(Unknown Source)
    at beastfx.app.tools.AppLauncher.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.AppLauncherLauncher.main(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: phylonco.lphy.evolution.datatype.PhasedGenotype
    at beast.pkgmgmt.MultiParentURLClassLoader.loadClass(Unknown Source)
    at phylonco.lphybeast.spi.LBPhylonco.getDataTypeMap(LBPhylonco.java:46)
    at lphybeast.LPhyBEASTLoader.registerExtensions(LPhyBEASTLoader.java:172)
    at lphybeast.LPhyBEASTLoader.<init>(LPhyBEASTLoader.java:35)
    at lphybeast.LPhyBEASTLoader.getInstance(LPhyBEASTLoader.java:41)
    at lphybeast.LPhyBeastCMD.call(LPhyBeastCMD.java:121)
    at lphybeast.LPhyBeastCMD.call(LPhyBeastCMD.java:13)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at lphybeast.LPhyBeastCMD.main(LPhyBeastCMD.java:99)
    ... 12 more

My configuration: BEAST v2.7.7 Ubuntu 18.04.6 LTS 64-bit | 8GB RAM Intel® Core™ i5-3470 CPU @ 3.20GHz × 4

walterxie commented 2 months ago

The error message shows the class phylonco.lphy.evolution.datatype.PhasedGenotype cannot be found, which is in another BEAST package phylonco. I will investigate why this happens.

In the meantime, you can try to uninstall phylonco using PackageManager. It is not required for LPhyBeast to create XMLs in the tutorials, e.g. RSV2.lphy.

In addition, this problem does not relate to the LPhyBeastExt package, so I transfer it to here.

walterxie commented 2 months ago

It seems the current released version of phylonco-lphy-0.0.3.jar is not compatible to LPhy 1.5.0 SPI code. Looking at the SPI in the decompiled phylonco-lphy-0.0.3.jar, it is still using lphy 1.4.x SPI, but the current release of lphybeast is depending on lphy 1.5, so phylonco's lphy classes cannot be loaded properly.

The problem is that phylonco package is not compatible to the lphybeast. The lphybeast core has no issue.

walterxie commented 1 month ago

@CSTE7007 We have released the new version of LPhy 1.6.0 and LPhyBEAST 1.2.0, and phylonco 1.2.0, phylonco.lphybeast 1.2.0. This problem will be solved if you update them to those new versions. In this new version, phylonco is split into 2 releases, one (phylonco) is for BEAST 2 only, the other (phylonco.lphybeast ) is for LPhyBEAST to create XML.

The dependency detail is listed in the new user manual. We are updating the rest webpages at the moment.

Please note : if you are using phylonco lphy or phylonco lphybeast, please remember to put the two jar files (phylonco-lphy and phylonco-lphy-studio ) into LPhy lib folder, and remove the old one.

Thank you to support our software.

walterxie commented 1 month ago

I will keep this issue open for 2 weeks, if any problems, please ask here.