无法使用client.create()jersey rest api方法创建客户端。试图在jira 6.3.5中创建问题

时间:2014-09-16 17:22:17

标签: java rest jersey jira

我收到以下例外

java.lang.ClassFormatError: Absent Code attribute in method that is
not native or abstract in class file javax/ws/rs/core/MediaType

日志如下:

 java.lang.ClassLoader.defineClass(ClassLoader.java:621)    at
     java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)     at
     java.net.URLClassLoader.access$000(URLClassLoader.java:58)     at
     java.net.URLClassLoader$1.run(URLClassLoader.java:197)     at
     java.security.AccessController.doPrivileged(Native Method)     at
     java.net.URLClassLoader.findClass(URLClassLoader.java:190)     at
     java.lang.ClassLoader.loadClass(ClassLoader.java:306)  at
     sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)  at
     java.lang.ClassLoader.loadClass(ClassLoader.java:247)  at
     java.lang.Class.getDeclaredMethods0(Native Method)     at
     java.lang.Class.privateGetDeclaredMethods(Class.java:2484)     at
     java.lang.Class.getDeclaredMethods(Class.java:1827)    at
     com.sun.jersey.core.reflection.MethodList.getAllDeclaredMethods(MethodList.java:70) at
     com.sun.jersey.core.reflection.MethodList.<init>(MethodList.java:64) at com.sun.jersey.core.spi.component.ComponentConstructor.getPostConstructMethods(ComponentConstructor.java:131) at
     com.sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.java:123) at
     com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:165) at
     com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
        at
     com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256)
        at
     com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160)
        at
     com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
        at
     com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
        at com.sun.jersey.api.client.Client.init(Client.java:342)   at
     com.sun.jersey.api.client.Client.access$000(Client.java:118)   at
     com.sun.jersey.api.client.Client$1.f(Client.java:191)  at
     com.sun.jersey.api.client.Client$1.f(Client.java:187)  at
     com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at com.sun.jersey.api.client.Client.<init>(Client.java:187)     at
     com.sun.jersey.api.client.Client.<init>(Client.java:159)   at
     com.sun.jersey.api.client.Client.create(Client.java:669)

1 个答案:

答案 0 :(得分:0)

查看此文javaee-api 您可能在项目中具有javaee-api的传递依赖性。