Search code examples
javaejbapache-tomee

Meaning of warning "ejb-api-3.0.jar' contains offending class: javax.ejb.EJB" when deploying EJB project


When I deployed my web apps with EJB 3.0, I saw this warning:

WARNING: jar 'E:\mws\MCDS\portal\portal-web\target\portal-web-1.0.0\WEB-INF\lib\ejb-api-3.0.jar' contains offending class: javax.ejb.EJB. It will be ignored.

My web apps started normally but I want to know why warning appeared and would it be a serious problems.

Im new for EJB and maybe this is dumb question. Thank you for reading.


Solution

  • You are getting this warning because you have included the ejb-api-3.0.jar in your application. The classes in this jar are provided by the server implementation that you're using, so should not be packaged in your application.

    §15.2.1 of the Servlet (3.0/3.1) Specification states that:

    Servlet containers that are part of a Java EE product should not allow the application to override Java SE or Java EE platform classes, such as those in java.* and javax.* namespaces, that either Java SE or Java EE do not allow to be modified.