Getting Started with Web Services

User c91b2283c1

17-02-2010 16:25:30

Hello,


I currently have a JChem MySQL database set up and would like to get JChem web services connected to it.


I seem to be unable, however, to get the web service to run. I am using this guide: https://www.chemaxon.com/webservices/adminGuide.html


Here is the command I am using:


jderiksen@dev /home/jchem/ChemAxon/JChemWebServices/bin $ ./startup.sh
Using CATALINA_BASE:   ../tomcat
Using CATALINA_HOME:   ../tomcat
Using CATALINA_TMPDIR: ../tomcat/temp
Using JRE_HOME:       /usr/jdk/jdk1.5.0_15


When I look at my process list using ps aux I am unable to find any java, tomcat, or catalina processes running. Attached is my process list.


When I visit the path to the development server on my LAN (http://dev:8180/axis2/, I get a 404 error.


When I try to call the shutdown.sh script, I get an error that might indicate that Tomcat was never properly initialized at all.


jderiksen@dev /home/jchem/ChemAxon/JChemWebServices/bin $ ./shutdown.sh


Using CATALINA_BASE:   /home/jchem/ChemAxon/JChemWebServices/tomcat
Using CATALINA_HOME:   /home/jchem/ChemAxon/JChemWebServices/tomcat
Using CATALINA_TMPDIR: /home/jchem/ChemAxon/JChemWebServices/tomcat/temp
Using JRE_HOME:       /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
Feb 17, 2010 11:22:02 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:520)
        at java.net.Socket.connect(Socket.java:470)
        at java.net.Socket.<init>(Socket.java:367)
        at java.net.Socket.<init>(Socket.java:180)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:421)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)


What could be the problem?


Thanks,


-John David

User c91b2283c1

17-02-2010 16:41:27

 


OK, I found a couple problems in /bin/startup.sh


JAVA_HOME was set to a value that didn't actually correspond to the actual location of my Java install. You might want to update your documentation to reflect that this value may have to be changed.



Also, when I run /bin/startup.sh, visiting http://dev:8180/axis2/ does not seem to pull up the Axis 2 interface.


However, when I run /tomcat/bin/startup.sh directly, Axis 2 *does* appear.


Further, a tomcat/java/catalina process finally does start appearing in my process list:


1000     11445 75.0  7.7 971548 158792 pts/1   Sl   11:38   0:15 /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/bin/java -Djava.util.logging.manager=org.apache.juli.Cla
ssLoaderLogManager -Djava.util.logging.config.file=/home/jchem/ChemAxon/JChemWebServices/tomcat/conf/logging.properties -Djava.endorsed.dirs=/home/jchem/ChemA
xon/JChemWebServices/tomcat/endorsed -classpath :/home/jchem/ChemAxon/JChemWebServices/tomcat/bin/bootstrap.jar -Dcatalina.base=/home/jchem/ChemAxon/JChemWebS
ervices/tomcat -Dcatalina.home=/home/jchem/ChemAxon/JChemWebServices/tomcat -Djava.io.tmpdir=/home/jchem/ChemAxon/JChemWebServices/tomcat/temp org.apache.cata
lina.startup.Bootstrap start


Also, /bin/shutdown.sh does appear to work correctly now.


My question: Should I bypass using /bin/startup.sh and use /tomcat/bin/startup.sh? If so, how would you recommend that I modify the heap size used by the Tomcat process?


Thanks for your help,


-John David

ChemAxon e274e1bada

19-02-2010 12:03:34

Hi John,


thank you for the report, we will change the startup.sh, it should not define the JAVA_HOME environment variable.


Yes, you can use tomcat/bin/startup.sh to start the server, in this case you can define the heap size in this script.
Even so, the JChemWebServices/bin/startup.sh should be working well if you remove the JAVA_HOME definition and export lines.


Regards, Edvard

User c91b2283c1

19-02-2010 15:22:33

Hi Edvard,


I thought about this more carefully, and I think the reason JAVA_HOME was defined in /bin/startup.sh is because this script might need to be called in a boot-time script during which JAVA_HOME may not have been defined since during boot time a user will not have logged in and have set the JAVA_HOME environment variable.


In the documentation it would be sufficient to mention that the /bin/startup.sh JAVA_HOME variable needs to be set by the user in order to get this script to work.


-John David

ChemAxon e274e1bada

22-02-2010 14:13:38

Ok, we will keep it in the script and improve the related part of the documentation.


Thanks, Edvard

ChemAxon e274e1bada

26-02-2010 08:47:13

We modified the startup script and the Admin guide, it released with the 5.3.1


Regards, Edvard

User c91b2283c1

26-02-2010 15:25:49

Great, thanks :]