problem with cxcalc(jchem 5)

User 247a2c5018

22-07-2008 14:28:12

In my php code (test.php) i have :


<?php


exec('/usr/local/src/jchem/bin/cxcalc -N hi /home/test/chimiothequedep/temp/1.mol logp -p 3',$allname,$vide);


echo $vide;





?>





I run it by a PHP web server and it returns 0 and logP is calcultated(with jchem 3)


But with jchem 5, it returns 1 and no logp is calculated





Why?

User 247a2c5018

23-07-2008 09:15:32

no idea?

ChemAxon e274e1bada

23-07-2008 10:02:07

Hi TRAN-MINH,





Probably it is a bug in license handling of our calculators. We are investigating the problem.





Could you run that cxcalc command from command line directly? You should send me the stack trace.


Which JChem version was where you experienced the error?





Regards, Edvard

User 247a2c5018

23-07-2008 11:43:24

from command line i have no problem


Which Jchem 3, I have no problem.


The problem come with jchem 5





how can I have the stack trace?

User 247a2c5018

23-07-2008 12:02:57

the only problem I have comes when I run cxcalc by a web server :








<?php


$toto=exec('/usr/local/src/jchem/bin/cxcalc -N hi /home/test/chimiothequedep/temp/1.mol logp -p 3',$allname,$vide);


echo $vide;


echo "le logP : ".$toto;


?>








This php code runs well with jchem 3 but not with Jchem 5 :





echo $vide returns 1 that's means the operation fails but where?








If I try with Jchem 3, the php code runs well and echo $vide returns 0 that's means the operation success

ChemAxon e274e1bada

23-07-2008 12:28:16

Hi TRAN-MINH,





Please check if your valid license file is in chemaxon (on windows) or .chemaxon (on linux) directory in the defined user's home directory who runs the php and web server.


Did you try to run cxcalc command from command line with JChem5 and it worked well?


Can you please help us with an exact JChem 5 version number?





Regards, Edvard

User 247a2c5018

23-07-2008 12:35:03

version : jchem_5_0_06_1


By command line with jchem_5_0_06_1, it works well





It's strange if i move jchem 5 in jchem 3 by web server, it works well.


I put the file license.cxl in the directory /var/www/.chemaxon (of apache)

ChemAxon e274e1bada

23-07-2008 12:55:49

Quote:
I put the file license.cxl in the directory /var/www/.chemaxon (of apache)
It is a wrong location. You have to take the license file to user's home directory whu runs the web server. (e.g. /home/apache/.chemaxon)


See the documentation: http://www.chemaxon.com/marvin/help/licensedoc/install.html





You can find the stack trace in the web server's log. That can help with this too.





Regards, Edvard

User 247a2c5018

23-07-2008 13:11:41

I have this error in apache log :





Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: chemaxon.marvin.Calculator


at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.Class.initializeClass() (/usr/lib64/libgcj.so.5.0.0)


at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)


at gnu.gcj.runtime.FirstThread.run() (/usr/lib64/libgcj.so.5.0.0)


at _Jv_ThreadRun(java.lang.Thread) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib64/libgcj.so.5.0.0)


at __gcj_personality_v0 (/home/test/chimiothequedep/java.version=1.4.2)


at __libc_start_main (/lib64/tls/libc-2.3.4.so)


at _Jv_RegisterClasses (/home/test/chimiothequedep/java.version=1.4.2)


Caused by: java.lang.ClassNotFoundException: edu.emory.mathcs.backport.java.util.concurrent.ExecutionException not found in [file:/usr/local/src/jchem/bin/../lib/jchem.jar, file:/usr/local/src/triplets/FuzzyTriplets/, file:/usr/local/src/jchem/lib/jchem.jar, file:/usr/local/src/jchem/lib/dom4j.jar, file:./, file:/usr/share/java/libgcj-3.4.6.jar, file:./, core:/]


at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.5.0.0)


at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_ClassReader.handleClassBegin(int, int, int) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_ClassReader.parse() (/usr/lib64/libgcj.so.5.0.0)


at _Jv_DefineClass(java.lang.Class, byte[], int, int) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib64/libgcj.so.5.0.0)


at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib64/libgcj.so.5.0.0)


at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.5.0.0)


at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib64/libgcj.so.5.0.0)


at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_PrepareClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)


at _Jv_WaitForState(java.lang.Class, int) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)


...8 more

User 247a2c5018

23-07-2008 14:56:32

I forget this error which appears :








/bin/bash: /root/.bashrc: Permission denied


Warning: -Xmx200M not understood. Ignoring.


Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: chemaxon.marvin.Calculator


at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)


at java.lang.Class.initializeClass() (/usr/lib64/libgcj.so.5.0.0)


....

ChemAxon e08c317633

23-07-2008 17:57:04

It seems the CLASSPATH is not set correctly for the user who runs the php and web server. I suggest you to uninstall the old version of JChem and then reinstall the new version with that user.





From the error message I can see that you use GCJ (GNU Compiler for the Java). JChem does not support GCJ. Please install a Sun distributed Java to be able to use JChem. Before you start installing JChem, check that Sun's Java is the default one. You can do it with the java -version command.





Zsolt

User 247a2c5018

24-07-2008 07:54:51

java -version


java version "1.6.0_07"


Java(TM) SE Runtime Environment (build 1.6.0_07-b06)


Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)











This java comes from Sun.








I don't understand why jchem use GCJ whereas the default java is sun's java?





I realized that you advice me but I have the same errors.


I don't understand why if I replace with Jchem 3 i have no more errors...

ChemAxon 7c2d26e5cf

24-07-2008 11:33:37

Which operating system do you use?

User 247a2c5018

24-07-2008 11:37:48

operating system :Redhat Linux Enterprise 4 for AMD64

ChemAxon 7c2d26e5cf

24-07-2008 12:29:16

Installed JChem application uses the default Java on Linux.


It means JChem applcation is launched by the java command.


Probably, your JChem applcation runs under another account where gcj is the default Java.

User 247a2c5018

24-07-2008 13:38:07

Ok It's true that my JChem application runs under another account where gcj is the default Java





I add :





$path=getenv('PATH');


putenv('PATH=/usr/local/src/jdk1.6.0_07/bin:'.$path);





And Jchem use java 1.6.0_07 of Sun








Thank you