Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Channel Destination database Writer fails to connect SQL server (http://www.mirthcorp.com/community/forums/showthread.php?t=219254)

mbilala78 07-09-2019 06:18 AM

Channel Destination database Writer fails to connect SQL server
 
Hi,

I am new to Mirth Connect and using version 3.8 on windows 10. My channel destination is not connecting to SQL server database and give the following error on insert button and using get tables.

I have made sure that TCP/IP setting of SQL server are correct and SQL username that i am using has sufficient privileges. i am able to use same credentials to connect to SQL server from SQL Server management Studio. I am using SQL server 2016.

I have tried with both of following drivers:

net.sourceforge.jtds.jdbc.Driver
com.microsoft.sqlserver.jdbc.SQLServerDriver version 7.2

For SQL Server Driver my URL is : jdbc:sqlserver://xxx.xx.xx.xx:1433/MyDB

for SQL Server/Sybase URL is : jdbc:jtds:sqlserver://xxx.xx.xx.xx:1433/MyDB

Error:

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

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.han dleResponse(ServerConnection.java:529)
at com.mirth.connect.client.core.ServerConnection.han dleResponse(ServerConnection.java:453)
at com.mirth.connect.client.core.ServerConnection.exe cuteAsync(ServerConnection.java:302)
at com.mirth.connect.client.core.ServerConnection.app ly(ServerConnection.java:168)
at org.glassfish.jersey.client.ClientRuntime.invoke(C lientRuntime.java:255)
at org.glassfish.jersey.client.JerseyInvocation$3.cal l(JerseyInvocation.java:722)
at org.glassfish.jersey.internal.Errors.process(Error s.java:315)
at org.glassfish.jersey.internal.Errors.process(Error s.java:297)
at org.glassfish.jersey.internal.Errors.process(Error s.java:228)
at org.glassfish.jersey.process.internal.RequestScope .runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invok e(JerseyInvocation.java:718)
at org.glassfish.jersey.client.JerseyInvocation$Build er.method(JerseyInvocation.java:430)
at org.glassfish.jersey.client.proxy.WebResourceFacto ry.invoke(WebResourceFactory.java:381)
at com.sun.proxy.$Proxy59.getTables(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mirth.connect.client.core.Client$2.invoke(Clie nt.java:266)
at com.sun.proxy.$Proxy59.getTables(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mirth.connect.client.ui.panels.connectors.Conn ectorSettingsPanel$1$1.doInBackground(ConnectorSet tingsPanel.java:216)
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)
Caused by: java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.mirth.connect.connectors.jdbc.CustomDriver.<in it>(CustomDriver.java:40)
at com.mirth.connect.connectors.jdbc.DatabaseConnecto rServlet.getTables(DatabaseConnectorServlet.java:6 9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mirth.connect.server.api.providers.MirthResour ceInvocationHandlerProvider$1.invoke(MirthResource InvocationHandlerProvider.java:219)
at org.glassfish.jersey.server.model.internal.Abstrac tJavaResourceMethodDispatcher$1.run(AbstractJavaRe sourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.Abstrac tJavaResourceMethodDispatcher.invoke(AbstractJavaR esourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaRes ourceMethodDispatcherProvider$TypeOutInvoker.doDis patch(JavaResourceMethodDispatcherProvider.java:20 5)
at org.glassfish.jersey.server.model.internal.Abstrac tJavaResourceMethodDispatcher.dispatch(AbstractJav aResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodIn voker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodIn voker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodIn voker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(Se rverRuntime.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(Error s.java:315)
at org.glassfish.jersey.internal.Errors.process(Error s.java:297)
at org.glassfish.jersey.internal.Errors.process(Error s.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.han dle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceI mpl(WebComponent.java:471)
at org.glassfish.jersey.servlet.WebComponent.service( WebComponent.java:425)
at org.glassfish.jersey.servlet.ServletContainer.serv ice(ServletContainer.java:383)
at org.glassfish.jersey.servlet.ServletContainer.serv ice(ServletContainer.java:336)
at org.glassfish.jersey.servlet.ServletContainer.serv ice(ServletContainer.java:223)
at org.eclipse.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:864)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1655)
at com.mirth.connect.server.MethodFilter.doFilter(Met hodFilter.java:37)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1642)
at com.mirth.connect.server.api.providers.Clickjackin gFilter.doFilter(ClickjackingFilter.java:44)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1642)
at com.mirth.connect.server.api.providers.ApiOriginFi lter.doFilter(ApiOriginFilter.java:71)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle( ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.session.SessionHandler.do Handle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.do Handle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(S ervletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.do Scope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.do Scope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.han dle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerList.handl e(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.ha ndle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java :531)
at org.eclipse.jetty.server.HttpChannel.handle(HttpCh annel.java:352)
at org.eclipse.jetty.server.HttpConnection.onFillable (HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallba ck.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInt erest.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(FillInt erest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(Channel EndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouK ill.doProduce(EatWhatYouKill.java:319)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouK ill.tryProduce(EatWhatYouKill.java:175)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouK ill.run(EatWhatYouKill.java:133)
at org.eclipse.jetty.util.thread.ReservedThreadExecut or$ReservedThread.run(ReservedThreadExecutor.java: 366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run Job(QueuedThreadPool.java:754)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.r un(QueuedThreadPool.java:672)
at java.lang.Thread.run(Unknown Source)

Thanks
Bilal

narupley 07-09-2019 06:37 AM

The answer is in the very error stacktrace you posted.

Code:

Caused by: java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
You're using a driver compiled for Java 11+, but you're running MC on Java 8.

mbilala78 07-09-2019 08:53 AM

Thanks for looking into this. I installed the MS SQL Server driver because i was not able to get the build in "SQl Server/Sybase" driver to work. It also gives following error. i am a bit confused which driver to use and configure. Please advise.

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

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.han dleResponse(ServerConnection.java:529)
at com.mirth.connect.client.core.ServerConnection.han dleResponse(ServerConnection.java:453)
at com.mirth.connect.client.core.ServerConnection.exe cuteAsync(ServerConnection.java:302)
at com.mirth.connect.client.core.ServerConnection.app ly(ServerConnection.java:168)
at org.glassfish.jersey.client.ClientRuntime.invoke(C lientRuntime.java:255)
at org.glassfish.jersey.client.JerseyInvocation$3.cal l(JerseyInvocation.java:722)
at org.glassfish.jersey.internal.Errors.process(Error s.java:315)
at org.glassfish.jersey.internal.Errors.process(Error s.java:297)
at org.glassfish.jersey.internal.Errors.process(Error s.java:228)
at org.glassfish.jersey.process.internal.RequestScope .runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invok e(JerseyInvocation.java:718)
at org.glassfish.jersey.client.JerseyInvocation$Build er.method(JerseyInvocation.java:430)
at org.glassfish.jersey.client.proxy.WebResourceFacto ry.invoke(WebResourceFactory.java:381)
at com.sun.proxy.$Proxy59.getTables(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mirth.connect.client.core.Client$2.invoke(Clie nt.java:266)
at com.sun.proxy.$Proxy59.getTables(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mirth.connect.client.ui.panels.connectors.Conn ectorSettingsPanel$1$1.doInBackground(ConnectorSet tingsPanel.java:216)
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)
Caused by: java.lang.Exception: Could not retrieve database tables and columns.
at com.mirth.connect.connectors.jdbc.DatabaseConnecto rServlet.getTables(DatabaseConnectorServlet.java:2 20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mirth.connect.server.api.providers.MirthResour ceInvocationHandlerProvider$1.invoke(MirthResource InvocationHandlerProvider.java:219)
at org.glassfish.jersey.server.model.internal.Abstrac tJavaResourceMethodDispatcher$1.run(AbstractJavaRe sourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.Abstrac tJavaResourceMethodDispatcher.invoke(AbstractJavaR esourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaRes ourceMethodDispatcherProvider$TypeOutInvoker.doDis patch(JavaResourceMethodDispatcherProvider.java:20 5)
at org.glassfish.jersey.server.model.internal.Abstrac tJavaResourceMethodDispatcher.dispatch(AbstractJav aResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodIn voker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodIn voker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodIn voker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(Se rverRuntime.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(Error s.java:315)
at org.glassfish.jersey.internal.Errors.process(Error s.java:297)
at org.glassfish.jersey.internal.Errors.process(Error s.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.han dle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceI mpl(WebComponent.java:471)
at org.glassfish.jersey.servlet.WebComponent.service( WebComponent.java:425)
at org.glassfish.jersey.servlet.ServletContainer.serv ice(ServletContainer.java:383)
at org.glassfish.jersey.servlet.ServletContainer.serv ice(ServletContainer.java:336)
at org.glassfish.jersey.servlet.ServletContainer.serv ice(ServletContainer.java:223)
at org.eclipse.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:864)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1655)
at com.mirth.connect.server.MethodFilter.doFilter(Met hodFilter.java:37)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1642)
at com.mirth.connect.server.api.providers.Clickjackin gFilter.doFilter(ClickjackingFilter.java:44)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1642)
at com.mirth.connect.server.api.providers.ApiOriginFi lter.doFilter(ApiOriginFilter.java:71)
at org.eclipse.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle( ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.session.SessionHandler.do Handle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.do Handle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(S ervletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.do Scope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nex tScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.do Scope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.han dle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerList.handl e(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.ha ndle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java :531)
at org.eclipse.jetty.server.HttpChannel.handle(HttpCh annel.java:352)
at org.eclipse.jetty.server.HttpConnection.onFillable (HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallba ck.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInt erest.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(FillInt erest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(Channel EndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouK ill.doProduce(EatWhatYouKill.java:319)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouK ill.tryProduce(EatWhatYouKill.java:175)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouK ill.run(EatWhatYouKill.java:133)
at org.eclipse.jetty.util.thread.ReservedThreadExecut or$ReservedThread.run(ReservedThreadExecutor.java: 366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run Job(QueuedThreadPool.java:754)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.r un(QueuedThreadPool.java:672)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: I/O Error: DB server closed connection.
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2481)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.ja va:632)
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Jt dsConnection.java:371)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.ja va:184)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.mirth.connect.connectors.jdbc.DatabaseConnecto rServlet.getTables(DatabaseConnectorServlet.java:9 1)
... 63 more
Caused by: java.io.IOException: DB server closed connection.
at net.sourceforge.jtds.jdbc.SharedSocket.readPacket( SharedSocket.java:852)
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacke t(SharedSocket.java:731)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket (ResponseStream.java:477)
at net.sourceforge.jtds.jdbc.ResponseStream.read(Resp onseStream.java:114)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2368)
... 69 more

mbilala78 07-10-2019 02:19 AM

I was not able to find the matching Java run time version, but downgrading the SQL JDBC driver version fixed the issue. SQLServer/Sybase built in driver still does not work.


All times are GMT -8. The time now is 06:20 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation