[jboss-jira] [JBoss JIRA] (WFLY-2102) Improve deployment annotation parsing error message
Brad Maxwell (JIRA)
issues at jboss.org
Thu Nov 5 19:07:00 EST 2015
[ https://issues.jboss.org/browse/WFLY-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brad Maxwell updated WFLY-2102:
-------------------------------
Attachment: test-WFLY-2102.jar
Test deployment.
Debugging further, the issue is when using @Resource with name/mappedName/lookup = /...
If prefixed with a /
{code}
@Resource(mappedName="/ConnectionFactory")
private Object obj;
{code}
The /ConnectionFactory becomes relativeName: env//ConnectionFactory , there is a split("/") call, which results in an empty section because of the //. So it looks like we either need to handle when there is a / prefix or throw an error indicating that it should not start with /
parentName: service jboss.naming.context.java.comp.test-WFLY-2102.test-WFLY-2102.EE6ExampleSingleton relativeName: env//ConnectionFactory
{code}
org.jboss.as.naming.deployment.ContextNames.buildServiceName(ContextNames.java:-1)
org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:195)
org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:186)
org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:143)
org.jboss.as.ee.component.OptionalLookupInjectionSource.getResourceValue(OptionalLookupInjectionSource.java:84)
org.jboss.as.ee.component.ComponentDescription$InjectedConfigurator.configureDependency(ComponentDescription.java:544)
org.jboss.as.ee.component.ComponentDescription$InjectedConfigurator.configureDependency(ComponentDescription.java:523)
org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:147)
org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:98)
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980)
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
{code}
> Improve deployment annotation parsing error message
> -----------------------------------------------------
>
> Key: WFLY-2102
> URL: https://issues.jboss.org/browse/WFLY-2102
> Project: WildFly
> Issue Type: Enhancement
> Components: EE
> Reporter: Brad Maxwell
> Fix For: 11.0.0.Alpha1
>
> Attachments: test-WFLY-2102.jar
>
>
> Improve deployment annotation parsing error message
> Code such as this below, will error with IllegalArgumentException: Empty name segment is not allowed for env. The env is not enough information to identify what the issue is.
> @Singleton
> @Startup
> public class TestEJB {
> @Resource(name="/queue/test")
> private Queue queue;
> }
> Caused by: java.lang.IllegalArgumentException: Empty name segment is not allowed for env
> at org.jboss.msc.service.ServiceName.of(ServiceName.java:85) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
> at org.jboss.msc.service.ServiceName.append(ServiceName.java:112) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
> at org.jboss.as.naming.deployment.ContextNames.buildServiceName(ContextNames.java:183)
> at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:195)
> at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:186)
> at org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:141)
> at org.jboss.as.ee.component.OptionalLookupInjectionSource.getResourceValue(OptionalLookupInjectionSource.java:84)
> at org.jboss.as.ee.component.ComponentDescription$InjectedConfigurator.configureDependency(ComponentDescription.java:1019)
> at org.jboss.as.ee.component.ComponentDescription$InjectedConfigurator.configureDependency(ComponentDescription.java:998)
> at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:138)
> at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:95)
> ... 6 more
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list