"Address already in use" error when starting JChem

ChemAxon aa7c50abf8

03-12-2008 12:55:27

Quote:
I need to trouble shoot an error we are receiving when starting JChem Server for JChem Cartridge:





Code:
chemaxon@sparky:~> + /usr/lib/jvm/jre/bin/java -server -Xmx700m -Djava.util.logging.config.class=chemaxon.jchem.cartridge.util.LoggingConfigurator -Dchemaxon.jchem.cartridge.config.file=conf/jcart.properties -Djava.awt.headless=true -classpath ./../lib/jchem.jar:/opt/oracle/product/10.2/db_1/jdbc/lib/ojdbc14.jar: chemaxon.jchem.cartridge.rmi.impl.AdminImpl start





Address already in use





java.net.BindException: Address already in use


        at java.net.PlainSocketImpl.socketBind(Native Method)


        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)


        at java.net.ServerSocket.bind(ServerSocket.java:319)


        at java.net.ServerSocket.<init>(ServerSocket.java:185)


        at java.net.ServerSocket.<init>(ServerSocket.java:97)


        at chemaxon.jchem.cluster.NodeManager.run(NodeManager.java:66)


+ set +x
The error message indicates that the port at which JChem Server wants to listen is already taken by another process. You can find out which port it is by looking at jchem.server.port property in the conf/jcart.properties file. (The default value is 1099.)





If you are on linux (you appear to be at least on some kind of Unix base on your error report), you can find out the process which already uses the port by executing:





Code:
netstat -untap






. The port numbers (along with the IP address) are indicated in the fourth column ("Local Address"). The process ids of the owner processes are listed in the last column ("PID/Program name").





If the currently configured port is the default (1099) and you have already used it successfully, chances are that the process which already uses this port is a remnant JChem Server process. If this is the case, you simply kill it and that's it. If it is a different process (unlikely) you need configure JChem Server to use another, unused port before you'll be able to start it:





1. Set the jchem.server.port property in the conf/jcart.properties file to an unused port;


2. Tell the Oracle-resident part of JChem Cartridge to use that port by executing:


Code:



call jchem_core_pkg.set_master_property(null, 'rmi.server.1', '${jchem.server.host}:${jchem.server.port}');






where ${jchem.server.host} is the value of the jchem.server.host property in the conf/jcart.properties file and ${jchem.server.port} is the value of the jchem.server.port property in the conf/jcart.properties file.