Rest python examples

User 6d24b35814

31-10-2013 11:34:41

Update: I've printed out "detail" and I have this:-


{u'errorCode': 0, u'rootCause': u'java.lang.NoClassDefFoundError', u'errorMessage': u'Could not initialize class sun.awt.X11.XToolkit'}


 


I don't want to run anything through a display I just want the raw data (smiles etc) as everything I'm doing will be via commandline scripts, would it be possible to generate an example for this?


 


Many thanks


 


 


Hi


I've downloaded and deployed the .war file from webservices-6.1.0-b917.zip into my tomcat 7 install on linux.


I'm trying to learn how to use the web services from python using the sample db and examples in the docs before I start to try to query my own data.


I've modified the query_post.py example to run against my installation but the example is only partially working. The data being returned from Chebi is this:-


{u'cd_molweight': 286.3655, u'acc': 3, u'cd_id': 2, u'don': 2, u'logp': 3.4379631133333346}
Failed
{u'cd_molweight': 252.2647, u'acc': 3, u'cd_id': 5, u'don': 0, u'logp': 3.1798970889999993}
Failed
{u'cd_molweight': 122.1644, u'acc': 1, u'cd_id': 6, u'don': 1, u'logp': 1.7193174379999998}
Traceback (most recent call last):
  File "./query_post27.py", line 97, in <module>
    print("OK: "+detail["format"]["smiles"])
KeyError: 'format'


 


I've changed the include values in both the searchOptions and detailOptions to include "format" and "smiles", but the result is still the same - I'm just getting the property calculations how do I return the smiles?


Many thanks


Ceara

ChemAxon e07e2a364b

31-10-2013 12:06:17

Hi Ceara,


 


    do you use Oracle JVM?


 


Gabor

User 6d24b35814

31-10-2013 13:36:28

 


Hi Gabor


In my environment I'm using this jdk:-


jdk1.6.0_45


Kind regards


Ceara

ChemAxon e07e2a364b

31-10-2013 17:06:50

Hi Ceara,


 


   from "jdk1.6.0_45" string it is not clear for me whether your installation is a jdk or openjdk (openjdk is the default under linux). I will check this anyway and update you about the results.

User 6d24b35814

01-11-2013 08:35:36

Hi Gabor


it's a donwloaded & installed JDK not a default linux one.


Kind regards


Ceara

ChemAxon e07e2a364b

04-11-2013 08:29:54

Hi Ceara,


   For image generation we use Graphics library of Java which needs X11 even if we do not have any GUI. We recommend to install a xvfb ("fake X11"). In parallel we investigate this issue in details.


Please, let me know whether this workaround helps or not!


 


Gabor

ChemAxon e07e2a364b

05-11-2013 07:36:19

Hi Ceara,


 


   We cannot reproduce: on a plain Ubuntu 12.04.3 LTS server, tomcat 7.0.47 / oracle jdk 1.6.0_45. (we also removed all x11 libs by "sudo apt-get autoremove libx11-6").


 


Gabor

ChemAxon e07e2a364b

05-11-2013 08:02:49

Can you help us to reproduce by sending us further config information by e-mail? 


Startup message of the tomcat may be valuable (JAVA_HOME), installed packages and linux version. Have you modified the query parameter payload in the example?


 


Gabor

User 91cde481fb

23-04-2015 10:21:09

For image generation we use Graphics library of Java which needs X11 even if we do not have any GUI. We recommend to install a xvfb ("fake X11"). In parallel we investigate this issue in details.


________________________


asad