web stats
Mirth Community - View Single Post - Getting "Could not retrieve database metadata" for Oracle DB Writer/Reader
View Single Post
  #1  
Old 08-27-2012, 10:14 AM
wblumstengel wblumstengel is offline
What's HL7?
 
Join Date: Aug 2012
Location: Victoria BC
Posts: 2
wblumstengel is on a distinguished road
Default Getting "Could not retrieve database metadata" for Oracle DB Writer/Reader

I have the following configuration:

Mirth Connect Server:
Server Name: icapp002
Server OS: Linux CentOS release 5.7 (Final) - 32bit (i686)
Mirth Software: 2.2.1.5861

Mirth Connect Backend Database:
Server Name: icweb002
Server OS: Linux CentOS release 5.7 (Final) - 64bit (x86_64)
Oracle Database Software: Oracle 11gR2 (11.2.0.3.0)
Mirth Connect Schema: MIRTHDB

I have successfully migrated the Mirth Connect Backend DB to an Oracle DB which resides on a different server from the Mirth Connect Server software. (i.e Mirth is no longer using the default Java Derby DB).

I am now trying to configure a new Channel, and am having problems when attempting to setup a Database Writer or Database Reader pointing to an Oracle DB (11.2.0.3.0).

For purposes of this discussion, I will refer to the Database Reader, but I have the same problem with the Database Writer.

Scenario 1

I attempt to connect to the Mirth Connect Backend Database Schema "MIRTHDB". This test is used to confirm that the Database Reader will connect to an Oracle DB. However, this is not the DB that I want to read from.

Driver: Oracle
URL: jdbcracle:thin:@icweb002:1551:icdvb1
Username: MIRTHDB
Password: *******
Use Javascript: NO

When I click on SELECT to generate my SQL, and then click on GET TABLES to present the list of available tables, the connection is SUCCESSFUL and I am presented with a list of tables and their columns.

Scenario 2

I created a new DB user called TESTDB in the same database as the MIRTHDB schema. The TESTDB user has same configuration as the MIRTHDB user, with the same privileges. DB ROLES assigned include:

CONNECT
RESOURCE
SELECT_CATALOG_ROLE

The Database Reader connection parameters are:

Driver: Oracle
URL: jdbcracle:thin:@icweb002:1551:icdvb1
Username: TESTDB
Password: *******
Use Javascript: NO

When I click on SELECT to generate my SQL, and then click on GET TABLES to present the list of available tables, the connection is SUCCESSFUL and I am presented with a list of tables and their columns.

Scenario 3

I created a new DB user called TESTDB in a DIFFERENT database on a DIFFERENT server from the MIRTHDB user. The TESTDB user has same configuration as the original MIRTHDB user, with the same privileges. DB ROLES assigned include:

CONNECT
RESOURCE
SELECT_CATALOG_ROLE

The Database Reader connection parameters are:

Driver: Oracle
URL: jdbcracle:thin:@icweb001:1551:icdvb1
Username: TESTDB
Password: *******
Use Javascript: NO

I have confirmed that the URL is correct and is accessible from other tools (e.g. Oracle SQL Developer) using that syntax.

When I click on SELECT to generate my SQL, and then click on GET TABLES to present the list of available tables, I am presented with the error:

Could not retrieve database metadata. Please ensure that your driver, URL, username, and password are correct.

The server log shows the following error:

[2012-08-27 11:36:15,858] ERROR (com.mirth.connect.server.servlets.ExtensionServle t:165): java.lang.Exception: Could not retrieve database tables and columns.
at com.mirth.connect.connectors.jdbc.JdbcConnectorSer vice.invoke(JdbcConnectorService.java:183)
at com.mirth.connect.server.controllers.DefaultExtens ionController.invokeConnectorService(DefaultExtens ionController.java:397)
at com.mirth.connect.server.servlets.ExtensionServlet .doPost(ExtensionServlet.java:141)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:547)
at org.eclipse.jetty.servlet.ServletHandler.doHandle( ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.do Handle(SessionHandler.java:225)
at org.eclipse.jetty.server.handler.ContextHandler.do Handle(ContextHandler.java:941)
at org.eclipse.jetty.servlet.ServletHandler.doScope(S ervletHandler.java:409)
at org.eclipse.jetty.server.session.SessionHandler.do Scope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.do Scope(ContextHandler.java:875)
at org.eclipse.jetty.server.handler.ScopedHandler.han dle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerList.handl e(HandlerList.java:47)
at org.eclipse.jetty.server.handler.HandlerWrapper.ha ndle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java :349)
at org.eclipse.jetty.server.HttpConnection.handleRequ est(HttpConnection.java:441)
at org.eclipse.jetty.server.HttpConnection$RequestHan dler.content(HttpConnection.java:936)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpPa rser.java:801)
at org.eclipse.jetty.http.HttpParser.parseAvailable(H ttpParser.java:224)
at org.eclipse.jetty.server.AsyncHttpConnection.handl e(AsyncHttpConnection.java:51)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.han dle(SelectChannelEndPoint.java:586)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.r un(SelectChannelEndPoint.java:44)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run Job(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.r un(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:419)
at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:536)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:228)
at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:521)
at java.sql.DriverManager.getConnection(DriverManager .java:582)
at java.sql.DriverManager.getConnection(DriverManager .java:185)
at com.mirth.connect.connectors.jdbc.JdbcConnectorSer vice.invoke(JdbcConnectorService.java:56)
... 25 more
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:375)
at oracle.net.resolver.AddrResolution.resolveAndExecu te(AddrResolution.java:422)
at oracle.net.ns.NSProtocol.establishConnection(NSPro tocol.java:678)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:2 38)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnec tion.java:1054)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:308)
... 32 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:529)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.ja va:209)
at oracle.net.nt.ConnOption.connect(ConnOption.java:1 23)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:353)
... 37 more

Scenario 4

I attempt to connect to my target schema (TARGETDB), which happens to reside in the same database as the MIRTHDB schema. The TARGETDB schema has the same basic privileges as the MIRTHDB and TESTDB users, plus some additional privileges. DB ROLES assigned include, but are not limited to:

CONNECT
RESOURCE
SELECT_CATALOG_ROLE

The Database Reader connection parameters are:

Driver: Oracle
URL: jdbcracle:thin:@icweb002:1551:icdvb1
Username: TARGETDB
Password: *******
Use Javascript: NO

When I click on SELECT to generate my SQL, and then click on GET TABLES to present the list of available tables, I am presented with the same errors as Scenario 3:

Could not retrieve database metadata. Please ensure that your driver, URL, username, and password are correct.

I do not understand why Mirth won't connect to these other schema's. Any ideas???

Wayne
Reply With Quote