1. <legend id='vBCcM'><style id='vBCcM'><dir id='vBCcM'><q id='vBCcM'></q></dir></style></legend>

      <small id='vBCcM'></small><noframes id='vBCcM'>

    2. <tfoot id='vBCcM'></tfoot>

        <bdo id='vBCcM'></bdo><ul id='vBCcM'></ul>
    3. <i id='vBCcM'><tr id='vBCcM'><dt id='vBCcM'><q id='vBCcM'><span id='vBCcM'><b id='vBCcM'><form id='vBCcM'><ins id='vBCcM'></ins><ul id='vBCcM'></ul><sub id='vBCcM'></sub></form><legend id='vBCcM'></legend><bdo id='vBCcM'><pre id='vBCcM'><center id='vBCcM'></center></pre></bdo></b><th id='vBCcM'></th></span></q></dt></tr></i><div id='vBCcM'><tfoot id='vBCcM'></tfoot><dl id='vBCcM'><fieldset id='vBCcM'></fieldset></dl></div>
      1. 与 JRE 1.7 一起使用的 db2jcc.jar 版本错误?

        时间:2023-05-27
          <bdo id='kGS9w'></bdo><ul id='kGS9w'></ul>
          <legend id='kGS9w'><style id='kGS9w'><dir id='kGS9w'><q id='kGS9w'></q></dir></style></legend>
            <tbody id='kGS9w'></tbody>

              1. <i id='kGS9w'><tr id='kGS9w'><dt id='kGS9w'><q id='kGS9w'><span id='kGS9w'><b id='kGS9w'><form id='kGS9w'><ins id='kGS9w'></ins><ul id='kGS9w'></ul><sub id='kGS9w'></sub></form><legend id='kGS9w'></legend><bdo id='kGS9w'><pre id='kGS9w'><center id='kGS9w'></center></pre></bdo></b><th id='kGS9w'></th></span></q></dt></tr></i><div id='kGS9w'><tfoot id='kGS9w'></tfoot><dl id='kGS9w'><fieldset id='kGS9w'></fieldset></dl></div>

                  <small id='kGS9w'></small><noframes id='kGS9w'>

                  <tfoot id='kGS9w'></tfoot>
                • 本文介绍了与 JRE 1.7 一起使用的 db2jcc.jar 版本错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  找到解决方案:我最终将 db2jcc4.jar 放在 Tomcat 8 的 Tomcat lib 文件夹中,我们可以开始了.但是同样不适用于 Tomcat7,所以我将 db2jcc.jar 从项目外部 jar 引用中取出,让服务器确定要使用哪个版本

                  Solution Found: I wound up putting db2jcc4.jar on Tomcat 8 in the Tomcat lib folder and we're good to go. Same doesn't work for Tomcat7 however, so I took the db2jcc.jar out of the project external jar references and let the server determine which version to use instead

                  原始问题

                  谷歌搜索已经为这个问题产生了一系列神秘的参考:哪个版本的 db2jcc 与 jre 1.7 一起使用.

                  Googling has produced a slew of cryptic references for this question: which version of db2jcc to use with jre 1.7.

                  此页面列出了驱动程序下载按db2版本,但不是 JRE.

                  This page lists the driver downloads by db2 version, but not JRE.

                  让我知道这个谜团的问题是我们有两台 Tomcat 服务器,一台运行 JRE 1.8,一台运行 1.7.奇怪的是,前者运行的是 Tomcat 7,后者运行的是 Tomcat 8.(你可以问,但我没有答案)

                  The problem that led me to this mystery is we have two Tomcat servers, one running JRE 1.8 and one running 1.7. Oddly enough, the former is running Tomcat 7 and the later Tomcat 8. (you can ask but I don't have an answer for this)

                  所以我们的开发代码运行良好,可以从我们的 Tomcat 7 JRE 1.8 系统连接到 db2,但是部署到我们的 Tomcat 8 JRE 1.7 服务器的其他东西可能会因为那里更新到 JRE 1.8 而损坏,所以我们怀疑有错误,如图所示下面,是 JRE 1.7 和我们的 db2jcc.jar 文件之间的版本不匹配.

                  So our development code is running fine making connections to db2 from our Tomcat 7 JRE 1.8 system, but other things deployed to our Tomcat 8 JRE 1.7 server are feared breakable by updating to JRE 1.8 there, so we suspect an error, shown below, to be a version mismatch between JRE 1.7 and our db2jcc.jar file.

                  不过,这可能是 Tomcat 8 的问题.

                  Perhaps it is a problem with Tomcat 8, though.

                  从堆栈跟踪中提取的错误:

                  The error, extracted from the stack trace:

                  java.lang.AbstractMethodError: com.ibm.db2.jcc.t4.b.isValid(I)Z
                  

                  最后,我在 Tomcat 7 JRE 1.8 上开发和测试的项目是在 Eclipse 中构建的,符合 JRE 1.7.那么为什么我们会得到这个错误呢?似乎是版本兼容性问题?

                  Now a final wrinkle, the project that I have developed and tested on Tomcat 7 JRE 1.8 is built in Eclipse with JRE 1.7 compliance. So why would we get this error? Does it appear to be a version compatibility issue?

                  更完整(但不完整)的堆栈跟踪

                  More complete (but not full) stack trace

                      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:574)
                      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:461)
                      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
                      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
                   root cause javax.servlet.ServletException: java.lang.AbstractMethodError: com.ibm.db2.jcc.t4.b.isValid(I)Z
                      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:908)
                      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:837)
                      org.apache.jsp.getTimesheetsForUser_jsp._jspService(getTimesheetsForUser_jsp.java:112)
                      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
                      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
                      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
                      root cause java.lang.AbstractMethodError: com.ibm.db2.jcc.t4.b.isValid(I)Z
                      org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:913)
                      org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:226)
                      org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:302)
                      org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2208)
                      org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2191)
                      org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1945)
                      org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
                      com.hr.timesheets.JDBCConnection.queryProdData(JDBCConnection.java:226)
                      com.hr.timesheets.TimeSheetQueryManager.getTimesheets(TimeSheetQueryManager.java:624)
                      com.hr.timesheets.TimeSheetQueryManager.generateUploadsForUser(TimeSheetQueryManager.java:343)
                      org.apache.jsp.getTimesheetsForUser_jsp._jspService(getTimesheetsForUser_jsp.java:94)
                      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
                      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
                      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
                  

                  任何人都可以在这里看到我们团队缺少的明显内容吗?其他人之前有这个问题吗?

                  Can anyone see something obvious here that our team is missing? Anyone else have this problem before?

                  注意:我们使用的是在 context.iml 文件中配置的池连接资源,如下所示:

                  Note: we are using pooled connection resources configured in our context.iml file, as shown here:

                  <Resource auth="Container" 
                  name="jdbc/hrdb2"
                  type="javax.sql.DataSource" 
                  driverClassName="com.ibm.db2.jcc.DB2Driver"
                  url="jdbc:db2://hrdb2.hr.com:50200/time"
                  username="redacted" 
                  password="redacted"
                  maxIdle="10"
                  maxActive="400"
                  maxWait="5"
                  removeAbandoned="true"
                  removeAbandonedTimeout="1200"
                  /> 
                  

                  推荐答案

                  这个问题已经在上面的评论和更新中回答了.

                  This question has been answered in the comments and update above.

                  特别是:将已知可与给定 Tomcat 版本一起使用的 jar 文件放在服务器上的 lib 文件夹中,并将其从应用程序中删除,允许服务器而不是应用程序来处理连接,尤其是当我们使用连接池时.

                  Specifically: putting the jar file known to work with a given Tomcat release in the lib folder on the server, and removing it from the application, allows the server to handle the connectivity instead of the application, especially as we use connection pooling.

                  因此我们可以将 db2jcc.jar 放在 tomcat 7 上,将 db2jcc4.jar 放在 tomcat 8 上,并且在部署到任一服务器时应用程序代码不需要更改.

                  So we can put db2jcc.jar on tomcat 7 and db2jcc4.jar on tomcat 8 and the application code need not change when deploying to either server.

                  这篇关于与 JRE 1.7 一起使用的 db2jcc.jar 版本错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:db2jcc4.jar 无效参数:未知列名 下一篇:加载 DB2 JDBC 驱动程序时出现 java.lang.UnsatisfiedLinkError

                  相关文章

                  <i id='7eQ8X'><tr id='7eQ8X'><dt id='7eQ8X'><q id='7eQ8X'><span id='7eQ8X'><b id='7eQ8X'><form id='7eQ8X'><ins id='7eQ8X'></ins><ul id='7eQ8X'></ul><sub id='7eQ8X'></sub></form><legend id='7eQ8X'></legend><bdo id='7eQ8X'><pre id='7eQ8X'><center id='7eQ8X'></center></pre></bdo></b><th id='7eQ8X'></th></span></q></dt></tr></i><div id='7eQ8X'><tfoot id='7eQ8X'></tfoot><dl id='7eQ8X'><fieldset id='7eQ8X'></fieldset></dl></div>

                      <small id='7eQ8X'></small><noframes id='7eQ8X'>

                        <bdo id='7eQ8X'></bdo><ul id='7eQ8X'></ul>
                      <tfoot id='7eQ8X'></tfoot>
                      <legend id='7eQ8X'><style id='7eQ8X'><dir id='7eQ8X'><q id='7eQ8X'></q></dir></style></legend>