maven依赖冲突:java.lang.noclassdeffounderror:com/sun/jersey/api/notfoundexception

iugsix8n  于 2021-06-09  发布在  Hbase
关注(0)|答案(2)|浏览(515)

我在应用程序的pom中添加了org.apache。hbase:hbase-client:1.2.5依赖关系和我的应用程序停止工作。这似乎是一个依赖冲突,但我不明白,到底是什么问题。
我得到以下例外:

  1. <Jun 4, 2019 6:48:32,171 AM CDT> <Notice> <StdErr> <BEA-000000> <Jun 04, 2019 6:48:32 AM org.glassfish.jersey.server.ServerRuntime$Responder mapException
  2. SEVERE: An exception has been thrown from an exception mapper class org.apache.hadoop.yarn.webapp.GenericExceptionHandler.
  3. java.lang.NoClassDefFoundError: com/sun/jersey/api/NotFoundException
  4. at org.apache.hadoop.yarn.webapp.GenericExceptionHandler.toResponse(GenericExceptionHandler.java:61)
  5. at org.apache.hadoop.yarn.webapp.GenericExceptionHandler.toResponse(GenericExceptionHandler.java:43)
  6. at org.glassfish.jersey.server.ServerRuntime$Responder.mapException(ServerRuntime.java:601)
  7. at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:476)
  8. at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334)
  9. at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
  10. at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
  11. at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
  12. at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
  13. at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
  14. at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
  15. at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
  16. at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
  17. at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
  18. at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
  19. at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
  20. at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
  21. at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
  22. at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
  23. at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
  24. at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
  25. at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
  26. at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
  27. at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3702)
  28. at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672)
  29. at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328)
  30. at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
  31. at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
  32. at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
  33. at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
  34. at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
  35. at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
  36. at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)
  37. at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)
  38. at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
  39. at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
  40. at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
  41. at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
  42. at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
  43. at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)
  44. at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
  45. at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)>
  46. <Jun 4, 2019 6:48:32,172 AM CDT> <Notice> <StdErr> <BEA-000000> <Jun 04, 2019 6:48:32 AM org.glassfish.jersey.server.ServerRuntime$Responder mapException
  47. SEVERE: An exception was not mapped due to exception mapper failure. The HTTP 500 response will be returned.
  48. javax.ws.rs.NotFoundException: HTTP 404 Not Found
  49. at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:323)
  50. at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
  51. at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
  52. at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
  53. at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
  54. at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
  55. at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
  56. at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
  57. at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
  58. at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
  59. at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
  60. at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
  61. at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
  62. at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
  63. at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
  64. at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
  65. at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
  66. at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
  67. at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
  68. at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3702)
  69. at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672)
  70. at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328)
  71. at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
  72. at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
  73. at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
  74. at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
  75. at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
  76. at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
  77. at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)
  78. at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)
  79. at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
  80. at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
  81. at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
  82. at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
  83. at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
  84. at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)
  85. at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
  86. at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)>
  87. <Jun 4, 2019 6:48:32,734 AM CDT> <Error> <org.glassfish.jersey.server.ServerRuntime$Responder> <BEA-000000> <An exception has been thrown from an exception mapper class org.apache.hadoop.yar
  88. n.webapp.GenericExceptionHandler.
  89. java.lang.NoClassDefFoundError: com/sun/jersey/api/NotFoundException
  90. at org.apache.hadoop.yarn.webapp.GenericExceptionHandler.toResponse(GenericExceptionHandler.java:61)
  91. at org.apache.hadoop.yarn.webapp.GenericExceptionHandler.toResponse(GenericExceptionHandler.java:43)
  92. at org.glassfish.jersey.server.ServerRuntime$Responder.mapException(ServerRuntime.java:601)
  93. at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:476)
  94. at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334)
  95. Truncated. see log file for complete stacktrace

我尝试过使用其他版本的hbase客户端,但没有成功。
my pom.xml中的依赖项:

  1. <dependency>
  2. <groupId>org.quartz-scheduler</groupId>
  3. <artifactId>quartz</artifactId>
  4. <version>2.2.2</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.quartz-scheduler</groupId>
  8. <artifactId>quartz-jobs</artifactId>
  9. <version>2.2.2</version>
  10. </dependency>
  11. <dependency>
  12. <groupId>org.apache.velocity</groupId>
  13. <artifactId>velocity</artifactId>
  14. <version>1.7</version>
  15. </dependency>
  16. <dependency>
  17. <groupId>org.apache.velocity</groupId>
  18. <artifactId>velocity-tools</artifactId>
  19. <version>2.0</version>
  20. <exclusions>
  21. <exclusion>
  22. <artifactId>dom4j</artifactId>
  23. <groupId>dom4j</groupId>
  24. </exclusion>
  25. </exclusions>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.springframework</groupId>
  29. <artifactId>spring-context</artifactId>
  30. <version>3.2.17.RELEASE</version>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.springframework</groupId>
  34. <artifactId>spring-context-support</artifactId>
  35. <version>3.2.17.RELEASE</version>
  36. </dependency>
  37. <dependency>
  38. <groupId>org.springframework</groupId>
  39. <artifactId>spring-web</artifactId>
  40. <version>3.2.17.RELEASE</version>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.springframework</groupId>
  44. <artifactId>spring-webmvc</artifactId>
  45. <version>3.2.17.RELEASE</version>
  46. </dependency>
  47. <dependency>
  48. <groupId>log4j</groupId>
  49. <artifactId>log4j</artifactId>
  50. <version>1.2.14</version>
  51. </dependency>
  52. <dependency>
  53. <groupId>junit</groupId>
  54. <artifactId>junit</artifactId>
  55. <version>4.9</version>
  56. <scope>test</scope>
  57. </dependency>
  58. <dependency>
  59. <groupId>org.apache.commons</groupId>
  60. <artifactId>commons-lang3</artifactId>
  61. <version>3.1</version>
  62. </dependency>
  63. <dependency>
  64. <groupId>org.apache.hbase</groupId>
  65. <artifactId>hbase-client</artifactId>
  66. <version>1.2.5</version>
  67. </dependency>
r8uurelv

r8uurelv1#

可能是因为泽西岛的版本不匹配。
hbase使用特定的jersey版本。您的应用程序或任何其他依赖项可能使用另一个jersey版本。加载jersey jar时,根据加载的版本,某些依赖类将丢失。
所以看看那些使用jersey的包,把它改成普通版本。这也是 java.lang.NoClassDefFoundError 例外。

nwwlzxa7

nwwlzxa72#

可能是您使用了太旧的java版本来满足jars需求?因为我看到你用的是很旧的spring版本。。。还有两个不同版本的速度相关的东西,这可能也会导致一些不匹配。

相关问题