Could not establish connection

User 46924c5277

18-06-2012 16:57:59

 


Hi,


One of our sites recently did some kind of update to Oracle and are now having problems getting JChem to do anything; we're not even able to use jchem_core_pkg.use_password().


The jcart1.log file contains this:


[main/10]: Jun 18, 2012 10:03:29 AM
chemaxon.jchem.cartridge.rmi.impl.AdminImpl setStructureCacheId


INFO: Cache id set to JCC1


[main/10]: Jun 18, 2012 10:03:29 AM
chemaxon.jchem.cartridge.rmi.impl.AdminImpl loadLicenses


INFO: Directory licenses does not exist. Leaving it to
LicenseHandler to check the default location for licenses.


[main/10]: Jun 18, 2012 10:03:29 AM
chemaxon.jchem.cartridge.rmi.impl.AdminImpl startServer


INFO: Listening at 1099


[RMI TCP Connection(1)-127.0.0.1/11]: Jun 18, 2012 10:04:40
AM chemaxon.jchem.cartridge.rmi.impl.RmiExceptionHandler handleError


SEVERE: error


java.sql.SQLException: Problem connecting to the
followingJDBC URL: jdbc:oracle:thin:@localhost:1521:chemprod: The Network
Adapter could not establish the connection. Please, check the JDBC connection
properties of the JChem Server.


               
at
chemaxon.jchem.cartridge.servlets.JCartConnectionManager.createConnectionByDriverManager(JCartConnectionManager.java:345)


               
at chemaxon.jchem.cartridge.servlets.JCartConnectionManager.validateCredentials(JCartConnectionManager.java:157)


               
at
chemaxon.jchem.cartridge.servlets.JCartConnectionManager.getConnectionUc(JCartConnectionManager.java:127)


               
at chemaxon.jchem.cartridge.servlets.JCartConnectionManager.changeUserInfo(JCartConnectionManager.java:499)


               
at
chemaxon.jchem.cartridge.rmi.impl.RmiTunnelImpl.setUserInfo(RmiTunnelImpl.java:130)


               
at chemaxon.jchem.cartridge.rmi.impl.RmiTunnelImpl.processUc(RmiTunnelImpl.java:66)


               
at
chemaxon.jchem.cartridge.rmi.impl.RmiTunnelImpl.process(RmiTunnelImpl.java:53)


               
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


               
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)


               
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


               
at java.lang.reflect.Method.invoke(Method.java:616)


               
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)


               
at sun.rmi.transport.Transport$1.run(Transport.java:177)


               
at java.security.AccessController.doPrivileged(Native Method)


               
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)


               
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)


               
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)


               
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)


               
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)


               
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)


               
at java.lang.Thread.run(Thread.java:679)


This was working fine two weeks ago; is there a known issue with the latest version of Oracle 11?


 

ChemAxon aa7c50abf8

18-06-2012 22:13:44

Hi,


Are you able to connect to the Oracle instance by executing the following command on the host where the JChem Cartridge server is running :


sqlplus "\"//localhost:1521/chemprod\""

?


Peter

User 46924c5277

19-06-2012 15:02:50

Hi Peter,


No I'm not.  That command doesn't seem to resolve (as in,I just get > prompts after entering it).  This is a Linux host, if that matters.


After some additional testing, it looks like the listener does not appear to be running on localhost/127.0.0.1, just on the machine's actual IP address.  Ideally I'd like to have it listening on all interfaces; is there any easy way to configure this?


Thanks,


Bob

ChemAxon aa7c50abf8

19-06-2012 15:32:51

Hi Bob,


The easest way is to


1. change the value of the oracle.server.host property in jchem/cartridge/conf/jcart.properties to the IP address of the Oracle listener (restarting the JChem Cartridge server is needed)


2. change the value of rmi.server.1 in the jc_idx_property table in the JChem Cartridge owner's schema (JCHEM?) to <listener-ip>:1521 (don't forget to commit) -- where <listener-ip> is the IP address of the Oracle listener.


