Jersey exception only thrown when depencencies assembled into a single jar

后端 未结 2 525
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 04:48

I\'m writing a server that embeds Jetty w/ Jersey. When I execute from Eclipse, everything is great. However, if I assemble my server and all dependencies into a single ja

2条回答
  •  广开言路
    2020-12-05 05:15

    You are not merging Jersey jars correctly.

    Jersey 1.x uses META-INF/services mechanism to discover its components and assembly:single probably just copies everything into single jar, overriding already present files BUT META-INF/services file(s) needs to be CONCATENATED.

    Try using jersey-bundle (com.sun.jersey:jersey-bundle:1.14) or fix your assembly settings (or find another plugin to do it better).

提交回复
热议问题