气氛,dropwizard和球衣注射错误

时间:2022-12-03 19:33:21

Here is my gradle file:

这是我的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'

After adding atmosphere-jursey I am getting below error:

添加氛围-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

1 个解决方案

#1


From what I can see in atmosphere's pom.xml, they are using jersey 1.x while dropwizard uses jersey 2.x. And these two libraries don't get along well together. I believe atmosphere doesn't have jersey 2 support directly, at least not in the latest version either.

从我在大气层的pom.xml中可以看到,他们使用的是jersey 1.x而dropwizard使用的是2.x.这两个图书馆并不能很好地相处。我相信大气层没有直接支持球衣2,至少在最新版本中也没有。

So I guess you can't utilize atmosphere-jersey but I see my colleague is using atmosphere-runtime and atmosphere-annotations with dropwizard 0.8 just fine.

所以我猜你不能利用大气球衣,但我看到我的同事正在使用大气运行时和氛围注释与dropwizard 0.8就好了。

#1


From what I can see in atmosphere's pom.xml, they are using jersey 1.x while dropwizard uses jersey 2.x. And these two libraries don't get along well together. I believe atmosphere doesn't have jersey 2 support directly, at least not in the latest version either.

从我在大气层的pom.xml中可以看到,他们使用的是jersey 1.x而dropwizard使用的是2.x.这两个图书馆并不能很好地相处。我相信大气层没有直接支持球衣2,至少在最新版本中也没有。

So I guess you can't utilize atmosphere-jersey but I see my colleague is using atmosphere-runtime and atmosphere-annotations with dropwizard 0.8 just fine.

所以我猜你不能利用大气球衣,但我看到我的同事正在使用大气运行时和氛围注释与dropwizard 0.8就好了。