Let me know if this doesn't help.


Peter

User 46924c5277

19-06-2012 16:44:06

Thanks, Peter.  I'm now getting a different error:


 



I changed the oracle.server.host
property in the jchem/cartridge/jcart.properties file to:


hostname: grep oracle
jcart.properties


oracle.home=/oracle/app/oracle/product/11.2.0.3/dbhome_1


oracle.server.host=128.112.130.118


oracle.server.port=1521


oracle.server.instance=chemprod


I also modified the
jc_idx_property table.  The port there is the 1099 port not the 1521
Oracle listener port.


When I excute the call
jchem_core_pkg.use_password('password'); for jchem I get the
following:


hostname: cat
/jchem/logs/set_password.log


 SQL*Plus: Release 11.2.0.3.0
Production on Tue Jun 19 12:13:42 2012


 Copyright (c) 1982, 2011,
Oracle.  All rights reserved.


 SQL> SQL> Connected.


SQL> call
jchem_core_pkg.use_password('password')


     *


ERROR at line 1:


ORA-29532: Java call terminated
by uncaught Java exception:


java.rmi.ServerException:
RemoteException occurred in server thread; nested


exception is:


java.rmi.RemoteException:
Inconsistent oracle.server.host setting for


JChemServer: 128.112.130.118
resolves to /128.112.130.118, but client oracle


server is hosted on 127.0.0.1
(which resolves to /127.0.0.1)


ORA-06512: at
"JCHEM.JCHEM_CORE_PKG", line 58


ORA-06512: at
"JCHEM.JCHEM_CORE_PKG", line 55


ChemAxon aa7c50abf8

19-06-2012 17:17:07

Thank you, Bob.


Does setting that property in the table to 127.0.0.1:1099 help?


Peter

User 46924c5277

19-06-2012 17:45:19

No; it was localhost:1099 to start with.  If I try changing it to 127.0.0.1:1099, then I get



SQL*Plus: Release 11.2.0.3.0
Production on Tue Jun 19 13:36:12 2012
 


Copyright (c) 1982, 2011,
Oracle.  All rights reserved.


SQL> SQL> Connected.


SQL> call jchem_core_pkg.use_password('password')


     *


ERROR at line 1:


ORA-29532: Java call terminated
by uncaught Java exception:


java.rmi.ServerException:
RemoteException occurred in server thread; nested


exception is:


java.rmi.RemoteException:
Problem connecting to the followingJDBC URL:


jdbc:oracle:thin:@127.0.0.1:1521:chemprod:
The Network Adapter could not


establish the connection.
Please, check the JDBC connection properties of the


JChem Server.


ORA-06512: at
"JCHEM.JCHEM_CORE_PKG", line 58


ORA-06512: at "JCHEM.JCHEM_CORE_PKG",
line 55


 


Which is basically the same problem I had before: the listener is not listening on the localhost port.


ChemAxon aa7c50abf8

19-06-2012 19:00:16

Hi Bob,


What about this:


1. change the value of the oracle.server.host property in jchem/cartridge/conf/jcart.properties to the IP address of the Oracle listener (restarting the JChem Cartridge server is needed)



2. change the value of rmi.server.1 in the jc_idx_property table in the JChem Cartridge owner's schema (JCHEM?) to 127.0.0.1:1099 (don't forget to commit).


Does this make any difference?


Peter


User 46924c5277

20-06-2012 15:59:28

No, that's the first thing we tried.


However, the problem is resolved now.  Someone on the DBA team added IP=FIRST to the listener.ora file, causing it to stop listening on the loopback/localhost address, but apparently didn't actually restart the listener and make it reread the file until they installed a listener security patch last week.  Since this wasn't part of the recent change, they didn't mention it when we asked what they had changed recently.


TL;DR:


Don't put IP=FIRST in your listener.ora file.

ChemAxon aa7c50abf8

20-06-2012 17:00:17

Bob,


I am glad that this has been sorted out.


And many thanks for this valuable bit of advice.


Peter