`
bangsen
  • 浏览: 40562 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

WhatsTheCauseOfThisExceptionJavalangClassFormatErrorAbsentCode

    博客分类:
  • java
阅读更多

http://community.jboss.org/wiki/WhatsTheCauseOfThisExceptionJavalangClassFormatErrorAbsentCode

Background

 

When these artifacts were published to the Maven repository, Sun stripped out the code from classes that are classified as "implementations". So all the interfaces are code complete, yet any abstract class or implementation class has no code in it. Any attempt to use that class will likely blow up. That's why Arquillian is failing.

 

Here's an excerpt from the argument as to why Sun did this:

When one compiles, they want to run as well. By the way, we have been promoting full set of Java EE APIs which can only be used for compilation - they are stripped off method details. That way, user can't take those artifacts and try to use it in runtime.

The workaround is to not use javax.javaee-api but rather use the individual, "real" artifacts that you need. Unfortunately, there is no Maven scope available that will exclude a dependency from the test classpath.

 

There are two solutions to this problem.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics