jaikiran pai [
http://community.jboss.org/people/jaikiran] created the discussion
"Annotation processing in war files too aggressive?"
To view the discussion, visit:
http://community.jboss.org/message/547701#547701
--------------------------------------------------------------
I have got a simple war file which contains an EJB3 bean (testing against AS trunk). The
bean looks like this:
@Stateless
public class SimpleSLSB extends SimpleBase
{
...
The SimpleBase class (from which this bean extends) looks like:
public class SimpleBase
{
@Resource
private EJBContext ejbContext;
So this base class is just a POJO with @Resource injection for EJBContext. During
deployment of this .war on AS trunk, the web application deployer incorrectly starts
processing this SimpleBase class and throws this exception:
14:32:31,422 ERROR [StandardContext] Context [/myapp] startup failed due to previous
errors: java.lang.RuntimeException: mapped-name is required for
org.myapp.ejb3.impl.SimpleBase/ejbContext of deployment myapp.war
at
org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHandler.java:287)
[:6.0.0-SNAPSHOT]
at
org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:325)
[:6.0.0-SNAPSHOT]
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:593)
[:6.0.0-SNAPSHOT]
at org.jboss.web.tomcat.service.WebCtxLoader.start(WebCtxLoader.java:157)
[:6.0.0-SNAPSHOT]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3737) [:]
at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:309)
[:6.0.0-SNAPSHOT]
at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:144)
[:6.0.0-SNAPSHOT]
at
org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
[:6.0.0-SNAPSHOT]
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:116)
[:6.0.0-SNAPSHOT]
at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0-SNAPSHOT]
The real issue here is that the WarAnnotationDeployer picks up this SimpleBase class for
annotation processing and creates metadata for @Resource and adds it to the WebAppMetaData
(resourceEnvRefGroups).
Shouldn't the annotation deployer just pick up servlets (and maybe some additional
classes for Servlet 3.0 spec?) for annotation processing? IMO, the SimpleBase class should
have been completely skipped from annotation processing in the WarAnnotationDeployer.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/547701#547701]
Start a new discussion in JBoss Web Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]