nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
929 stars 280 forks source link

Unable to insert into AZURE SQL db and getting error mentioned below #4459

Open rajshah074 opened 3 years ago

rajshah074 commented 3 years ago

Method failed: HTTP/1.1 500 Internal Server Error com.mirth.connect.client.core.ClientException: Method failed: HTTP/1.1 500 Internal Server Error at com.mirth.connect.client.core.ServerConnection.handleResponse(ServerConnection.java:533) at com.mirth.connect.client.core.ServerConnection.handleResponse(ServerConnection.java:453) at com.mirth.connect.client.core.ServerConnection.executeAsync(ServerConnection.java:302) at com.mirth.connect.client.core.ServerConnection.apply(ServerConnection.java:168) at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255) at org.glassfish.jersey.client.JerseyInvocation$3.call(JerseyInvocation.java:722) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:718) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:459) at org.glassfish.jersey.client.proxy.WebResourceFactory.invoke(WebResourceFactory.java:379) at com.sun.proxy.$Proxy59.processMessage(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.mirth.connect.client.core.Client$2.invoke(Client.java:266) at com.sun.proxy.$Proxy59.processMessage(Unknown Source) at com.mirth.connect.client.core.Client.processMessage(Client.java:1717) at com.mirth.connect.client.ui.Frame$30.doInBackground(Frame.java:3703) at com.mirth.connect.client.ui.Frame$30.doInBackground(Frame.java:3699) at javax.swing.SwingWorker$1.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at javax.swing.SwingWorker.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

rajshah074 commented 3 years ago

Error on dashboard

at java.lang.Thread.run(Unknown Source)Caused by: com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLException: Invalid state, the Connection object is closed. at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.close(JdbcDao.java:2421) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:151) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:85) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:72) at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1215) ... 66 moreCaused by: java.sql.SQLException: Invalid state, the Connection object is closed. at net.sourceforge.jtds.jdbc.JtdsConnection.checkOpen(JtdsConnection.java:1744) at net.sourceforge.jtds.jdbc.JtdsConnection.rollback(JtdsConnection.java:2164) at com.zaxxer.hikari.pool.ProxyConnection.close(ProxyConnection.java:232) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.close(JdbcDao.java:2418)

rajshah074 commented 3 years ago

Same issue mentioned in below ticket

https://github.com/nextgenhealthcare/connect/issues/14

jonbartels commented 3 years ago

Looking at the other issue you should:

cturczynskyj commented 3 years ago

As @jonbartels said, there really is very little information here for us to go off of. We have issue templates for this reason and you really should follow the issue template, because it helps others gain context into your issue. We'll check into this when you have responded with some more information.

rajshah074 commented 3 years ago

1. Connection URL

jdbc:sqlserver://yourAzureSQLInstance.database.windows.net:1433;user=username@az-sqlmanagedinstance-dmuat;password=password;integratedSecurity=true;encrypt=false;trustServerCertificate=false;hostNameInCertificate=*.ec19f487cbba.database.windows.net;loginTimeout=30;

2. Connection URL

jdbc:sqlserver://yourAzureSQLInstance.database.windows.net:1433/DB;

image

New driver

<driver class="com.microsoft.sqlserver.jdbc.SQLServerDriver" name="SQL Azure" template="jdbc:sqlserver://host:port/dbname" selectLimit="SELECT TOP 1 * FROM ?" />

When I am using 1st connection string I am getting below error in mirth:

Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

rajshah074 commented 3 years ago

`Database Writer error ERROR MESSAGE: Failed to write to database com.mirth.connect.connectors.jdbc.DatabaseDispatcherException: Failed to write to database at com.mirth.connect.connectors.jdbc.DatabaseDispatcherQuery.send(DatabaseDispatcherQuery.java:133) at com.mirth.connect.connectors.jdbc.DatabaseDispatcher.send(DatabaseDispatcher.java:103) at com.mirth.connect.donkey.server.channel.DestinationConnector.handleSend(DestinationConnector.java:888) at com.mirth.connect.donkey.server.channel.DestinationConnector.process(DestinationConnector.java:518) at com.mirth.connect.donkey.server.channel.DestinationChain.doCall(DestinationChain.java:121) at com.mirth.connect.donkey.server.channel.DestinationChain.call(DestinationChain.java:63) at com.mirth.connect.donkey.server.channel.Channel.process(Channel.java:1759) at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1221) at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:192) at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage(DonkeyEngineController.java:1091) at com.mirth.connect.server.api.servlets.MessageServlet.processMessage(MessageServlet.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.mirth.connect.server.api.providers.MirthResourceInvocationHandlerProvider$1.invoke(MirthResourceInvocationHandlerProvider.java:219) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:864) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) at com.mirth.connect.server.MethodFilter.doFilter(MethodFilter.java:37) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at com.mirth.connect.server.api.providers.ClickjackingFilter.doFilter(ClickjackingFilter.java:44) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at com.mirth.connect.server.api.providers.ApiOriginFilter.doFilter(ApiOriginFilter.java:71) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:531) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:291) at org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:151) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:319) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:175) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:133) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:672) at java.lang.Thread.run(Unknown Source) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:18fee33a-7e0c-44b0-9729-75b65f25829c at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3208) at com.microsoft.sqlserver.jdbc.AuthenticationJNI.(AuthenticationJNI.java:72) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:4017) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:85) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:4006) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3274) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2768) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2418) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2265) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1291) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:881) at com.mirth.connect.connectors.jdbc.CustomDriver.connect(CustomDriver.java:153) at com.mirth.connect.connectors.jdbc.CustomDriver.connect(CustomDriver.java:148) at com.mirth.connect.connectors.jdbc.DatabaseDispatcherQuery$SimpleDataSource.getConnection(DatabaseDispatcherQuery.java:203) at com.mirth.connect.connectors.jdbc.DatabaseDispatcherQuery.send(DatabaseDispatcherQuery.java:106) ... 73 more Caused by: java.lang.UnsatisfiedLinkError: no mssql-jdbc_auth-9.2.0.x64 in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at com.microsoft.sqlserver.jdbc.AuthenticationJNI.(AuthenticationJNI.java:51) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:4016) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:85) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:4006) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3274) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2768) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2418) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2265) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1291) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:881) at com.mirth.connect.connectors.jdbc.CustomDriver.connect(CustomDriver.java:153) at com.mirth.connect.connectors.jdbc.CustomDriver.connect(CustomDriver.java:148) at com.mirth.connect.connectors.jdbc.DatabaseConnectorServlet.getTables(DatabaseConnectorServlet.java:89) ... 63 more

`

rajshah074 commented 3 years ago

Jars in custom-lib

image

cturczynskyj commented 3 years ago

Ok, it looks like you are trying to use a custom database driver for Microsoft SQL Server. In Connect 3.10.0 we added that driver to the core project. If possible, the easiest solution would be to upgrade to 3.10.0 and remove any of the custom database libraries you added.