Announcement

Collapse
No announcement yet.

Error Building SQL Session

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error Building SQL Session

    Hello,

    I am creating a new MIRTH server for our environment. It is running Server 2019 in Azure and connecting to a SQL PaaS instance in Azure. Java 8 Update 201 (64 bit) is installed along with Mirth Connect 3.7.1.b243 and the Mirth Connect Administrator Launcher. I added the JDBC driver to dbdrivers.xml. I changed the mirth.properties file to server.includecustomlib = true and added the database.url and database.driver. In the custom-lib file I have the smsql-jdbc-7.2.1.jre11.jar file.

    Whenever I try to open http://localhost:8080 or https://localhost:8443, I get the following error:

    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: Exception in thread "Main Server Thread" java.lang.RuntimeException: org.apache.ibatis.exceptions.PersistenceException:
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ### Error building SqlSession.
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ### The error may exist in SQL Mapper Configuration
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.util.SqlConfig.init(SqlCo nfig.java:117)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.util.SqlConfig.<init>(Sql Config.java:71)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.util.SqlConfig.getInstanc e(SqlConfig.java:62)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.Mirth.startup(Mirth.java: 228)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.Mirth.run(Mirth.java:154)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: Caused by: org.apache.ibatis.exceptions.PersistenceException:
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ### Error building SqlSession.
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ### The error may exist in SQL Mapper Configuration
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.exceptions.ExceptionFactory.wrap Exception(ExceptionFactory.java:23)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.session.SqlSessionFactoryBuilder .build(SqlSessionFactoryBuilder.java:51)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.session.SqlSessionFactoryBuilder .build(SqlSessionFactoryBuilder.java:43)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.util.SqlConfig.createFact ory(SqlConfig.java:141)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.util.SqlConfig.init(SqlCo nfig.java:101)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ... 4 more
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.par seConfiguration(XMLConfigBuilder.java:105)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.par se(XMLConfigBuilder.java:88)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.session.SqlSessionFactoryBuilder .build(SqlSessionFactoryBuilder.java:49)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ... 7 more
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: Caused by: java.lang.NullPointerException
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at com.mirth.connect.server.mybatis.BridgeDataSourceF actory.setProperties(BridgeDataSourceFactory.java: 30)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.dat aSourceElement(XMLConfigBuilder.java:264)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.env ironmentsElement(XMLConfigBuilder.java:222)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.par seConfiguration(XMLConfigBuilder.java:100)
    ERROR 2019-04-15 12:14:39,131 [Main Server Thread] Server: ... 9 more

    I have tried different versions of the JDBC file, added the localhost to the security settings in Java, rebooted multiple times, etc. but I still cannot seem to get connected.

    Has anyone else experienced this issue?

    Thanks in advance.

  • #2
    Were you able to solve this? We upgraded one of our 3.4 environments to 3.7.1 and I am getting this error as well using SQLSERVER with integrated security.

    Comment


    • #3
      Having the same issue with the 3.7.1 upgrade, any resolution to this?
      Best,

      Kirby

      Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

      Appliance Version 3.11.4
      Mirth Connect Version 3.8.0
      Java Version 1.6.0_45-b06
      Java (64 bit) Version 1.6.0_45-b06
      Java 7 (64 bit) Version 1.7.0_151-b15
      Java 8 (64 bit) Version 1.8.0_181-b13
      PostgreSQL Version 9.6.8

      Comment


      • #4
        This is a bug with custom db drivers in 3.7 and fixed in 3.8

        http://www.mirthcorp.com/community/i...wse/MIRTH-4414

        As a workaround in 3.7, you need to add to your mirth.properties:
        Code:
        database-readonly.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver

        Comment


        • #5
          For Nondefault drivers used in Database readers, this property doesnt help?Is anyone facing issue while using Nondefault drivers in mirth 3.7.1 version

          Comment


          • #6
            Same issue Error Building SQL Session in version 3.8.1

            Has anyone else been able to connect to SQL Server using version 3.8.1? I'm having this similar error and I even added the line database-readonly.driver=com.microsoft.sqlserver.jdbc.SQLSe rverDriver to my properties. Using this format URL which works fine connecting to this same database in version 3.1.1: database.url = jdbc:sqlserver://server:1433;databaseName=MirthDB;ssl=require, and I have the MS JDBC driver in the custom-lib folder. It all worked fine in 3.1.1, but when I upgraded to 3.8.1 I can no longer connect with this error:

            ERROR 2020-04-06 16:58:04,324 [Main Server Thread] com.mirth.connect.server.Mirth: Error establishing connection to database, aborting startup. com.microsoft.sqlserver.jdbc.SQLServerDriver
            INFO 2020-04-06 16:58:04,325 [Shutdown Hook Thread] com.mirth.connect.server.Mirth: shutting down mirth due to normal request
            ERROR 2020-04-06 16:58:04,882 [Shutdown Hook Thread] com.mirth.connect.server.Mirth: java.lang.RuntimeException: org.apache.ibatis.exceptions.PersistenceException:
            ### Error building SqlSession.
            ### The error may exist in SQL Mapper Configuration
            ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
            ERROR 2020-04-06 16:58:05,226 [Shutdown Hook Thread] Server: Exception in thread "Shutdown Hook Thread" java.lang.RuntimeException: org.apache.ibatis.exceptions.PersistenceException:
            ERROR 2020-04-06 16:58:05,226 [Shutdown Hook Thread] Server: ### Error building SqlSession.
            ERROR 2020-04-06 16:58:05,226 [Shutdown Hook Thread] Server: ### The error may exist in SQL Mapper Configuration
            ERROR 2020-04-06 16:58:05,226 [Shutdown Hook Thread] Server: ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
            ERROR 2020-04-06 16:58:05,226 [Shutdown Hook Thread] Server: at com.mirth.connect.server.util.SqlConfig.init(SqlCo nfig.java:117)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at com.mirth.connect.server.util.SqlConfig.<init>(Sql Config.java:71)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at com.mirth.connect.server.util.SqlConfig.getInstanc e(SqlConfig.java:62)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at com.mirth.connect.server.Mirth.shutdown(Mirth.java :338)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at com.mirth.connect.server.Mirth$ShutdownHook.run(Mi rth.java:441)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: Caused by: org.apache.ibatis.exceptions.PersistenceException:
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: ### Error building SqlSession.
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: ### The error may exist in SQL Mapper Configuration
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at org.apache.ibatis.exceptions.ExceptionFactory.wrap Exception(ExceptionFactory.java:23)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at org.apache.ibatis.session.SqlSessionFactoryBuilder .build(SqlSessionFactoryBuilder.java:51)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at com.mirth.connect.server.util.SqlConfig.createFact ory(SqlConfig.java:139)
            ERROR 2020-04-06 16:58:05,227 [Shutdown Hook Thread] Server: at com.mirth.connect.server.util.SqlConfig.init(SqlCo nfig.java:107)
            ERROR 2020-04-06 16:58:05,228 [Shutdown Hook Thread] Server: ... 4 more
            ERROR 2020-04-06 16:58:05,228 [Shutdown Hook Thread] Server: Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.NullPointerException
            ERROR 2020-04-06 16:58:05,228 [Shutdown Hook Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.par seConfiguration(XMLConfigBuilder.java:105)
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.par se(XMLConfigBuilder.java:88)
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: at org.apache.ibatis.session.SqlSessionFactoryBuilder .build(SqlSessionFactoryBuilder.java:49)
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: ... 6 more
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: Caused by: java.lang.NullPointerException
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: at com.mirth.connect.server.mybatis.BridgeDataSourceF actory.setProperties(BridgeDataSourceFactory.java: 30)
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.dat aSourceElement(XMLConfigBuilder.java:264)
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.env ironmentsElement(XMLConfigBuilder.java:222)
            ERROR 2020-04-06 16:58:05,229 [Shutdown Hook Thread] Server: at org.apache.ibatis.builder.xml.XMLConfigBuilder.par seConfiguration(XMLConfigBuilder.java:100)
            ERROR 2020-04-06 16:58:05,230 [Shutdown Hook Thread] Server: ... 8 more

            Comment


            • #7
              In case this helps anyone, I figured out the correct properties settings to make the connection to SQL Server after reviewing the release notes in Mirth 3.7 which talked about the separation of the database connection pools. For me this is what worked:

              database = sqlserver

              database.url = jdbc:sqlserver://servername:1433;databaseName=dbname;ssl=require

              database.driver = com.microsoft.sqlserver.jdbc.SQLServerDriver

              database.enable-read-write-split = false

              I also had this line in the dbdrivers.xml file from previous versions which 3.8+ gets imported into the DB directly, replacing the xml file:

              <driver class="com.microsoft.sqlserver.jdbc.SQLServerDrive r" name="MSSQLSERVER" template="jdbc:sqlserver://hostort/dbname" selectLimit="SELECT TOP 1 * FROM ?" />

              Comment

              Working...
              X