AJAX interface in the Cross platform package

User f52820d97e

17-03-2009 16:49:20

Hi,





I tried the ChemAxon Web Services Server package on a windows test machine successfully (except for these issues)


But I use the Cross platform package without installer on a Linux workstation, running tomcat + apache + a tomcat/apache connector. I cannot run the jchem/examples/ajax examples because it seems to me that the config.xml file asks for a soapPath that is not there (axis2). Is it an incompatible solution or is it safe to copy the axis2 folder from one distribution to the other?


Cheers,


Nicolas

ChemAxon ebbce65bcf

18-03-2009 10:25:22

Hi,





soapPath parameters define the url of the webservices. For example: http://localhost:8180/axis2/services/JChemSearchWS . It is not a real directory under the webroot but a virtual path, so I don't think you should copy any of your directories. If there is no domain and port (e.g. /axis2/services/JChemSearchWS) it means that Ajax interface will use the same domain and same port where the Ajax application is downloaded from. You can check your webservice path with your browser. For instance if you have a web service configured on localhost:8180 you get the available web services after typing http://localhost:8180/axis2/services/listServices in your browser's address bar. You have a working version on Windows, so you can try these, so maybe it will be easier to find out why the other version is not working. Let me know if you need more help, please.





Roland

User f52820d97e

18-03-2009 13:20:44

Hi Roland,





I will try to be as clear as I can, bear in mind I am not a fully developped computer guru.





I wanted to try the jchem/examples/ajax pages that are in the cross-platform zip file (I have been using the jchem/examples/db_search JSP pages for a while now) on my tomcat server.





I figured I had to change the to ../../marvin and also the to begin by ./jsp and not /jsp. Before doing that I had some sort of wheel turning indefinitely.





But I was not sure of the . Since the axis2 folder present in the ChemAxonWebServices/tomcat/webapps you provide seemed to be well declared, I just copied it in my tomcat webapps folder. I can now see the [httpserver]/axis2/services/listServices in my brower.





It seems to connect correctly because I can see the tables in the upper right corner, but I have this message popping up: "Invalid Standardizer Configuration". Now I am stuck...





Thank you for your help,





Nicolas

User f52820d97e

18-03-2009 16:48:50

Actually, upon clean updating with 5.2.0 on the tomcat server, I have the same message on the JSP pages


Quote:
JChem version : 5.2.0


JVM : Sun Microsystems Inc. 1.6.0_03


OS : i386 Linux 2.6.9-55.ELsmp








Stack trace:


------------








chemaxon.jchem.db.DatabaseSearchException: Invalid standardizer configuration


at chemaxon.jchem.db.JChemSearch.initTable(JChemSearch.java:2690)


at chemaxon.jchem.db.JChemSearch.init(JChemSearch.java:3396)


at chemaxon.jchem.db.JChemSearch.search1(JChemSearch.java:2221)


at chemaxon.jchem.db.JChemSearch.search(JChemSearch.java:2121)


at chemaxon.jchem.db.JChemSearch.access$1900(JChemSearch.java:112)


at chemaxon.jchem.db.JChemSearch$SearchThread.run(JChemSearch.java:504)

User f52820d97e

18-03-2009 17:21:15

I could reproduce the error, it has nothing to do with the new version.





When I try to connect to jchem/examples/ajax by leaving








Code:
<marvinPath>/marvin</marvinPath>









intact in the config.xml file, I cannot see the molecules in the marvin applet.





