【问题标题】:Compatiblity Issue of asm 3.1 and org.eclipse.persistence.asm-2.3.2.jar (jersey-moxy 1.15)asm 3.1 和 org.eclipse.persistence.asm-2.3.2.jar (jersey-moxy 1.15) 的兼容性问题
【发布时间】:2012-12-22 17:22:45
【问题描述】:

Compatibility Issue of ASM 3.1 and HIbernate and JAX-RS 类似的问题 似乎击中了我: 我的基于 Jersey / JPA 的 rest 应用程序也使用 jersey-moxy(jersey 版本 1.15)引发错误:

Caused by: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassReader.accept(Lorg/eclipse/persistence/internal/libraries/asm/ClassVisitor;[Lorg/eclipse/persistence/internal/libraries/asm/Attribute;Z)V

我的maven依赖列表显示:

  • asm-3.1.jar
  • jersey-moxy-1.15.jar
  • org.eclipse.persistence.asm-2.3.2.jar

如果我从依赖项中删除 jersey-moxy 1.15,问题就会消失,但是我不能使用额外的 MOXy 功能。

如果排除 org.eclipse.persistence.asm 依赖项,我得到:

Internal Exception: java.lang.SecurityException: class "org.eclipse.persistence.sessions.factories.SessionManager"'s signer information does not match signer information of other classes in the same package

有什么办法可以解决这种情况?

【问题讨论】:

标签: java jersey eclipselink jax-rs moxy


【解决方案1】:

此问题与Compatibility Issue of ASM 3.1 and HIbernate and JAX-RS 不同。 EclipseLink 专门发布了一个重新打包的 ASM 版本来专门避免这个问题。

我不熟悉jersey-moxy-1.15.jar(您能否提供有关此的更多信息?)。 MOXy 需要以下捆绑包:

  • org.eclipse.persistence.moxy_2.4.1.v20121003-ad44345.jar
  • org.eclipse.persistence.core_2.4.1.v20121003-ad44345.jar
  • org.eclipse.persistence.asm_3.3.1.v201206041142.jar

如果您使用 MOXy 进行 JSON 绑定(请参阅 http://blog.bdoughan.com/2012/05/moxy-as-your-jax-rs-json-provider.html),那么您还需要以下捆绑包:

  • org.eclipse.persistence.antlr_3.2.0.v201206041011.jar

【讨论】:

  • 我很乐意接受这个答案,但到目前为止我无法让 MOXy 工作。我尝试了几次,但总是有奇怪的难以理解的问题。我会在我开始另一次尝试时发布。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-24
  • 2013-01-23
  • 2013-12-11
  • 2013-01-25
  • 2011-03-07
相关资源
最近更新 更多