REST on WS2012 and MySQL connection error

User 773d472e7f

09-04-2014 15:10:45

Dear Chemaxon:


I have installed the  REST web services with the view of replacing the SOAP web services.


The server is


WS2012 | MySQL | JChem 6.2.1 | Webservices 


I installed the webservices using the windows installer:: webservices-6.2.0-b7-x64.msi


 


http://akoscompounds.de:8080/webservices/rest-v0/data


[{"name":"AkosSamples","type":"JCHEM","propertyTable":"JChemProperties","url":"jdbc:mysql://localhost:3306/akos_samples"}]


however there is a connection problem


http://akoscompounds.de:8080/webservices/rest-v0/data/AkosSamples


{"errorCode":1,"errorMessage":"Connections could not be acquired from the underlying database!","rootCause":"SQLException","rootErrorMessage":"A ResourcePool could not acquire a resource from its primary factory or source."}



Please advise how I should problem solve this.



Many thanks



Bernard





 

ChemAxon 13811e1703

09-04-2014 20:46:55

Hi Bernard,

This error message is caused by unreachable database. Please make sure the database is visible form the server where the JChem Web Services is deployed, in your case this should be the same machine: jdbc:mysql://localhost:3306/akos_samples 



Regards,
Peter 

User 773d472e7f

10-04-2014 07:14:32

Hi Peter,


Thanks for your reply : the database is visible using this url from JCHEM command line and SOAP webservices when I use the this url/driver (see below) This error message occurs with localhost also...


the ws-config.xml file contains:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ch:configs xmlns:ch="http://generated.ws2common.jchem.chemaxon">

    <config name="AKOS" type="JCHEM">

        <url>jdbc:derby:$chemaxon_db_dir$</url>

        <driver>jdbc:mysql://localhost:3306/akos_samples</driver>

        <userName>akossamples</userName>

        <password>**********</password>

        <propertyTable>JChemProperties</propertyTable>

        <metaDataTable>JCHEMMETADATATABLE</metaDataTable>

    </config>

    <config name="sample" type="JCHEM">

        <url>jdbc:derby:$chemaxon_db_dir$</url>

        <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>

        <userName></userName>

        <password></password>

        <propertyTable>JChemProperties</propertyTable>

        <metaDataTable>JCHEMMETADATATABLE</metaDataTable>

    </config>

</ch:configs>

When I use the above url/driver for JCHEM command line and SOAP web services this does indeed work.


What/How should I check the database viability?


Thanks,


Bernard

User 773d472e7f

10-04-2014 07:26:49

Hi Peter,


Please note there is an error in the ws-config.xml driver specification in my previous email.


I will correct this to be:


com.mysql.jdbc.Driver

and see if this is the reason.


regards


Bernard

User 773d472e7f

10-04-2014 07:36:16

Hi Peter,


I have made this correction and get same error message. The xml file I am working with is located at:


C:\Program Files\ChemAxon\Webservices\webapps\webservices\WEB-INF\classes\ws-config.xml

Is this perhaps the wrong config file that I am working with ?


Do I have to do more that restart the service ? 


Thanks,


Bernard

ChemAxon 13811e1703

10-04-2014 07:46:03

Hi,

The config that is used by the service is located in the user's home directory:

%HOMEPATH%\chemaxon\ws-config.xml

After modification the service should be restarted.


Peter 

User 773d472e7f

10-04-2014 08:27:27

Hi Peter,


OK thanks this is now solved.


I was very confused about the location of the %HOMEPATH%


regards,


Bernard