[maven 问题]java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map

NotifyService站点今天maven build的时候出现如下异常

WARNING] FAILED org.eclipse.jetty.maven.plugin.JettyServer@3c64339f: java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
    at org.glassfish.jersey.server.ApplicationHandler.<init> (ApplicationHandler.java:331)
    at org.glassfish.jersey.servlet.WebComponent.<init> (WebComponent.java:390)
    at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:172)
    at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:364)
    at javax.servlet.GenericServlet.init (GenericServlet.java:244)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet (ServletHolder.java:616)
    at org.eclipse.jetty.servlet.ServletHolder.initialize (ServletHolder.java:396)
    at org.eclipse.jetty.servlet.ServletHandler.initialize (ServletHandler.java:871)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:298)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1349)
    at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:297)
    at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:505)
    at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:366)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:163)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start (Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart (Server.java:354)
    at org.eclipse.jetty.maven.plugin.JettyServer.doStart (JettyServer.java:73)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:535)
    at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:358)
    at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:167)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[INFO] Jetty server exiting.

这种错误通常意味着您在类路径上同时具有JAX-RS 1和JAX-RS 2 jar.Jersey2使用JAX-RS 2(javax.ws.rs-api-2.0.1.jar),但是如果你还有jsr311-api.jar,那就是JAX-RS 1,有一个javax.ws.rs .core.Application在每个jar.但是jsr311-api应用程序没有getProperties()方法(因此NoSuchMethodError).

mvn dependency:tree -Doutput=tree.txt 导出依赖关系如下:

确实同时存在二个版本的javax.ws.rs-api。exclude之后重新build,OK。

原文地址:https://www.cnblogs.com/zhengwangzw/p/10552833.html

时间: 2024-09-29 02:50:55

[maven 问题]java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map的相关文章

使用Grizzy+Jersey搭建一个RESTful框架()报错Exception in thread &quot;main&quot; java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;

报错的类涉及UriBuilder,我搜索类发现, 这个类存在于两个包中,我在baidu的时候,也有人提到是jar包冲突,我就删除了 这个依赖,问题解决了. 环境搭建过程请见地址https://blog.csdn.net/jinxfei/article/details/4714809 原文地址:https://www.cnblogs.com/BaleW/p/8668712.html

java.lang.NoClassDefFoundError:javax/ws/rs/ext/MessageBodyWorkers

今天在使用RESTful Web Service过程中,报出了这个问题. 这个问题在官网有一些说明,在使用新版本的JAX-RS包时,相应的CXF包也应该使用较新版本.由于MyEclipse 2014自带CXF最高版本为CXF-2.1,所以建议大家从官网下载使用.官网下载地址:http://cxf.apache.org/download.html. 解压,拷贝lib包下的所有jar包,使用即可.

java.lang.NoSuchMethodError: com.google.common.collect.Maps.newConcurrentMap()Ljava/util/concurrent/Concurren??tMap;

在启动topo的时候,报错: 原本代码中使用的下面两个jar包google-collections-1.0.jar guava-18.0.jar 解决办法删除google-collections-1.0.jarguava-18.0.jar 替换成guava-19.0.jar jar包下载路径: https://github.com/google/guava/wiki/Release19 然后重启storm和TOPO就OK了,亲测....

Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode

进行 spring mvc jpa整合时.Junit方法测试时. 异常: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested excep

【转】java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

最近在配置最新的ssh(struts2.3.16.3+hibernate4.3.7+spring4.1.2)的时候遇到的这个错误提示,后来在网上找了半天都不能解决,虽然有个说法是model对象用这样@Entity(name = "UserInfo")的方式来实现,但是这样的话对象和表明必须一致,后来找到如下原因:希望对大家有所帮助,特分享如下: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/p

【原】tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig的解决

现象: tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig 解决: 把tomcat目录下的lib/servlet-api.jar文件拷贝到$JAVA_HOME/jre/lib/ext目录下,再启动tomcat问题解决

异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

Spring3.0 + Hibernate3.5:启动服务器报:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z 在hibernate3.5之前,我们运用hibernate开发J2EE项目通常会引以下几个jar包:hibernate核心包:hibernate3.jar持久化:ejb3-persistence.jar则javax.persistence.OneToMany.cla

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 的解决

jetty 9 嵌入式开发时,启动正常,但是页面一浏览就报错如下: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 原因:jetty 9 依赖的servlet-api是3.X版本,如果项目中还有其它第3方开源库隐式依赖了2.x版本的servlet-api,就会报这个错.解决办法:gradle项目中,gradle dependencies 分析所有的依赖项,找出依赖低版本ser

报错org.apache.catalina.LifecycleException caused by java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader

今天将tomcat6更换成了tomcat7,报错的内容 严重: A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/webandr