4 Replies Latest reply on Jan 17, 2013 10:55 AM by cgeer_cxt

    "Unsatisfied Requirement" while deploying profile

    cgeer_cxt

      I'm trying to deploy our application under Fuse Fabric and running into issues. Our application has two profiles (A & B) where B's parent is A. When I deploy A by itself, everything goes fine, bundles deploy, services get published (specifically a JDBC DataSource). When I try and deploy B I keep getting Unsatisfied Requirement exceptions like the error below. I've even tried making them unrelated profiles and deploying A first, verifying the services are present then deploying B and I get the same error. When looking at the logs it seems like it's checking for the presence of the service prior to actually deploying any bundles which obviously wont' work (at least there is no proof the bundles are being installed in the logs even on TRACE). On a side note, if I use Fuse Enterprise ESB 7.1 outside a fabric the application installs just fine. Is there anything I can do to debug or fix this?

       

      2013-01-14 16:38:20,884 | ERROR | agent-1-thread-1 | DeploymentAgent                  | e.fabric.agent.DeploymentAgent$1  241 | 67 - org.fusesource.fabric.fabric-agent - 7.1.0.fuse-047 | Unable to update agent

      java.lang.Exception: Can not resolve feature:

      Unsatisfied requirement(s):

      -


         service:(service=javax.sql.DataSource)

            Security Implementation

       

           at org.fusesource.fabric.agent.ObrResolver.resolve(ObrResolver.java:200)[67:org.fusesource.fabric.fabric-agent:7.1.0.fuse-047]

           at org.fusesource.fabric.agent.DeploymentAgent.updateDeployment(DeploymentAgent.java:554)[67:org.fusesource.fabric.fabric-agent:7.1.0.fuse-047]

           at org.fusesource.fabric.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:428)[67:org.fusesource.fabric.fabric-agent:7.1.0.fuse-047]

           at org.fusesource.fabric.agent.DeploymentAgent$1.run(DeploymentAgent.java:238)[67:org.fusesource.fabric.fabric-agent:7.1.0.fuse-047]

           at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)[:1.6.0_37]

           at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_37]

           at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_37]

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_37]

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_37]

           at java.lang.Thread.run(Thread.java:680)[:1.6.0_37]

        • 1. Re: "Unsatisfied Requirement" while deploying profile
          iocanel

          It seems that there are bundles in profile B that have osgi headers such as Import-Service: javax.sql.DataSource, but not bundles with Exports-Service: javax.sql.DataSource. The deployment agent translates that as an unsatisfied dependency.

           

          So if you are expressing a dependency on javax.sql.DataSource, you need to make sure that you also express the capability javax.sql.DataSource on the bundle that provides it.

           

          In case you are wondering, how did the Import-Service header was added to your bundle, then most probably you are using blueprint, which automatically add that property to your bundle headers when you have non optional references.

           

          The quickest win for you is to find the bundle that should export javax.sql.DataSource and add the Export-Service headers there.

          • 2. Re: "Unsatisfied Requirement" while deploying profile
            cgeer_cxt

            Ok, that makes sense because I'm publishing that service from a factory so Maven isn't automatically adding that line. So I can fix that for my bean but I'm having a similar error for PlatformTransactionManager (which is needed for Camel routes with transactions). That service is provided by Aries Transaction Manager however there is no ExportService line for that.

             

            Apache Aries Transaction Manager (361) provides:

            -


            objectClass = org.osgi.service.cm.ManagedService

            service.id = 382

            service.pid = org.apache.aries.transaction

            -


            objectClass = javax.transaction.TransactionManager, javax.transaction.TransactionSynchronizationRegistry, javax.transaction.UserTransaction, org.apache.geronimo.transaction.manager.RecoverableTransactionManager, org.springframework.transaction.PlatformTransactionManager

            service.id = 386

            admin@p141> headers 361

             

            Apache Aries Transaction Manager (361)

            -


            Manifest-Version = 1.0

            Bnd-LastModified = 1355855245371

            Tool = Bnd-1.15.0

            Built-By = root

            Implementation-Version = 1.0.1.fuse-71-047

            Build-Jdk = 1.6.0_22

            Implementation-Title = Apache Aries

            Created-By = Apache Maven Bundle Plugin

             

            Bundle-Vendor = The Apache Software Foundation

            Bundle-Activator = org.apache.aries.transaction.Activator

            Bundle-Name = Apache Aries Transaction Manager

            Bundle-DocURL = http://www.apache.org

            Bundle-Description = Aries top-level parent pom

            Bundle-SymbolicName = org.apache.aries.transaction.manager

            Bundle-Version = 1.0.1.fuse-71-047

            Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt

            Bundle-ManifestVersion = 2

             

            Export-Service =

                 javax.transaction.TransactionManager,

                 javax.transaction.TransactionSynchronizationRegistry,

                 javax.transaction.UserTransaction,

                 org.apache.geronimo.transaction.manager.RecoverableTransactionManager

             

            Import-Package =

                 javax.resource.spi;resolution:=optional;version="[1.6,2)",

                 javax.transaction;version="[1.1,2)",

                 javax.transaction.xa;version="[1.1,2)",

                 org.apache.aries.util;version="[1.0,2)",

                 org.apache.aries.util.nls;version="[1.0,2)",

                 org.osgi.framework;version="[1.4,2)",

                 org.osgi.service.cm;version="[1.2,2)",

                 org.slf4j;version="[1.5,2)",

                 org.springframework.transaction;resolution:=optional;version="[2.5,4)",

                 org.springframework.transaction.jta;resolution:=optional;version="[2.5,4)",

                 org.springframework.transaction.support;resolution:=optional;version="[2.5,4)"

            Export-Package =

                 org.apache.geronimo.transaction.manager;uses:="javax.transaction,javax.transaction.xa,org.slf4j,javax.resource.spi,org.apache.geronimo.transaction.log";version=2.2.1,

                 org.apache.geronimo.transaction.log;uses:="javax.transaction.xa,org.apache.geronimo.transaction.manager,org.slf4j";version=2.2.1,

                 org.apache.geronimo.transaction;uses:=javax.transaction;version=2.2.1,

                 javax.transaction;uses:=javax.transaction.xa;version=1.1.0,

                 javax.transaction.xa;version=1.1.0

            • 3. Re: "Unsatisfied Requirement" while deploying profile
              iocanel

              For bundles that you don't control yourslef maybe you need to remove the Import-Service header from your bundle. Making the reference optional will do that for you anyway. The alternative is to set a custom Export-Service header.

              • 4. Re: "Unsatisfied Requirement" while deploying profile
                cgeer_cxt

                Thanks. I went ahead and filed a bug with Aries to see if that could be handled inside the Transaction Manager. I'll try and figure out a work around in the mean time. It's not really optional so that doesn't feel right so I'll keep digging.

                 

                https://issues.apache.org/jira/browse/ARIES-1002