[jboss-jira] [JBoss JIRA] Created: (JBAS-8948) Switchboard: Add configuration option to ResourceEnvRefProvider to not throw RuntimeException upon missing @Resource annotation
Daniel Bevenius (JIRA)
jira-events at lists.jboss.org
Mon Mar 14 03:47:45 EDT 2011
Switchboard: Add configuration option to ResourceEnvRefProvider to not throw RuntimeException upon missing @Resource annotation
-------------------------------------------------------------------------------------------------------------------------------
Key: JBAS-8948
URL: https://issues.jboss.org/browse/JBAS-8948
Project: JBoss Application Server
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Reporter: Daniel Bevenius
Assignee: jaikiran pai
Using a javax.annotation.Resource that is not intended for JBoss MC, perhaps Spring is being used, causes a RuntimeException to be throw upon startup of JBoss AS 6.0.0.Final.
For example, if you have a class that looks like this:
{code}
import javax.annotation.Resource;
public class AnnotatedClass
{
@Resource
public void setterMethodWithAnnotation(SampleClass sample)
{
}
}
{code}
And this class in packaged into a war and deployed the exception below will be thrown:
{noformat}
Caused by: java.lang.RuntimeException: Neither any mapped-name/lookup/jndi-name specified nor any ResourceProvider could process resource-env-ref named env/se.rl.pop.AnnotatedClass/terMethodWithAnnotation of type se.rl.pop.SampleClass
at org.jboss.switchboard.mc.resource.provider.ResourceEnvRefProvider.provide(ResourceEnvRefProvider.java:136) [:1.0.0-alpha-16-SNAPSHOT]
at org.jboss.switchboard.mc.resource.provider.ResourceEnvRefProvider.provide(ResourceEnvRefProvider.java:1) [:1.0.0-alpha-16-SNAPSHOT]
at org.jboss.switchboard.mc.JndiEnvironmentProcessor.process(JndiEnvironmentProcessor.java:68) [:1.0.0-alpha-16-SNAPSHOT]
at org.jboss.switchboard.mc.deployer.AbstractSwitchBoardDeployer.process(AbstractSwitchBoardDeployer.java:119) [:1.0.0-alpha-16-SNAPSHOT]
at org.jboss.switchboard.mc.deployer.WebEnvironmentSwitchBoardDeployer.internalDeploy(WebEnvironmentSwitchBoardDeployer.java:66) [:1.0.0-alpha-16-SNAPSHOT]
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
... 43 more
{noformat}
Resource scanning can be turned off by adding a jboss-scanning.xml to WEB-INF/META-INF but this jira suggests that a property be added to ResourceEnvRefProvider that configures if this class should throw a RuntimeException of just log a message. This would save users to have to add a jboss-scanning.xml to their deployments.
--
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