molconvert XYZ export java.lang.NoClassDefFoundError

User 677b9c22ff

20-11-2008 03:14:52

Hi,


if I try this is Marvin 5.1.2 and 5.1.0 under WINXP 32 bit


JAVA version 1.6 and 1.5 I get the following error.


Molecule File Converter, version 5.1.2, (C) 1999-2008 ChemAxon Ltd.





Code:



Z:\>molconvert xyz MOL1.mol


Exception in thread "main" java.lang.NoClassDefFoundError: xyz


Caused by: java.lang.ClassNotFoundException: xyz


        at java.net.URLClassLoader$1.run(Unknown Source)


        at java.security.AccessController.doPrivileged(Native Method)


        at java.net.URLClassLoader.findClass(Unknown Source)


        at java.lang.ClassLoader.loadClass(Unknown Source)


        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)


        at java.lang.ClassLoader.loadClass(Unknown Source)


        at java.lang.ClassLoader.loadClassInternal(Unknown Source)


Z:\>








Z:\>molconvert smiles MOL1.mol


OC[C@@H]1O[C@@H](O[C@]2(CO)O[C@@H](CO)[C@H](O)[C@@H]2O)[C@@H](O)[C@@H](O)[C@H]1O


Z:\>








with smiles and SDF it works (not sure about PDB and others)





I reported that a while ago and Tamas said maybe its a class file error,


because of Marvin beans or different versions?





I actually found out that it is a problem related to the windows batch file.





Code:



Z:\>java -classpath %JCHEMHOME%\lib\jchem.jar chemaxon.formats.MolConverter xyz MOL1.mol


23





  O        1.55380        0.23450        0.67770


  C        0.23660        0.34830        0.14820


  C        0.16750        1.36580       -1.01670


  O        1.10930        0.95100       -2.03350


  C        1.09920        1.73340       -3.24840


  O       -0.12850        1.60220       -4.00470


  C       -0.58630        0.28820       -4.43140


  C       -2.03370        0.52910       -4.94800


  O       -2.86050        1.08360       -3.92920


  O       -0.68840       -0.62370       -3.32150


  C        0.12930       -1.78270       -3.53530


  C       -0.77810       -3.02240       -3.72660


  O       -1.62030       -3.21040       -2.59450


  C        1.05250       -1.49790       -4.74420


  O        2.34530       -1.07730       -4.31180


  C        0.29400       -0.40200       -5.51330


  O        1.14430        0.50070       -6.21730


  C        1.39570        3.22510       -2.92750


  O        1.29560        4.02490       -4.10520


  C        0.47070        3.77570       -1.80610


  O       -0.85940        3.96370       -2.29420


  C        0.47800        2.82710       -0.57540


  O       -0.45990        3.27710        0.40020





Z:\>molconvert smiles MOL1.mol


OC[C@@H]1O[C@@H](O[C@]2(CO)O[C@@H](CO)[C@H](O)[C@@H]2O)[C@@H](O)[C@@H](O)[C@H]1O


Z:\>











So calling the molconvert.bat under windows with option XYZ does


not work (all other options work) but calling it directly with


classpath information works. This was confirmed on two different systems


with 3 different settings. I also don't have any DOS ENV variables XYZ or


xyz. Actually the solution is to put "" around xyz "xyz". Talk about DOS ...








Code:



Z:\>molconvert "xyz" MOL1.mol


23





  O        1.55380        0.23450        0.67770


  C        0.23660        0.34830        0.14820


  C        0.16750        1.36580       -1.01670


  O        1.10930        0.95100       -2.03350


  C        1.09920        1.73340       -3.24840


  O       -0.12850        1.60220       -4.00470


  C       -0.58630        0.28820       -4.43140


  C       -2.03370        0.52910       -4.94800


  O       -2.86050        1.08360       -3.92920


  O       -0.68840       -0.62370       -3.32150


  C        0.12930       -1.78270       -3.53530


  C       -0.77810       -3.02240       -3.72660


  O       -1.62030       -3.21040       -2.59450


  C        1.05250       -1.49790       -4.74420


  O        2.34530       -1.07730       -4.31180


  C        0.29400       -0.40200       -5.51330


  O        1.14430        0.50070       -6.21730


  C        1.39570        3.22510       -2.92750


  O        1.29560        4.02490       -4.10520


  C        0.47070        3.77570       -1.80610


  O       -0.85940        3.96370       -2.29420


  C        0.47800        2.82710       -0.57540


  O       -0.45990        3.27710        0.40020


Z:\>








Cheers


Tobias

ChemAxon 7c2d26e5cf

23-11-2008 17:14:46

Hi Tobias,


Thanks for reporting this issue.


The problem is that the batch files does not parse properly command line parameters in this certain case. The batch files tries to evaluate "xyz" like a JVM parameter (that generally starts with X), instead of passing it to the application.


We will fix it. Until then I suggest the following workaround:


Take in comment the following part of the code (line 28-33) in molconvert.bat:


Code:
REM if -X LEQ %1 if %1 LSS -Y (


REM        set JVMPARAM=%JVMPARAM% %1


REM        set JVM_X_PARAM=%JVM_X_PARAM% %1


REM        SHIFT


REM        GOTO START_JVMPARAM


REM )

ChemAxon 7c2d26e5cf

23-11-2008 18:35:10

I've fixed it. The fixed batch files will be available in the next release.