Menu

#112 net.idea.modbcum issues

ambit-3.0.3
open
nobody
None
5
2019-09-18
2019-09-08
No

Hi all,
I am having issues in my codebase related the to DefaultAmbitProcessor. This is happening at many parts of the code. I get the following error message:
(1) Exception in thread "main" java.lang.NoClassDefFoundError: net/idea/modbcum/p/DefaultAmbitProcessor

I checked the local .m2 repository and the modbcum libraries (i,p,e) are all included. I have even tried adding those explicitely to the project build path, but it did not help.

Below is one example code where I use the Standardizer to process a molecule:

public class Test {
public static void main(String[] args) throws Exception {
IChemObjectBuilder  builder = SilentChemObjectBuilder.getInstance();
SmilesParser    smiParser       = new SmilesParser(builder);    
IAtomContainer atc = smiParser.parseSmiles("CC(=O)OC");

StructureStandardizer sst = new StructureStandardizer();
//      sst.setGenerate2D(true);
//      sst.setGenerateStereofrom2D(true);
//      sst.setImplicitHydrogens(true);
//      sst.setGenerateSMILES_Canonical(true);
//      IAtomContainer natc = sst.process(atc);
//      System.out.println(natc);
}

I also get a related error message that points to the function below:
(2) The type net.idea.modbcum.i.exceptions.AmbitException cannot be resolved. It is indirectly referenced from required .class files

public static boolean isInvalid(IAtomContainer molecule) throws SMARTSException{

    String patterns = "["
            + "$([H][H]),"  // Dihydrogen
            + "$(O=C=O),"   // Carbon dioxide
            + "$([#6;A;H2X3]=[O;X1]),"      // Carbon monoxide
            + "$([OX2H2]),"     // Water
            + "$([H])," // Hydrogen
            + "$([OX1]=[SX1]),"
            + "$([NX3H3]),"
            + "$([CX4H3])" // Methane
            + "$([F,Cl,Br,I;-]),"
            + "$([F,Cl,Br,I;H1X1]),"
            + "$([#8;X2H1,X1-][S;X4]([#8;X2H1,X1-])(=[O;X1])=[O;X1])," // Sulfate
            + "$([#8;X2H1,X1-][P;X4]([#8;X2H1,X1-])([#8;X2H1,X1-])=[O;X1])" // Phosphate
            + "]";

    SmartsPatternCDK cdkPattern =  new SmartsPatternCDK(patterns);
    return (cdkPattern.hasSMARTSPattern(molecule)>0);
}

I started getting latter error message after cloning the main codebase on a new computer running Ubuntu. It used the 3.0.3-SNAPSHOT version, which for some reason is not suggested from the Eclipse's maven index anymore (see attached file). I decided to try different versions of AMBIT (some of which I installed manually). This did not help at all. My old machine is brken, so I am forced to fix the issue on the new one. AMBIT is the only library raising this type of issues.

Coud you please help me solve this?

I used the correct ambit groupId to import the libraries.

Best,
Yannick

1 Attachments

Discussion

  • Nina Jeliazkova

    Nina Jeliazkova - 2019-09-09

    Yannick, this seems to be a dependency issue, so please check all the dependencies. Also 3.0.3-SNAPSHOT is _very_old _ , the current development version of AMBIT is 4.0.0-SNAPSHOT (master). The modbum source is https://github.com/vedina/modbcum (1.0.10-SNAPSHOT in master)

     
  • Yannick Djoumbou

    Hi Nina,
    Thank you so much for the quick reply. I will let you know how that worked out. usually, when including AMBIT, and building the workspace, modbcum is installed automatically. I assume the latest version of AMBT wil automatically install version 1.0.10. Which version of CDK is the current AMBIT version dependent of?

     
  • Yannick Djoumbou

    Thanks Nina,
    It looks like it might be a problem with system. I installed Ubuntu 18.04 on a new machine. I have tried different versions of Eclipse, dowloaded index. Either I only get partially results when looking for ambit libraries, or none. It is kind of frustrating.

     
  • Nina Jeliazkova

    Nina Jeliazkova - 2019-09-10

    Perhaps try plain updating the dependencies via command line maven; eclipse Maven support is sometimes behaving weird ...
    try

    cd ambit2-all
    mvn install -DskipTests=True 
    
     
  • Yannick Djoumbou

    OK. I will try that. I hope that will help.
    Thanks,
    Yannick

     
  • Yannick Djoumbou

    Hi Nina,
    I have tried quite a few things. I still cant download the .jar files through Maven. I even ceated a dummy project from scratch, without eclipse, and creatig a pacake just fails. Attached is an image with the pom file and the outou from my terminal. Of all the libraries I am importing from my various Maven projects, AMBIT (smarts, tautomers, etc.) is the only one that is consistently not found. The only versions that seem to appear on index are 3.0.2 and 3.0.3-SNAPSHOT, no matter what platform(Mac OSX or Linux). And some other co-developers are havint he same issue too. I am not sure what we are doig wrong here.

    Best,
    Yannick

     
  • Nina Jeliazkova

    Nina Jeliazkova - 2019-09-17

    Yannick,

    Is it possible for you to share your pom.xml file (at least the part of it defining repositories and dependencies) ?

    Thanks,
    Nina

     
  • Nina Jeliazkova

    Nina Jeliazkova - 2019-09-17

    btw, on the screenshot you have typo - -SNAPSHOT , not SNASOT :)

     
  • Yannick Djoumbou

    Hi Nina,
    I guess I was tired of trying :). Here is the pom.xml with the correct spelling. Same error message.
    However, I noticed that I need to specify the repositories, and after tryig a few times, I follwed the convention below, and it worked.

    1) To import a release (e.g.: 3.2.0), I added the following:
    <repositories>
    <repository>
    <id>nexus-idea-releases</id>
    <url>https://nexus.ideaconsult.net/content/repositories/releases</url>
    </repository>
    </repositories>

    2) To import a snapshot (e.g.: 4.0.0-SNAPSHOT), I rather added the following:
    <repositories>
    <repository>
    <id>nexus-idea-snapshots</id>
    <url>https://nexus.ideaconsult.net/content/repositories/snapshots</url>
    </repository>
    </repositories>

    Please ket me know whether that is the way to go.

    Thank,
    Yannick

     
  • Nina Jeliazkova

    Nina Jeliazkova - 2019-09-18

    Yes, specifying the repositories is the correct way to go

     
  • Nina Jeliazkova

    Nina Jeliazkova - 2019-09-18

    We keep a github repository with examples how to use ambit modules (including maven configurations) https://github.com/ideaconsult/apps-ambit

     

Log in to post a comment.