java.lang.IncompatibleClassChangeError: Implementing class deploying to app engine

前端 未结 8 1109
迷失自我
迷失自我 2020-11-27 18:12

I wrote a couple of REST services using Jersey 1.13 on JRE 1.6. Everything runs fine locally, but after I deploy to GAE I get this error:

****Uncaught excep         


        
8条回答
  •  情书的邮戳
    2020-11-27 18:32

    Same problem here, but I believe I've fixed it!

    The trick was running a clean inside of eclipse, which notified me of the following error:

    java.lang.RuntimeException: Unexpected exception
        at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
        at com.google.appengine.tools.enhancer.Enhance.(Enhance.java:71)
        at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
    Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
        ... 2 more
    Caused by: org.datanucleus.exceptions.NucleusUserException: You seem to have ASM v3 in the CLASSPATH and you need ASM v4
        at org.datanucleus.enhancer.DataNucleusEnhancer.(DataNucleusEnhancer.java:173)
        at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1133)
        ... 7 more
    

    The important bit . . .

    Caused by: org.datanucleus.exceptions.NucleusUserException: You seem to have ASM v3 in the CLASSPATH and you need ASM v4

    Apparently, GAE does not like having two versions of ASM loaded. On a whim, I went into the eclipse project properties and changed the datanucleus version from v2 to v1. I redeployed and now my app works. So much for catching these kinds of issues in the local dev environment . . .

    I think I spent more time configuring GAE to run with jersey than I did actually writing the app. This may be my first and last GAE hosted app.

提交回复
热议问题