Random NoClassDefFound error in Web Application

 ̄綄美尐妖づ 提交于 2019-12-19 19:55:01

问题


Wondering if any guru out there could shed an idea on why the following randomly happens.

We have a web application we deploy in Jetty 6.1.26 running on a Linux installation with JRE 1.7_03

Not every time, but every now and then, when Jetty starts up - what appears to be a random class (from our project) seems to be the source of a NoClassDefFound error. If we restart Jetty they problem disappears.

The only pattern that occurs seems to be the classes at the root of the error are populated via JAXB annotations.

To give more of an idea of the frequency it feels this happens 1/50 times, if that.

I would be interested to know the how and the why for this error.


回答1:


Not sure this can help but we ran into annotations problems with Jetty 8 and java 6. To make a long story short, annotations processing in that version seem to rely on libasm e.g. bytecode inspection. So we have to be careful with

  • what we compile our classes with (e.g; JDK version, etc...)
  • that we do not pull multiple asm/javassist librairies through our dependencies and end up loading the wrong one

I am not familiar with with the way Jetty 6 and Jaxb process annotations but I am actually surprised you can get both running on Java 7. Can you try running you code with Java 6 ?



来源:https://stackoverflow.com/questions/12705355/random-noclassdeffound-error-in-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!