9 Replies Latest reply on Jul 13, 2012 11:32 PM by jdestef

    Camel HL7 component

    jdestef

      Hi,

       

      Trying to set up the camel hl7 component. I added additional modules to the server module directory for camel mina and camel hl7. The module.xml files look like this:

       

      jboss_server_root/modules/org/apache/camel/hl7/main:

       

      {code:xml}

      <module xmlns="urn:jboss:module:1.0" name="org.apache.camel.hl7">

       

          <resources>

              <resource-root path="camel-hl7-2.9.2.jar"/>

          </resources>

       

          <dependencies>

              <module name="javax.api"/>

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

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

              <module name="org.apache.commons.logging"/>

              <module name="org.springframework"/>

              <module name="org.slf4j"/>

          </dependencies>

      </module>

      {code}

       

      jboss_server_root/modules/org/apache/camel/mina/main:

       

      {code:xml}

      <module xmlns="urn:jboss:module:1.0" name="org.apache.camel.mina">

       

          <resources>

              <resource-root path="camel-mina-2.9.2.jar"/>

          </resources>

       

          <dependencies>

              <module name="javax.api"/>

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

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

              <module name="org.apache.commons.logging"/>

              <module name="org.springframework"/>

              <module name="org.slf4j"/>

          </dependencies>

      </module>

      {code}

       

      I added dependencies to the project manifest.mf as follows:

       

      Dependencies: org.apache.mina, org.apache.camel.mina, org.apache.camel.hl7

       

      The documentation on the Camel site for the hl7 component has a uri that looks like this:

       

      mina:tcp://localhost:8888?sync=true&amp;codec=#hl7codec

       

      For the last parameter, codec, I tried just creating a named bean (in the source attached). Camel uses spring to configure this parameter. Not quite sure what would be analogous in Switchyard.

       

      The switchyard.xml is as follows:

       

      {code:xml}

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

      <switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:bean="urn:switchyard-component-bean:config:1.0" xmlns:camel="urn:switchyard-component-camel:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="test_hl7" targetNamespace="urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT">

        <sca:composite name="test_hl7" targetNamespace="urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT">

          <sca:service name="MessageReaderService" promote="MessageReaderServiceBean/MessageReaderService">

            <sca:interface.java interface="com.example.switchyard.test_hl7.MessageReaderService"/>

            <camel:binding.camel configURI="mina:tcp://localhost:8888?sync=true&amp;codec=#hl7Codec"/>

          </sca:service>

          <sca:component name="MessageReaderServiceBean">

            <bean:implementation.bean class="com.example.switchyard.test_hl7.MessageReaderServiceBean"/>

            <sca:service name="MessageReaderService">

              <sca:interface.java interface="com.example.switchyard.test_hl7.MessageReaderService"/>

            </sca:service>

          </sca:component>

        </sca:composite>

      </switchyard>

      {code}

       

      When I deploy I get the following exception:

       

      09:30:43,304 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina

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

                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.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

      Caused by: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina

                at org.switchyard.component.camel.InboundHandler.<init>(InboundHandler.java:81)

                at org.switchyard.component.camel.deploy.CamelActivator.activateBinding(CamelActivator.java:123)

                at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:428)

                at org.switchyard.deploy.internal.Deployment.start(Deployment.java:141)

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

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

                ... 5 more

      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina

                at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:173)

                at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:709)

                at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1733)

                at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:653)

                at org.apache.camel.impl.DefaultCamelContext.addRouteDefinition(DefaultCamelContext.java:658)

                at org.switchyard.component.camel.InboundHandler.<init>(InboundHandler.java:79)

                ... 10 more

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina

                at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:461)

                at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)

                at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:183)

                at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)

                at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)

                at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)

                at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)

                at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:833)

                at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:168)

                ... 15 more

       

      09:30:43,315 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "test_hl7.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina"}}

      09:30:43,316 INFO  [org.jboss.weld.deployer] (MSC service thread 1-14) JBAS016009: Stopping weld service for deployment test_hl7.jar

      09:30:43,323 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015877: Stopped deployment test_hl7.jar in 8ms

      09:30:43,324 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina

       

      09:30:43,326 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test_hl7.jar\".SwitchYardService: org.switchyard.exception.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService-[mina:tcp://localhost:8888?sync=true&codec=#hl7Codec]: Route[[From[mina:tcp://localhost:8888?sync=true&codec=#hl7Co... because of Failed to resolve endpoint: mina://tcp://localhost:8888?codec=%23hl7Codec&sync=true due to: No component found with scheme: mina"}}}}

       

      I've attached the project.

       

      Thanks in advance for any help you can provide.

        • 1. Re: Camel HL7 component
          rcernich

          Hey John,

           

          I didn't look in any detail, but I think you need to do more work on the module side of things.  I'm pretty sure you need to add your Camel modules to the SwitchYard Camel component module (org/switchyard/component/camel/main/module.xml).  You should be able to figure out what you need to do just by looking at how the other Camel components are configured in there.

           

          Hope that helps you get a bit further.

           

          Best,

          Rob

          • 2. Re: Camel HL7 component
            jdestef

            Thanks Rob, I'll give that a try.

            • 3. Re: Camel HL7 component
              splatch

              Hey John,

              You don't need module for mina - it's present in Switchyard 0.5. For HL7 you need to put import/export definitions.

               

              <module name="org.apache.camel.spring" services="export" export="true">
                <imports>
                  <include path="META-INF/services/org/apache/camel/dataformat"/>
                </imports>
                <exports>
                  <include path="META-INF/services/org/apache/camel/dataformat"/>
                </exports>
              </module>
              

               

              Then you will be able to use HL7 dataformat in camel mediations. To use HL7 classes you don't need these entries. Also check if your JBoss instance contains any startup errors. If modules are wrong or can not be read AS produces

              • 4. Re: Camel HL7 component
                jdestef

                Hi Guys,

                 

                Thanks for the help. I was able to get much farther. The version of mina that comes with JBoss AS7 is not compatible with the camel HL7 module so I added the required version (1.1.7) in the modules directory. I referenced that one in my hl7 module.xml:

                 

                <module xmlns="urn:jboss:module:1.0" name="org.apache.camel.hl7">

                    <resources>

                        <resource-root path="camel-hl7-2.9.2.jar"/>

                    </resources>

                    <dependencies>

                        <module name="javax.api"/>

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

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

                        <module name="org.apache.commons.logging"/>

                        <module name="org.springframework"/>

                        <module name="org.slf4j"/>

                        <module name="org.apache.camel.spring" services="export" export="true">

                            <imports>

                                <include path="META-INF/services/org/apache/camel/dataformat"/>

                            </imports>

                            <exports>

                                <include path="META-INF/services/org/apache/camel/dataformat"/>

                            </exports>

                        </module>

                        <module name="org.apache.mina.mina-core" slot="1.1.7"/>

                        <module name="ca.uhn.hapi"/>

                    </dependencies>

                </module>

                 

                My MANIFEST file now looks like this:

                 

                Dependencies: org.apache.mina:1.1.7, org.apache.camel.mina, org.apache.camel.hl7, ca.uhn.hapi

                 

                Also had to add a module for the require hapi libraries (ca.uhn.hapi).

                 

                <module xmlns="urn:jboss:module:1.0" name="ca.uhn.hapi">

                    <resources>

                        <resource-root path="hapi-base-1.2.jar"/>

                        <resource-root path="hapi-structures-v21-1.2.jar"/>

                        <resource-root path="hapi-structures-v22-1.2.jar"/>

                        <resource-root path="hapi-structures-v23-1.2.jar"/>

                        <resource-root path="hapi-structures-v24-1.2.jar"/>

                        <resource-root path="hapi-structures-v25-1.2.jar"/>

                        <resource-root path="hapi-structures-v26-1.2.jar"/>

                        <resource-root path="hapi-structures-v231-1.2.jar"/>

                        <resource-root path="hapi-structures-v251-1.2.jar"/>

                    </resources>

                    <dependencies>

                        <module name="javax.api"/>

                    </dependencies>

                </module>

                 

                I am now able to send HL7 messages and return an ACK from a method with this signature: public String readMessage(String msg);

                 

                I would like to be able to use the hapi message format with a method signature like "public Message readMessage(Message msg)". The documentation on the camel-hl7 page shows some examples using this type of interchange. When I deploy the switchyard app with the this method signature I get a class not found exception.

                 

                23:09:25,268 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-14) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.example.switchyard.test_hl7.MessageReaderServiceBean

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:108) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:123) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

                          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

                Caused by: java.lang.NoClassDefFoundError: ca/uhn/hl7v2/model/Message

                          at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.7.0_04]

                          at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) [rt.jar:1.7.0_04]

                          at java.lang.Class.getDeclaredMethods(Class.java:1808) [rt.jar:1.7.0_04]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:175) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethods(SecureReflections.java:172) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:234) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:119) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:59) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

                          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:163) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          ... 12 more

                Caused by: java.lang.ClassNotFoundException: ca.uhn.hl7v2.model.Message from [Module "deployment.test_hl7.jar:main" from Service Module Loader]

                          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                          ... 30 more

                 

                23:09:25,279 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-14) WELD-000119 Not generating any bean definitions from com.example.switchyard.test_hl7.MessageReaderService because of underlying class loading error

                23:09:25,279 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-14) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.example.switchyard.test_hl7.MessageReaderService

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:108) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:123) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

                          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

                Caused by: java.lang.NoClassDefFoundError: ca/uhn/hl7v2/model/Message

                          at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.7.0_04]

                          at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) [rt.jar:1.7.0_04]

                          at java.lang.Class.getDeclaredMethods(Class.java:1808) [rt.jar:1.7.0_04]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:175) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethods(SecureReflections.java:172) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:234) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:119) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:59) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

                          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:163) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

                          ... 12 more

                Caused by: java.lang.ClassNotFoundException: ca.uhn.hl7v2.model.Message from [Module "deployment.test_hl7.jar:main" from Service Module Loader]

                          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                          ... 30 more

                 

                23:09:25,314 INFO  [org.switchyard] (MSC service thread 1-8) Starting SwitchYard service

                23:09:25,389 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.switchyard.exception.SwitchYardException: Unknown Service name '{urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService'.

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

                          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.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

                          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

                Caused by: org.switchyard.exception.SwitchYardException: Unknown Service name '{urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService'.

                          at org.switchyard.component.bean.deploy.BeanComponentActivator.activateService(BeanComponentActivator.java:82)

                          at org.switchyard.deploy.internal.Deployment.deployImplementations(Deployment.java:390)

                          at org.switchyard.deploy.internal.Deployment.start(Deployment.java:140)

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

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

                          ... 5 more

                 

                23:09:25,393 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

                JBAS014777:   Services which failed to start:      service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test_hl7.jar".SwitchYardService: org.switchyard.exception.SwitchYardException: Unknown Service name '{urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService'.

                 

                 

                The class ca.uhn.hl7v2.model.Message is contained in one of the jars referenced in the ca.uhn.hapi module (above). This module is also listed in the MANIFEST dependencies. Not sure why this doesn't work?

                 

                Also, when I use the String readMessage(String msg) approach I would expect to see the Camel properties for the HL7 dataformat (in hl7 module.xml under camel spring module) in the switchyard context (listed under message headers on the camel hl7 documentation page). Here is what I get:

                 

                ------- Begin Message Trace -------

                Service -> {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService

                Operation -> readMessage

                Phase -> IN

                State -> OK

                Exchange Context ->

                          CamelToEndpoint : switchyard://MessageReaderService?namespace=urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT

                          CamelCreatedTimestamp : Thu Jul 12 23:17:07 EDT 2012

                Message Context ->

                          org.switchyard.messageId : b7c48ee1-d483-49cd-9186-3d89f2df6dd9

                          org.switchyard.contentType : java:java.lang.String

                          CamelMinaRemoteAddress : /127.0.0.1:58276

                          CamelMinaLocalAddress : /127.0.0.1:8888

                          breadcrumbId : ID-Johns-MacBook-Pro-local-57881-1342145933239-12-1

                          CamelMinaIoSession : (SOCKET, R: /127.0.0.1:58276, L: /127.0.0.1:8888, S: localhost/127.0.0.1:8888)

                          org.switchyard.transform.TransformSequence : org.switchyard.transform.TransformSequence@11dda6e8

                Message Content ->

                MSH|^~\&|NES|NINTENDO|TESTSYSTEM|TESTFACILITY|20010101000000||ADT^A04|Q123456789T123456789X123456|P|2.3

                EVN|A04|20010101000000|||^KOOPA^BOWSER^^^^^^^CURRENT

                PID|1||123456789|0123456789^AA^^JP|BROS^MARIO||19850101000000|M|||123 FAKE STREET^MARIO \T\ LUIGI BROS PLACE^TOADSTOOL KINGDOM^NES^A1B2C3^JP^HOME^^1234|1234|(555)555-0123^HOME^JP:1234567|||S|MSH|12345678|||||||0|||||N

                NK1|1|PEACH^PRINCESS|SO|ANOTHER CASTLE^^TOADSTOOL KINGDOM^NES^^JP|(123)555-1234|(123)555-2345|NOK

                NK1|2|TOADSTOOL^PRINCESS|SO|YET ANOTHER CASTLE^^TOADSTOOL KINGDOM^NES^^JP|(123)555-3456|(123)555-4567|EMC

                PV1|1|O|ABCD^EFGH||||123456^DINO^YOSHI^^^^^^MSRM^CURRENT^^^NEIGHBOURHOOD DR NBR|^DOG^DUCKHUNT^^^^^^^CURRENT||CRD|||||||123456^DINO^YOSHI^^^^^^MSRM^CURRENT^^^NEIGHBOURHOOD DR NBR|AO|0123456789|1|||||||||||||||||||MSH||A|||20010101000000

                IN1|1|PAR^PARENT||||LUIGI

                IN1|2|FRI^FRIEND||||PRINCESS

                ------ End Message Trace -------

                23:17:07,269 INFO  [org.switchyard.handlers.MessageTrace] (Camel (camel-13) thread #86 - MinaThreadPool)

                ------- Begin Message Trace -------

                Service -> {urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT}MessageReaderService

                Operation -> readMessage

                Phase -> OUT

                State -> OK

                Exchange Context ->

                          CamelToEndpoint : switchyard://MessageReaderService?namespace=urn:com.example.switchyard:test_hl7:0.0.1-SNAPSHOT

                          CamelCreatedTimestamp : Thu Jul 12 23:17:07 EDT 2012

                Message Context ->

                          org.switchyard.contentType : java:java.lang.String

                          org.switchyard.relatesTo : b7c48ee1-d483-49cd-9186-3d89f2df6dd9

                          org.switchyard.messageId : 78c389fc-62f1-428e-8942-b483e29e3420

                          org.switchyard.transform.TransformSequence : org.switchyard.transform.TransformSequence@11c44c12

                Message Content ->

                MSH|^~\&|||||20100630130105.496-0500||ACK|20||2.3

                MSA|AA|Q123456789T123456789X123456

                ------ End Message Trace -------

                 

                 

                Any help would be appreciated.

                 

                Thanks

                • 5. Re: Camel HL7 component
                  beve

                  Hi,

                   

                  I know that you've specified the dependency for 'ca.uhn.hapi' as a manifest header, but from the following stacktrace it does not look like the deployment, test_hl7.jar, contains this dependency:

                  Caused by: java.lang.ClassNotFoundException: ca.uhn.hl7v2.model.Message from [Module "deployment.test_hl7.jar:main" from Service Module Loader]

                   

                  Could you double check the contents of the manifest and post the result:

                   

                   unzip -p test_hl7.jar META-INF/MANIFEST.MF
                  

                   

                  Just thought that for some reason the manifest might have gotten overwritten using building the jar or something like that.

                   

                  Regards,

                   

                  /Daniel

                  • 6. Re: Camel HL7 component
                    jdestef

                    Hi,

                     

                    Thanks Daniel for pointing me in the direction I should have looked first. My "custom" manifest appears to be getting overwritten. If I look in the target directory the MANIFEST.MF I created is there and in the correct place (under META-INF). However, when I deploy to the server its getting overwritten. Any ideas how to configure eclipse not to do this. I'm publishing the project to the server in the server view window.

                     

                     

                    Thanks

                    • 7. Re: Camel HL7 component
                      jdestef

                      Hi,

                       

                      I added this to my pom file and that worked for not replacing the manifest.mf:

                       

                      <plugin>

                              <artifactId>maven-jar-plugin</artifactId>

                              <version>2.3.1</version>

                              <configuration>

                                <archive>

                                  <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>

                                </archive>

                              </configuration>

                              <executions>

                                <execution>

                                  <id>default-jar</id>

                                  <phase>package</phase>

                                  <goals>

                                    <goal>jar</goal>

                                  </goals>

                                </execution>

                              </executions>

                            </plugin>

                       

                       

                      Thanks

                      • 8. Re: Camel HL7 component
                        rcernich

                        Hey John,

                         

                        The tooling may be creating META-INF/MANIFEST.MF under src/main/java.  This is a bug.  The fix may be as simple as nuking the spurrious META-INF folder under src/main/java.

                         

                        Best,

                        Rob

                        • 9. Re: Camel HL7 component
                          jdestef

                          Hi Rob,

                           

                          Tried what you suggested but it did not work. Went back putting the maven-jar-plugin in the project pom file. I also added the ca.uhn.hapi module to both the Switchayard camel component module and as the only dependency in my MANIFEST.MF. Adding it only to the Switchyard module didn't work. I assume I'm missing some dependencies somewhere. The modular architecture of the app server definitly offers alot of flexibility, but tracking down dependency issues can be somewhat painful. Got working most of what I was looking for. Still haven't been able to use the dataform that Lukasz mentioned above, but I will contine to research this.

                           

                          Thanks for everyones help.