简体   繁体   English

Ojdbc8 jars 升级到 21.1.0.0 抛出 Nosuchmethod 异常 UCPservletContextListener init

[英]Ojdbc8 jars upgrade to 21.1.0.0 throws Nosuchmethod exception UCPservletContextListener init

Ojdbc8, ons, ucp jars are upgraded to 21.1.0.0 version. ojdbc8、ons、ucp jars升级到21.1.0.0版本。 When trying to start the app on tomcat server, it's throwing Nosuchmethod exception.尝试在 tomcat 服务器上启动应用程序时,它抛出 Nosuchmethod 异常。 Logged in the Tomcat's localhost.log file.登录Tomcat的localhost.log文件。 Application tries to establish DB connection during startup itself.应用程序尝试在启动期间建立数据库连接。

01-Jun-2021 15:59:56.641 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log 3 Spring WebApplication Initializers detected on classpath 01-Jun-2021 16:00:05.365 INFO localhost-startStop-1 org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext 01-Jun-2021 16:00:19.397 SEVERE localhost-startStop-1 org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [oracle.ucp.jdbc.UCPServletContextListener] java.lang.NoSuchMethodException: oracle.ucp.jdbc.UCPServletContextListener.init at java.lang.class.getConstructor(Unknown Source) 01-Jun-2021 15:59:56.641 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log 3 Spring WebApplication Initializers 在 classpath 上检测到 01-Jun-2021 16:00:05.365 INFO localhost-startStop -1 org.apache.catalina.core.ApplicationContext.log 初始化 Spring 嵌入式 WebApplicationContext 01-Jun-2021 16:00:19.397 SEVERE localhost-startStop-1 org.apache.catalina.core.StandardContext.listenerStart 配置类的应用程序侦听器时出错[oracle.ucp.jdbc.UCPServletContextListener] java.lang.NoSuchMethodException: oracle.ucp.jdbc.UCPServletContextListener.init at java.lang.class.getConstructor(Unknown Source)

This is a known issue with ucp.jar in 21.1.这是 21.1 中 ucp.jar 的已知问题。 It will be fixed in 21.3 when it's released.它将在 21.3 发布时修复。 In the meantime, you can remove this class from the ucp.jar:同时,您可以从 ucp.jar 中删除此类:

  oracle/ucp/jdbc/UCPServletContextListener.class

From my experience, if you put jdbc/ucp jars to Tomcat's lib (which is recommended for productive system) and set provided scope for them in Maven, the problem will disappear.根据我的经验,如果你将 jdbc/ucp jars 放到 Tomcat 的 lib(推荐用于生产系统)并在 Maven 中为它们设置provided范围,问题就会消失。

Another option could be setting metadata-complete="true" in web.xml (read more here and here )另一种选择可能是在web.xml 中设置metadata-complete="true"在此处此处阅读更多信息

if you are using spring boot then you can use如果您使用的是弹簧靴,那么您可以使用

   <dependency>
      <groupId>com.oracle.ojdbc</groupId>
      <artifactId>ojdbc8</artifactId>    
      <version>19.3.0.0</version>      
  </dependency>

this dependency or update your maven project.此依赖项或更新您的 Maven 项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip升级TooManyRedirects异常 - pip upgrade TooManyRedirects exception Magento 升级 2.4.3 抛出错误(无法实例化接口_ - Magento upgrade 2.4.3 throws error(Cannot instantiate interface_ Grails升级-Java 1.8兼容性从1.3.7到2.4.1。 如何在类路径中添加自定义jar - Grails Upgrade - 1.3.7 to 2.4.1 for Java 1.8 Compatibility. How to add custom jars in classpath 编译错误:BUG! Griffon项目升级后的例外情况 - Compilation error: BUG! exception after Griffon project upgrade 启动Tomcat时的Hibernate异常(升级到hibernate-3.5.0之后) - Hibernate exception when starting Tomcat (after upgrade to hibernate-3.5.0) 升级到spring 4.2后,为logback config抛出FileNotFound异常 - FileNotFound exception thrown for logback config after upgrade to spring 4.2 CakePHP:从 3.6.x 升级到 4.0“缺少模板异常” - CakePHP: upgrade from 3.6.x to 4.0 "Missing Template Exception" Laravel auth 中间件抛出非法偏移类型异常 - Laravel auth middleware throws illegal offset type exception 在Kentico 8.2升级到9站点后,抛出System.Web.WebPages.Razor版本,Version = 2.0.0.0,例外 - After Kentico Upgrade 8.2 to to 9 site throwing System.Web.WebPages.Razor version , Version=2.0.0.0, exception Kentico从v9升级到v10后加载网站时的安全异常 - Security Exception when loading the site after Kentico upgrade from v9 to v10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM