[jboss-jira] [JBoss JIRA] Commented: (AS7-960) @Resource declaration validation seems to be too strict

jaikiran pai (JIRA) jira-events at lists.jboss.org
Tue Jun 7 13:13:59 EDT 2011


    [ https://issues.jboss.org/browse/AS7-960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12606903#comment-12606903 ] 

jaikiran pai commented on AS7-960:
----------------------------------

{quote}
The problem is that you could later deploy a JAR which has, say, @Interceptor(YourClass.class) in it with a class-path reference to the original deployment.

If we want to allow this kind of deployment and then have it fail later only in the event that the class is referenced, we need an intermediate registry for this stuff I would think.
{quote}

I don't think we should be processing annotations on YourClass.class, till the point where it's either a component class or a component supporting class (for example @Interceptor). 

Also, I don't see how the above scenario of adding a new deployment with a @Interceptor, pointing to a already deployed deployment, *at a later point* would work, since the Component would already have been constructed without this @Interceptor.

> @Resource declaration validation seems to be too strict 
> --------------------------------------------------------
>
>                 Key: AS7-960
>                 URL: https://issues.jboss.org/browse/AS7-960
>             Project: Application Server 7
>          Issue Type: Bug
>         Environment: running against commit a004da8272d7717225bfa1bc65534bb4b599bc1b
>            Reporter: Matt Drees
>            Assignee: Stuart Douglas
>
> I have a third-party library in my app that has a (non-necessary) class in it that declares a @Resource that looks like this:
> {{@Resource ( name = "service-bean-interceptors" )}}
> This class is not referenced by any deployment descriptor in my project.  However, AS7 fails to deploy my app with this message:
> {noformat}
> 11:54:04,894 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."ccp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ccp.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "ccp.war"
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
> 	at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Can't handle @Resource for ENC name: service-bean-interceptors since it's missing a "lookup" (or "mappedName") value and isn't of any known type
> 	at org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor.process(ResourceInjectionAnnotationParsingProcessor.java:224)
> 	at org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor.processMethodResource(ResourceInjectionAnnotationParsingProcessor.java:183)
> 	at org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor.deploy(ResourceInjectionAnnotationParsingProcessor.java:134)
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
> 	... 4 more
> 11:54:04,897 INFO  [org.jboss.as.server] (MSC service thread 1-4) Service status report
>   Services which failed to start:
>       service jboss.deployment.unit."ccp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ccp.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "ccp.war"
> {noformat}
> I think AS7 should instead ignore this class.  
> See the linked forum thread for more info.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list