3

this is a follow-up post to the twitter discussion i had on Google App Engine (Twitter Conversation)

The Problem is that Jersey and GAE won't work together with datanuceleus 2.0, since GAE needs ASM 4.0 but Jersey needs 3.1. A detailed description and easy solution on that is available here: GAE and Jersey Problem description

There are several posts on questions here on Stackoverflow, so I opened this thread to collaborate with Google's Teams to solve this issue.

I simply switched from Datanuceleus 2.0 to 1.0 and Jersey was working again. Do you have any other suggestions? Especially since 2.0 would be great to use.

Greetings,

Mario

4

3 回答 3

4

另一种解决方案是使用 Jersey 的 1.18.1 版本,它不再依赖于 asm 3.0,并且包含重新打包的 asm 版本,您可以在这里查看:http: //mvnrepository.com/artifact/com.sun.jersey/ jersey-bundle/1.18.1 这将在 GAE 中工作。

于 2014-05-17T10:09:58.010 回答
2

您应该尝试jarjar,它将一个 jar 嵌入另一个 jar 并修复字节码级别的代码引用。

请参阅这篇出色的博文:http: //blog.harrywye.com/post/30160964741/running-java-jersey-with-jdo-3-0-on-google-app-engine

于 2012-09-26T21:55:49.470 回答
0

正如@peter-knego 所说,使用jarjar非常简单,您仍然可以使用 JDO/JPA > 1.0

  1. 下载jarjar
  2. 创建一个文本文件:testrules.txt具有以下内容:

规则 org.objectweb.asm.** org.objectweb.asm3.@1

  1. 使用 asm-3.1.jar 和 jersey-server-1.1.5-ea-SNAPSHOT.jar (或任何你有的)执行以下命令:

java -jar jarjar-1.4.jar 进程 testrules.txt asm-3.1.jar asm-3.1r.jar

java -jar jarjar-1.4.jar 进程 testrules.txt jersey-server-1.1.5-ea-SNAPSHOT.jar jjersey-server-1.1.5r-ea-SNAPSHOT.jar

最后,只需将 asm-3.1.jar 和 jersey-server-1.1.5-ea-SNAPSHOT.jar 替换为重新打包的库即可。

我将它与 1.8.3 SDK 一起使用,它对我有用。

参考这里

于 2013-08-21T15:15:32.407 回答