6 Replies Latest reply on Mar 11, 2013 10:23 AM by ibek

    Minimal switchyard.xml

    ibek

      Hi,

       

      according to https://github.com/jboss-switchyard/core/blob/master/config/src/main/resources/org/switchyard/config/model/switchyard/v1/switchyard-v1.xsd I assume that minimal switchyard.xml should be:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <switchyard xmlns="urn:switchyard-config:switchyard:1.0" name="orders" targetNamespace="urn:abcd:1.0">

      </switchyard>

       

      but when I try to deploy the archive ... SY throws NPE

       

      10:33:28,570 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.subunit."auditing.ear"."integration-qa-audit-1.0.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.subunit."auditing.ear"."integration-qa-audit-1.0.jar".SwitchYardService: java.lang.NullPointerException

          at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:85)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

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

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

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: java.lang.NullPointerException

          at org.switchyard.deploy.internal.Deployment.getActivationTypes(Deployment.java:214)

          at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:101)

          at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:78)

          ... 5 more

       

      Is it a bug or the switchyard.xml has to contain any composite of services? I just wanted to try sharing the Auditing classes in EAR, so for that I don't need any service.

        • 1. Re: Minimal switchyard.xml
          kcbabo

          This is definitely a bug, if for no other reason than we need to be more expressive in the error output.  Auditing classes will only apply to the application you are deploying, so I'm not sure an empty switchyard.xml with auditors in it will get you what you want.

          • 2. Re: Minimal switchyard.xml
            ibek

            Ok, I file a jira then ....

             

            To make it clear ... I have EAR with the auditing JAR and some services in another JARs .... the important thing is ... I set ear-subdeployments-isolated to false in jboss-deployment-structure.xml .... and it really seems that it will work.

            • 3. Re: Minimal switchyard.xml
              kcbabo

              This implies that you have multiple switchyard.xml descriptors though, right?  If so, I would be shocked if that worked.

              • 4. Re: Minimal switchyard.xml
                ibek

                Yes I have multiple switchyard.xml descriptors ... well I tried the EAR from the EarDeploymentTest which is in switchyard-release ... and I found only one problem - when services don't have unique names (e.g. OrderService). Because there are more of the OrderServices in the EAR archive. It causes some exceptions when I try to call them but camel_binding worked for example.

                • 5. Re: Minimal switchyard.xml
                  kcbabo

                  Each switchyard.xml is going to map to a service domain and auditors are scoped to a domain, so you won't be able to introduce a higher-level auditor in the top of the EAR and have it apply to all sub-deployments.  It's an interesting idea though, but it will have to wait for shared service domains post SY 1.0.

                  • 6. Re: Minimal switchyard.xml
                    ibek

                    Oh, ok ... thank you for the clarification .... I think that because the auditors are visible to each switchyard.xml deployment, they will be probably loaded to every service domain .. don't you think? ... I still have some problems in my auditing classes ... but when I try to put them into one of the JAR with any service, other deployments also try to load auditors. I know it because the auditors use remote EJB which is not present anywhere. - it causes a specific exception for each deployment. And that's my proof

                     

                    Part of the exception:

                     

                    org.apache.camel.FailedToCreateRouteException: Failed to create route direct:{urn:switchyard-quickstart:camel-soap-proxy:1.0}ReverseService at: >>> OnException[[class java.lang.Throwable] -> [Filter[{IN_OUT_CHECK} -> [process[ref:DOMAIN_HANDLERS], process[ref:VALIDATION], process[ref:TRANSFORMATION], process[ref:VALIDATION], process[ref:CONSUMER_CALLBACK]]]]] <<< in route: Route[[From[direct:{urn:switchyard-quickstart:camel-soap-pro... because of Service service jboss.naming.context.java.global."soa-integration-qa-audit-1.0".AuditService not found