Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-1560

resource-ref without a specific mapped name or lookup name leads to circular service dependency exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.Beta1, 7.0.2.Final
    • None
    • EE
    • None
    • Workaround Exists
    • Hide

      Add an explicit lookup-name to point to the jndi name from where the resource can be fetched from and bound into ENC.

      Show
      Add an explicit lookup-name to point to the jndi name from where the resource can be fetched from and bound into ENC.

    Description

      Consider the following in web.xml (as an example):

        <resource-ref>
          <res-ref-name>jdbc/DB1</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
          <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
      

      This results in a BindingConfiguration for jdbc/DB1 whose injection source is a LookupInjectionSource pointing (back) to jdbc/DB1 which ultimately leads to:

      23:52:34,088 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."multiple-bindings-superclass.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."multiple-bindings-superclass.war".INSTALL: Failed to process phase INSTALL of deployment "multiple-bindings-superclass.war"
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
      	at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]
      	at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
      Caused by: org.jboss.msc.service.CircularDependencyException: Service jboss-as has a circular dependency
      	at org.jboss.msc.service.ServiceContainerImpl.detectCircularity(ServiceContainerImpl.java:617)
      	at org.jboss.msc.service.ServiceContainerImpl.detectCircularity(ServiceContainerImpl.java:588)
      	at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:562)
      	at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
      	at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2194)
      	at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
      	at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2194)
      	at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)
      	at org.jboss.as.ee.component.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:191)
      	at org.jboss.as.ee.component.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:88)
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
      	... 5 more
      

      Note that the configuration above is missing a lookup-name or an explicit pointer to where the resource is going to come from, to bind it to the ENC. In previous versions we just threw an error about incomplete data (i.e. no explicit lookupname or mapped name configured) to generate that binding. I think we need to do the same in AS7.

      Note that the problem probably isn't specific to resource-ref and might involve env-entry, @Resource and other such binding/injection configurations.

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            jaikiran Jaikiran Pai (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: