Weird chemaxon.license.LicenseException

User dc9564761a

12-05-2012 12:08:04


Hi all,


   I have installed Marvin Sketch
and the corresponding marvin beans from Java. I have managed to import a
simple SD file and convert it into Smiles, Inchi and other formats but
I'm having problems with IUPACNamingPlugin. I initialize a new plugin as
follows:


IUPACNamingPlugin pl = new IUPACNamingPlugin();


then, I simply do a:


pl.setMolecule(molecule);
pl.run();            
System.out.println(pl.getPreferredIUPACName());


and although naming runs from within the GUI, from Java it throws the following exception:


Exception in thread "main" chemaxon.license.LicenseException: No valid license has been found.
Product name: Structure to Name Plugin
License path: /home/user/.chemaxon/license.cxl
Please contact sales _at_ chemaxon.com to obtain the corresponding license.
Students and academic researchers are entitled of free use
through our Academic Package, for more information
please visit: http://www.chemaxon.com/acpack_conditions.html />    at chemaxon.license.LicenseHandler.checkLicense(LicenseHandler.java:562)
    at chemaxon.marvin.io.formats.name.nameexport.IUPACNamer.checkLicense(IUPACNamer.java:54)
    at chemaxon.marvin.io.formats.name.nameexport.IUPACNamer.generateName(IUPACNamer.java:45)
    at chemaxon.marvin.io.formats.name.NameExport.convert(NameExport.java:66)
    at chemaxon.marvin.calculations.IUPACNamingPlugin.getName(IUPACNamingPlugin.java:227)
    at chemaxon.marvin.calculations.IUPACNamingPlugin.getPreferredIUPACName(IUPACNamingPlugin.java:191)
    at org.chemaster.Chemaster.main(Chemaster.java:41)
Java Result: 1


Additionally, I have installed all necessary licenses as to be able
to run Marvin Sketch and, indeed, when using the GUI everything goes
like clockwork.


Any suggestions?


ChemAxon e274e1bada

14-05-2012 12:09:07

Hui Chung,


You should set the license file for API usage with one of these methods:



chemaxon.license.LicenseManager.setLicenseFile(String path)
chemaxon.license.LicenseManager.setLicense(String s)


Please see the API doc: http://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/license/LicenseManager.html#setLicenseFile%28java.lang.String%29


Regards,
Edvard