Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Updates #8

wants to merge 6 commits into from

Conversation

egonw
Copy link

@egonw egonw commented Mar 24, 2022

  • CDK 2.7.1 with JNA InChI (replacing the JNI library)
  • Newer Bnd tool
  • Cytoscape 3.9.0

I only tested the SMILES depiction. Please let me know what things I should check.

@egonw
Copy link
Author

egonw commented Mar 24, 2022

Okay, I found one problem:

Native library (linux-x86-64/libjnainchi.so) not found in resource path (/opt/Cytoscape_v3.9.1/framework/lib/boot/branding-3.9.1.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/karaf-launcher-3.9.1.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/opendmk_jmxremote_optional_jar-1.0-b01-ea.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/org.apache.karaf.diagnostic.boot-4.2.8.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/org.apache.karaf.jaas.boot-4.2.8.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/org.apache.karaf.main-4.2.8.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/org.apache.karaf.specs.activator-4.2.8.jar:/opt/Cytoscape_v3.9.1/framework/lib/boot/osgi.core-6.0.0.jar:/opt/Cytoscape_v3.9.1/framework/lib/jdk9plus/istack-commons-runtime-3.0.10.jar:/opt/Cytoscape_v3.9.1/framework/lib/jdk9plus/jakarta.xml.bind-api-2.3.2.jar:/opt/Cytoscape_v3.9.1/framework/lib/jdk9plus/javax.activation-1.2.0.jar:/opt/Cytoscape_v3.9.1/framework/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/opt/Cytoscape_v3.9.1/framework/lib/jdk9plus/jaxb-runtime-2.3.2.jar:/opt/Cytoscape_v3.9.1/framework/lib/jdk9plus/txw2-2.3.2.jar)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301) ~[!/:?]
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461) ~[!/:?]
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403) ~[!/:?]
        at io.github.dan2097.jnainchi.inchi.InchiLibrary.<clinit>(InchiLibrary.java:33) ~[!/:?]
        at io.github.dan2097.jnainchi.JnaInchi.<clinit>(JnaInchi.java:61) ~[!/:?]
        ... 13 more
        Suppressed: java.lang.UnsatisfiedLinkError: libjnainchi.so: cannot open shared object file: No such file or directory
                at com.sun.jna.Native.open(Native Method) ~[!/:?]
                at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191) ~[!/:?]
                at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461) ~[!/:?]
                at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403) ~[!/:?]
                at io.github.dan2097.jnainchi.inchi.InchiLibrary.<clinit>(InchiLibrary.java:33) ~[!/:?]
                at io.github.dan2097.jnainchi.JnaInchi.<clinit>(JnaInchi.java:61) ~[!/:?]
                at org.openscience.cdk.inchi.InChIToStructure.<init>(InChIToStructure.java:116) ~[!/:?]
                at org.openscience.cdk.inchi.InChIToStructure.<init>(InChIToStructure.java:127) ~[!/:?]
                at org.openscience.cdk.inchi.InChIGeneratorFactory.getInChIToStructure(InChIGeneratorFactory.java:211) ~[!/:?]
                at edu.ucsf.rbvi.chemViz2.internal.model.Compound.convertInchiToSmiles(Compound.java:394) [!/:?]

@egonw
Copy link
Author

egonw commented Apr 11, 2022

Does either of you have a lead I can follow up on, @johnmay and @dan2097?

@johnmay
Copy link

johnmay commented Apr 11, 2022

Like the SO is getting stripped out?

@egonw
Copy link
Author

egonw commented Apr 11, 2022

Like the SO is getting stripped out?

my current thought is that they are still there, but in inside the jna-inchi jars which are in the chemViz2-1.2.0.jar plugins jar, and that this double archiving makes them unfindable?

$ jar tvf chemViz2-1.2.0.jar  | grep jna
1756400 Mon Jan 10 15:18:46 CET 2022 jna-5.10.0.jar
 76056 Thu Mar 24 12:09:58 CET 2022 jna-inchi-api-1.1.jar
  1688 Thu Mar 24 12:09:58 CET 2022 jna-inchi-core-1.1.jar
659168 Thu Mar 24 12:09:58 CET 2022 jna-inchi-darwin-aarch64-1.1.jar
700925 Thu Mar 24 12:09:58 CET 2022 jna-inchi-darwin-x86-64-1.1.jar
612015 Thu Mar 24 12:09:58 CET 2022 jna-inchi-linux-arm-1.1.jar
639995 Thu Mar 24 12:10:00 CET 2022 jna-inchi-linux-x86-1.1.jar
674110 Thu Mar 24 12:10:00 CET 2022 jna-inchi-linux-x86-64-1.1.jar
567074 Thu Mar 24 12:10:00 CET 2022 jna-inchi-win32-x86-1.1.jar
682583 Thu Mar 24 12:10:00 CET 2022 jna-inchi-win32-x86-64-1.1.jar
 13656 Fri Dec 31 09:46:18 CET 2021 jnati-core-0.4.jar
 32831 Fri Dec 31 09:46:18 CET 2021 jnati-deploy-0.4.jar

@dan2097
Copy link

dan2097 commented Apr 11, 2022

I think the double archiving may be intentional to work with OSGI. Is there an easy way to reproduce the error you mentioned? I can produce the packaged jar on Java 11.
If I were to take a guess I wonder whether it's an issue with the maven-bundle-plugin configuration, as as far as I'm aware JNA supports OSGI... but I'm not personally at all familiar with OSGI!

Unrelatedly, the build fails on Java 8 with the following error:

[ERROR] /C:/My Documents/workspace/chemViz2/src/main/java/edu/ucsf/rbvi/chemViz2/internal/tasks/ChemInfoSettingsTask.java:[6,26] cannot access org.cytoscape.work.AbstractTask
  bad class file: C:\Users\Daniel\.m2\repository\org\cytoscape\work-api\3.9.0\work-api-3.9.0.jar(org/cytoscape/work/AbstractTask.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

@egonw
Copy link
Author

egonw commented May 18, 2022

@dan2097, @johnmay, okay, this was silliest mistake in 2022. It's working fine now.

@scootermorris, this PR is ready to get merged in.

@dan2097
Copy link

dan2097 commented May 22, 2022

@egonw I'm still a bit confused as to why this would fix the issue, while jna-inchi-all does include the native binaries, jna-inchi-core also does! [jna-inchi-all also pulls in code for reading SMILES]

@egonw
Copy link
Author

egonw commented May 22, 2022

@egonw I'm still a bit confused as to why this would fix the issue, while jna-inchi-all does include the native binaries, jna-inchi-core also does! [jna-inchi-all also pulls in code for reading SMILES]

Mmm... not sure. It just made it work for me.

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.

3 participants