gpt4 book ai didi

compiler-errors - Atmosphere 、dropwizard 和 Jersey 注入(inject)错误

转载 作者:行者123 更新时间:2023-12-02 11:02:57 25 4
gpt4 key购买 nike

这是我的gradle文件:

compile group: 'io.dropwizard', name: 'dropwizard-core', version: '0.8.0'
compile group: 'io.dropwizard', name: 'dropwizard-auth', version: '0.8.0'
compile group: 'io.dropwizard', name: 'dropwizard-client', version: '0.8.0'

compile group: 'org.glassfish.jersey.media', name: 'jersey-media-multipart', version: '2.16'

compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.16'
compile group: 'org.atmosphere', name: 'atmosphere-jersey', version: '2.1.10'

添加 Atmosphere -jursey 后,我收到以下错误:
WARN  [2015-05-03 21:13:38,796] org.glassfish.jersey.internal.Errors: 
The following warnings have been detected: WARNING: HK2 service
reification failed for [com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider] with an exception:
MultiException stack 1 of 2
java.lang.NoClassDefFoundError: javax/mail/MessagingException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2532)
at java.lang.Class.getDeclaredConstructors(Class.java:1901)
at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1310)
at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1306)
at java.security.AccessController.doPrivileged(Native Method)...
MultiException stack 2 of 3
java.lang.IllegalStateException: Unable to perform operation: method inject
on com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:395)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:69)..
MultiException stack 3 of 3
java.lang.IllegalStateException: Unable to perform operation:
create on org.glassfish.jersey.message.internal.MessageBodyFactory...
org.glassfish.hk2.api.MultiException: A MultiException has
3 exceptions. They are:
! 1. java.lang.NullPointerException
! 2. java.lang.IllegalStateException: Unable to perform operation:
method inject on com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
! 3. java.lang.IllegalStateException: Unable to perform operation:
create on org.glassfish.jersey.message.internal.MessageBodyFactory

最佳答案

根据我在 atmosphere's pom.xml 中看到的内容,他们使用 jersey 1.x 而 dropwizard 使用 jersey 2.x。而且这两个库相处得并不融洽。我相信 Atmosphere 没有直接支持 Jersey 2,至少在最新版本中也没有。

所以我猜你不能使用atmosphere-jersey但我看到我的同事正在使用 atmosphere-runtimeatmosphere-annotations使用 dropwizard 0.8 就好了。

关于compiler-errors - Atmosphere 、dropwizard 和 Jersey 注入(inject)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30019832/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com