If I change it to ../../marvin (like in the jsp pages, the marvin applet is there... I have this "Invalid Standardizer Configuration" error, which in turns messes up the JSP pages at jchem/examples/db_search/!

ChemAxon e274e1bada

19-03-2009 23:54:45

Hi Nicolas,





The Ajax example can work with the Chemaxon Web Services server. Try to unzip it on your linux, and start the server. It will be accessible on HTTP port 8180 by default. If you set the JchemWebservices service path in the service path of config.xml, the ajax example should be working in the examples directory of the crossplatform distribution.


Note, in this case you can use the Ajax example in the ChemaxonWebservices package as well.





Regards, Edvard

User f52820d97e

20-03-2009 13:53:47

Quote:



The Ajax example can work with the Chemaxon


Web Services server. Try to unzip it on your linux, and start the


server. It will be accessible on HTTP port 8180 by default.






Yes, it works, but I don't want to use this standalone server. I have already a tomcat + apache server configured, with the mod_jk connector that prevents the famous 8080 port to appear (or whatever port chosen)





Quote:
If you set the JchemWebservices service path in


the service path of config.xml, the ajax example should be working in


the examples directory of the crossplatform distribution.






That's the thing - it doesn't work in the cross platform distribution. Although I don't know how to set the JChemWebservices. Here are my step to use the zip distrib into tomcat:
  • unzip into tomcat/webapps
  • create a WEB-INF folder with a generic web.xml description file
  • copy all the files in jchem/lib into tomcat/shared/lib
  • point to /jchem/examples/db_search in the browser
That's it! But if point to /jchem/examples/ajax, it does not work.





Quote:
Note, in this case you can use the Ajax example in the ChemaxonWebservices package as well.








I don't know how to incorporate it, though... I tried copying the axis2 folder into tomcat/webapps, the page does load but with no marvin applet, and then I have this Invalid Standardizer Configuration error.





I hope I am clear!








Cheers,





Nicolas


ChemAxon e274e1bada

24-03-2009 23:31:48

Hi,
Quote:
That's the thing - it doesn't work in the cross platform distribution. Although I don't know how to set the JChemWebservices. Here are my step to use the zip distrib into tomcat:





* unzip into tomcat/webapps


* create a WEB-INF folder with a generic web.xml description file


* copy all the files in jchem/lib into tomcat/shared/lib


* point to /jchem/examples/db_search in the browser





That's it! But if point to /jchem/examples/ajax, it does not work.
We have built the webservice integration package as a blackbox, so I don't recommend to use it outside the package. Even so this way should work


  • download an axis2.war file from Apache site: http://ws.apache.org/axis2/download.cgi
  • deploy this war with the Tomcat manager
  • copy the tomcat/webapps/axis2/WEB-INF/services/JChemWebservices.aar from ChemAxonWebservices package to same directory of your new Axis2 webapp
  • copy database drivers from tomcat/webapps/axis2/WEB-INF/lib to the same directory of your new Axis2 webapp
  • create a new webapp for Ajax example (maybe the ROOT is the most appropriate place, because you cannot create and set a new webapp in this way)
  • copy the tomcat/webapps/ROOT/ajax and marvin to your new webapp.
  • Copy the jar files from tomcat/webapps/ROOT/WEB-INF/lib to your webapp.
  • Set config.xml in the ajax directory
  • You can access the ajax example with simikar URL: http://www.mysite.com:8080/ajax
Cheers, Edvard

User f52820d97e

27-03-2009 17:26:16

Hi Edvard, and sorry for my unconventional approach.
Quote:
  • download an axis2.war file from Apache site: http://ws.apache.org/axis2/download.cgi
  • deploy this war with the Tomcat manager
  • copy the tomcat/webapps/axis2/WEB-INF/services JChemWebservices.aar from ChemAxonWebservices package to same directory of your new Axis2 webapp
  • copy database drivers from tomcat/webapps/axis2/WEB-INF/lib to the same directory of your new Axis2 webapp
No problem with that, axis2 is deployed and I can see the JChem services
Quote:
  • create a new webapp for Ajax example (maybe the ROOT is the most appropriate place, because you cannot create and set a new webapp in this way)
  • copy the tomcat/webapps/ROOT/ajax and marvin to your new webapp.
  • Copy the jar files from tomcat/webapps/ROOT/WEB-INF/lib to your webapp.
Not sure about that...





- I tried to copy the two folders ajax and marvin from ChemAxonWebServices directly in /webapps/ROOT, along with the webapps/WEB-INF/lib/MarvinBeans.jar and dom4j.jar, but it didn't work. I got this
Quote:
The requested URL /ajax was not found on this server.
- I tried a webapp called TEST with a WEB-INF/web.xml description file, a WEB-INF/lib folder with dom4j.jar and MarvinBeans.jar from the ChemAxonWebservices packages and the two folders ajax and marvin in there, but I got a
Quote:
Invalid standardizer configuration
message, which propagates in the JSP example with the Stack Trace
Quote:
chemaxon.jchem.db.DatabaseSearchException: Invalid standardizer configuration


at chemaxon.jchem.db.JChemSearch.initTable(JChemSearch.java:2690)


at chemaxon.jchem.db.JChemSearch.init(JChemSearch.java:3396)


at chemaxon.jchem.db.JChemSearch.search1(JChemSearch.java:2221)


at chemaxon.jchem.db.JChemSearch.search(JChemSearch.java:2121)


at chemaxon.jchem.db.JChemSearch.access$1900(JChemSearch.java:112)


at chemaxon.jchem.db.JChemSearch$SearchThread.run(JChemSearch.java:504)


- If I put the ajax and marvin folders separately in the webapps folder (along with only a WEB-INF/web.xml, respectively), same thing





- If I add the MarvinBeans.jar (with or without the dom4j.jar) in webapps/ROOT/WEB-INF/lib/ the ajax example works (even the query form with the msketch applet), except I don't see the Marvin Applet for displaying the structures! And sometimes, depending how often or how quickly I stop/restart the apache + apache tomcat servers, I get the invalid standardization error.





- I also tried the marvin folder in the ROOT folder, and a separate ajax in the webapps.





Now I am at a loss...


Cheers,


Nicolas

ChemAxon e274e1bada

01-04-2009 15:36:04

Hi Nicolas,


I'm trying to reproduce your situation, and find out a solution for you.





Cheers, Edvard

User f52820d97e

02-04-2009 07:56:36

Great, Thanks Edvard!

User f52820d97e

13-08-2009 13:52:34

The answer is in a different post for the integration in tomcat only


To connect with the apache server on port 80 (default) with the mod_proxy connector


- configure apache(2.2 for me) with the --enable-proxy --enable-proxy-ajp options and compile it


- in the apache/conf/httpd.conf file, uncomment the Include conf/extra/httpd-vhosts.conf line and verify that the proxy_module and proxy_ajp_module are present


- in the apache/conf/extra/httpd-vhosts.conf file, add these lines:


        <VirtualHost *:80>
            ProxyRequests Off
            ProxyPreserveHost On
       
            <Proxy *>
                Order deny,allow
                Allow from all
            </Proxy>
           
            ProxyPass /ajax ajp://localhost:8109/ajax
            ProxyPassReverse /ajax ajp://localhost:8109/ajax
            ProxyPass /axis2 ajp://localhost:8109/axis2
            ProxyPassReverse /axis2 ajp://localhost:8109/axis2

            ErrorLog "logs/tomcat_error_log"
            CustomLog "logs/tomcat_access_log" common
        </VirtualHost>


- in the tomcat/conf/server.xml file, change the following lines


<Server port="8105" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Connector port="8180" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8543" />
    <Connector port="8109" protocol="AJP/1.3" redirectPort="8143" />
  </Service>
</Server>

so that the ports are in accord, and it should work!