2 Replies Latest reply on Jan 14, 2015 8:35 AM by Jorge Morales

    Adding required dependencies

    Jorge Morales Master

      Hi,

      I have an application where I'm packaging my SwitchYard projects in an .ear package.

      Now, I have created a new MessageComposer (not extending the ones available) and placed it in a .jar in the lib of the ear.

      The problem that I have is that when running my MessageComposer, there are some ClassNotFound exceptions for SwitchYard classes.

      I have added a jboss-deployment-structure.xml with some dependencies in there (mainly I copied those that the module having the Camel composer have).

       

      Now, my question is, shouldn't the ear be detected as a switchyard deployment and add this dependencies for me? I've seen that many modules do not export their dependencies, so there is a lot of boilerplate to cover there.

      Is there an easy way to do this?

       

      Thanks

        • 1. Re: Adding required dependencies
          Keith Babo Master

          Which module dependencies did you have to add in to your app?  The most likely cause of this is that we automatically add dependencies in our deployer based on the components configured for the SY subsystem in standalone.xml. It's possible we could add some core modules by default or we could export key dependencies from certain runtime modules.

          • 2. Re: Adding required dependencies
            Jorge Morales Master

            We had to add the dependency for "org.switchyard.component.common.camel" module, so:

             

                    <module name="javax.api"/>

                    <module name="javax.ws.rs.api"/>

                    <module name="org.jboss.logging"/>


                    <module name="org.switchyard.api"/>

                    <module name="org.switchyard.config"/>

                    <module name="org.switchyard.deploy"/>

                    <module name="org.springframework"/>

                    <module name="org.apache.camel.core"/>

                    <module name="org.apache.camel.spring"/>

                    <module name="org.switchyard.common"/>

                    <module name="org.switchyard.common.camel"/>

                    <module name="org.switchyard.component.common"/>

             

            Initially it was complaining it couldn't find BaseMessageComposer, so we added last two, then couldn't find camel's Message, so we added org.apache.camel.core and the rest, just for safety, but one of the failing one is already in the subsystem.

             

            I guess that as the jar does not have a switchyard.xml is not treated as a SwitchYard app, and thus the SwitchYardDependencyProcessor does not add them.

             

            But from my point of view, as this jar is in a SwitchYard ear, it should provide it, unless there is some type of isolation to the jars deployed as ear's lib, in which case we can a) continue adding all of this boilerplate or b) package in a different way.