pdq-ITI21 request message

255 views
Skip to first unread message

slowessam

unread,
Apr 15, 2011, 1:06:21 PM4/15/11
to ipf-user
I´m new to IPF, camel and groovy and I hope you can help me.
Can someone please write an example pdq-ITI21 request message. I found
an example for the response on "tutorials/osgi/ihe/pdq/iti21/route" :

from('pdq-iti21://0.0.0.0:8871?audit=false')
.onException(Exception.class)
.maximumRedeliveries(0)
.end()
.process {
resultMessage(it).body = rsp
}

but did not found any code for the "request". Would be great if
someone can help or can point me to a class/file.

Thanks,
Wessam

rajesh babu

unread,
Apr 15, 2011, 11:40:35 PM4/15/11
to ipf-...@googlegroups.com, slowessam
Hi Wesam,
 
    You can create the EB-XML request by consuming the request message. Sample EB-XML - http://wiki.ihe.net/index.php?title=XDS.b_Implementation
 
Thanks
Rajesh
--
Thanks & Regards
Rajesh

Dmytro Rud

unread,
Apr 16, 2011, 12:53:40 PM4/16/11
to ipf-...@googlegroups.com
Hi Wessam,

here is a sample ITI-21 request message:
=====
MSH|^~\&|@1.2.840.114350.1.13.99998.8735||@1.2.840.114350.1.13.99999.4567||20070428150301||QBP^Q22^QBP_Q21|1.2.840.114350.1.13.0.1.7.1.1|P^T|2.5
QPD|IHE PDQ Query|18...@1.2.840.114350.1.13.28.1.18.5.999|@PID.5.1^Heidi~@PID.5.2^MARY~@PID.7^19400101~@PID.8^F~@PID.11.1^3443 North Arctic Avenue~@PID.11.3^Some City|||||^^^&1.3.6.1.4.1.21367.2005.1.2&ISO
RCP|I
=====

Its format and contents are described in the specification of HL7 v2.5 as well as in the IHE IT Infrastructure Technical Framework, Vol. 2a, Section 3.21.

@Rajesh: the ITI-21 transaction does not belong to the XDS profile and is not based on ebML.

Regards
Dmytro

Sven Siekmann

unread,
Apr 18, 2011, 3:25:11 PM4/18/11
to ipf-user
Hi,
thanks for the quick answers. Wessam and I are working on the same
project. We try to establish a basic connection to an MPI. We have got
the endpoint but don't know exactly how to modify the
SampleRouteBuilder.groovy and SampleModelExtension.groovy (from the
IPF tutorial) to get this basic connection.
1) As a first step we would like to read a sample request from a
variable(or a file), send it to the MPI and write the result(s) in
another variable (file). We are not sure whether we have to unmarshal/
marshall the testmessage as in the HL7 tutorial before sending it? It
would be nice if you could help us with a short code snippet.
2) Another question concerning that problem is whether we have to
configure one or more rules to send the request to the MPI and receive
the result to store it to a file? Is it possible to make a rule that
"gets the request" -> "sends the request" -> "receives the result" ->
"stores/processes the result"?
3) A further question that occurred is whether we have to authenticate
ourself to the MPI before asking for information (and then of course
the question: how?)? We successfully sendedd a testmessage with the
HL7 Client to our MPI and received a result. For this action we did
not have to type in any username and password.
It would be very nice if you could help us with some code snippets or
point us to some example files for our problem. Thanks a lot for your
help.

Thanks & Regards,

Wessam and Sven


On 16 Apr., 18:53, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Hi Wessam,
>
> here is a sample ITI-21 request message:
> =====
> MSH|^~\&...@1.2.840.114350.1.13.99998.8735|...@1.2.840.114350.1.13.99999.4567||20070428150301||QBP^Q22^QBP_Q21|1.2.840.114350.1.13.0.1.7.1.1|P^T|2.5
> QPD|IHE PDQ Query|18...@1.2.840.114350.1.13.28.1.18.5.999|...@PID.5.1^Hei...@PID.5.2^MA...@PID.7^194001...@PID.8^...@PID.11.1^3443 North Arctic Aven...@PID.11.3^Some City|||||^^^&1.3.6.1.4.1.21367.2005.1.2&ISO
> RCP|I
> =====
>
> Its format and contents are described in the specification of HL7 v2.5 as well as in the IHE IT Infrastructure Technical Framework, Vol. 2a, Section 3.21.
>
> @Rajesh: the ITI-21 transaction does not belong to the XDS profile and is not based on ebML.
>
> Regards
> Dmytro
>
>
>
>
>
>
>
> slowessam writes:
> > I�m new to IPF, camel and groovy and I hope you can help me.

Dmytro Rud

unread,
Apr 18, 2011, 3:54:01 PM4/18/11
to ipf-...@googlegroups.com
Hi Sven and Wessam,

> 1) As a first step we would like to read a sample request from a
> variable(or a file), send it to the MPI and write the result(s) in
> another variable (file). We are not sure whether we have to unmarshal/
> marshall the testmessage as in the HL7 tutorial before sending it?

You haven't. Read under http://repo.openehealth.org/confluence/display/ipf2/mllp-common-datatypes about data types that can be used by HL7v2-based IPF components. In other words: an unparsed String or even a File would be ok.

> It would be nice if you could help us with a short code snippet.

See below.

> 2) Another question concerning that problem is whether we have to
> configure one or more rules to send the request to the MPI and receive
> the result to store it to a file? Is it possible to make a rule that
> "gets the request" -> "sends the request" -> "receives the result" ->
> "stores/processes the result"?

What do you mean under "rule"? A Camel/IPF route? Yes, it's possible to write a route that performs the steps you listed -- something like

from('file://myRequest.txt')
.onException(MllpAcceptanceException)
.maximumRedeliveries(0)
.process { println 'Not a PDQ message' }
.end()
.onException(ValidationException)
.maximumRedeliveries(0)
.process { println 'Invalid PDQ message' }
.end()
.onException(Exception.class)
.maximumRedeliveries(10)
.process { println 'MPI unreachable' }
.end()
.process(PixPdqCamelValidators.iti21RequestValidator())
.to('pix-iti21://mpi.uni-heilbronn.de:8888')
.process(PixPdqCamelValidators.iti21ResponseValidator())
.process {
assert it.in.body instanceof MessageAdapter
println it.in.body
it.in.body = it.in.body.toString()
}
.to('file://myResponse.txt')

(this is untested Groovy code)

> 3) A further question that occurred is whether we have to authenticate
> ourself to the MPI before asking for information (and then of course
> the question: how?)? We successfully sendedd a testmessage with the
> HL7 Client to our MPI and received a result. For this action we did
> not have to type in any username and password.
> It would be very nice if you could help us with some code snippets or
> point us to some example files for our problem. Thanks a lot for your
> help.

As far as I understood, your experiment has shown that the MPI does not require any client authentication ;)

MLLP protocol per se does not provide any authentication mechanisms. When you still want to have them, all you can do is to use SSL and analyse SSL certificates -- for example, by means of an user-defined MLLP interceptor. Such interceptors can be deployed at an IPF MLLP endpoint as described in the last section of http://repo.openehealth.org/confluence/display/ipf2/mllp-common-parameters .

Regards
Dmytro

Sven Siekmann

unread,
Apr 28, 2011, 4:07:00 PM4/28/11
to ipf-user
Hi Dmytro,
we still have a little problem with understanding / using camel and
groovy. We tried to write a Unittest for the problem described above.
We tried to adept our test to the TestIti21.groovy
(org.openehealth.ipf.platform.camel.ihe.pixpdq.iti21) and
MllpTestContainer.groovy
(org.openehealth.ipf.platform.camel.ihe.mllp.core). We tried to use
code snippets from init()-, send() and testCancel()-methods. But
without any success:(
Here is our code:

class TestPDQTransaction{
def static producerTemplate
def static camelContext
def static appContext

@BeforeClass
static void setUpClass() {
init('iti-21.xml')
}
def static init(String descriptorFile) {
appContext = new ClassPathXmlApplicationContext(descriptorFile)
producerTemplate = appContext.getBean('template',
ProducerTemplate.class)
camelContext = appContext.getBean('camelContext',
CamelContext.class)
}
static MessageAdapter send(String endpoint, Object body) {
def exchange = new DefaultExchange(camelContext)
exchange.in.body = body
Exchange result = producerTemplate.send(endpoint, exchange)
if (result.exception) {
throw result.exception
}
def response = Exchanges.resultMessage(result)
response.getBody(MessageAdapter.class)
}

@Test
void testPDQ() {
def body = [test message]

def retMsg = [expected returnmsg]
def endpointUri = 'pix-iti21://mpi.uni-heilbronn.de:8888'
def msg = send(endpointUri, body)
assertEquals(msg, retMsg)
}

we get a 'NoSuchMethodError' in the line appContext = new
ClassPathXmlApplicationContext(descriptorFile).
Id would be nice if you could tell us wheather our code attempt is
misleading us and maybe give us a hint (or a code snippet) how to
write this unit test to send our test message to the mpi and compare
the received result with our expected message.
Thanks and Regards,

Sven



On 18 Apr., 21:54, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Hi Sven and Wessam,
>
> > 1) As a first step we would like to read a sample request from a
> > variable(or a  file), send it to the MPI and write the result(s) in
> > another variable (file).  We are not sure whether we have to unmarshal/
> > marshall the testmessage as in the HL7 tutorial before sending it?
>
> You haven't.  Read underhttp://repo.openehealth.org/confluence/display/ipf2/mllp-common-datat...about data types that can be used by HL7v2-based IPF components.  In other words: an unparsed String or even a File would be ok.
> MLLP protocol per se does not provide any authentication mechanisms.  When you still want to have them, all you can do is to use SSL and analyse SSL certificates -- for example, by means of an user-defined MLLP interceptor.  Such interceptors can be deployed at an IPF MLLP endpoint as described in the last section ofhttp://repo.openehealth.org/confluence/display/ipf2/mllp-common-param....
>
> Regards
> Dmytro

Dmytro Rud

unread,
Apr 29, 2011, 3:03:02 AM4/29/11
to ipf-user
Hi Sven,

can you show me your pom.xml and the stack trace of the exception?
The code per se seems to be Ok.
BTW, you can simply use the mentioned MllpTestContainer as basis for
your unit tests --- not as code snippets, but as inherited
functionality.

Regards,
Dmytro
> > You haven't.  Read underhttp://repo.openehealth.org/confluence/display/ipf2/mllp-common-datat...data types that can be used by HL7v2-based IPF components.  In other words: an unparsed String or even a File would be ok.
Message has been deleted

slowessam

unread,
Apr 29, 2011, 10:18:55 AM4/29/11
to ipf-user
Hi Dmytro,

first of all thank you for your help and support. unfortunately I can
only post the pom.xml, at the moment I have to deal with an other
maven/eclipse error which has nothing to do with the project. So I
hope that Sven will post the stacktrace as soon as possible, and till
then here is the pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>coala-ipf</artifactId>
<groupId>de.hhn.mi.coala</groupId>
<version>0.1-SNAPSHOT</version>
</parent>
<groupId>de.hhn.mi.coala</groupId>
<artifactId>coala-ipf-pdq</artifactId>
<version>0.1-SNAPSHOT</version>
<name>Coala-IPF-PDQ</name>
<description>Coala module binding for PDQ communication</description>
<properties>
<ipf-version>2.2.1</ipf-version>
</properties>
<repositories>
<repository>
<id>saxon-repo</id>
<name>Saxon Repo</name>
<url>http://people.apache.org/~rr/saxon-repo</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>openehealth.releases</id>
<name>Open eHealth Maven Repository</name>
<url>http://repo.openehealth.org/maven2/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>openehealth.snapshots</id>
<name>Open eHealth Maven Repository</name>
<url>http://repo.openehealth.org/maven2/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>java.net</id>
<name>java.net Maven Repository</name>
<url>http://download.java.net/maven/2/</url>
</repository>
<repository>
<id>codehaus</id>
<name>Codehaus Maven Repository</name>
<url>http://repository.codehaus.org</url>
</repository>
<repository>
<id>jboss</id>
<name>JBoss Maven Repository</name>
<url>http://repository.jboss.com/maven2</url>
</repository>
<repository>
<id>hapi-sf</id>
<name>HAPI Sourceforge Repository</name>
<url>http://hl7api.sourceforge.net/m2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.openehealth.ipf.platform-camel</groupId>
<artifactId>platform-camel-ihe-pixpdq</artifactId>
<version>${ipf-version}</version>
</dependency>
<!-- USE with Camel -->
<dependency>
<groupId>org.openehealth.ipf.platform-camel</groupId>
<artifactId>platform-camel-hl7</artifactId>
<version>${ipf-version}</version>
</dependency>
<!-- HAPI version? -->
<!-- Dependency for HL7 v2.5 -->
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>0.6</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<version>9.1.0.8</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.0</version>
<type>jar</type>
<scope>test</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>


and this is our iti-21.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hhn.mi.coala</groupId>
<artifactId>coala-ipf</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Coala-IPF</name>
<organization>
<name>Hochschule Heilbronn - Medizinische Informatik</name>
<url>http://www.mi.hs-heilbronn.de</url>
</organization>
<repositories>
<repository>
<id>repository.releases</id>
<name>Central Maven Repository</name>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>build-stud</id>
<name>MI HSHN maven2 repository</name>
<url>https://build-stud.mi.hs-heilbronn.de/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.hhn.mi.coala</groupId>
<artifactId>coala-domain</artifactId>
<version>0.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>
<modules>
<module>coala-ipf-pdq</module>
<module>coala-ipf-xds</module>
</modules>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<version>2.3.2</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<encoding>utf-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>

best regards

Sven Siekmann

unread,
Apr 29, 2011, 12:45:10 PM4/29/11
to ipf-user
Hello Dmytro,

here is the failure trace:

java.lang.NoSuchMethodError:
org.springframework.core.OrderComparator.sort(Ljava/util/List;)V
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:
597)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
407)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:
139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:
83)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:
77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite
$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:
102)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:
52)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
190)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
198)
at
de.hhn.mi.coala.groovy.test.TestPDQTransaction.init(TestPDQTransaction.groovy:
61)
at de.hhn.mi.coala.groovy.test.TestPDQTransaction
$init.callStatic(Unknown Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:
48)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:
165)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:
173)
at
de.hhn.mi.coala.groovy.test.TestPDQTransaction.setUpClass(TestPDQTransaction.groovy:
53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:
74)
at
org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:
50)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:
33)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:
52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
197)

TestPDQTransaction.groovy:61 is the line appContext = new
ClassPathXmlApplicationContext(descriptorFile).
I tried to use the MllpTestContainer, but i was not able to find the
relevant import (import
org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpTestContainer as
in TestIti-21.groovy was not working/found:\). Maybe a missing
dependancy? Thanks for your help.

Regards,

Sven


On 29 Apr., 16:18, slowessam <wessamk...@googlemail.com> wrote:
> Hi Dmytro,
>
> first of all thank you for your help and support. unfortunately I can
> only post the pom.xml, at the moment I have to deal with an other
> maven/eclipse error which has nothing to do with the project. So I
> hope that Sven will post the stacktrace as soon as possible, and till
> then here is the pom.xml:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">

Dmytro Rud

unread,
Apr 30, 2011, 2:59:24 AM4/30/11
to ipf-user
Hi,

(I have already twice sent this response, but my messages do not
appear in the list. Now I try again. Sorry for possible duplicates.)

1.

IPF 2.2.1 comes with Spring 3.0.4, while your pom.xml references
2.5.6. So you have incompatible set of JARs in the classpath.
I suppose this is the error cause.

In order to avoid such problems, you can automatically inherit
dependency configuration from IPF. Add the following item to
the <dependenciesManagement> section of your pom.xml:

<dependencyManagement>
<dependencies>
.....
<dependency>
<groupId>org.openehealth.ipf</groupId>
<artifactId>ipf</artifactId>
<version>${ipf-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
.....
</dependencies>
</dependencyManagement>

After that, <version> elements of third-party dependencies can be
omitted, because Maven will use versions configured in IPF.

2.

In order to access MllpTestContainer from your project, you need to
include corresponding _test_ JAR into project dependencies:

<dependency>
<groupId>org.openehealth.ipf.platform-camel</groupId>
<artifactId>platform-camel-ihe-mllp</artifactId>
<version>${ipf-version}</version>
<!--scope>test</scope-->
<type>test-jar</type>
</dependency>

Best Regards,
Dmytro
> >         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4....">
> ...
>
> Erfahren Sie mehr »

Sven Siekmann

unread,
Apr 30, 2011, 6:19:33 AM4/30/11
to ipf-user
Hi,
ok thanks for the advice. I added the dependencies.
Unfortunatly I get another problem concerning the iti-21.xml. I get
the following error :
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'template': Initialization of bean failed;
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'camelContext': Invocation of init method
failed; nested exception is groovy.lang.MissingPropertyException: No
such property: MllpAcceptanceException for class:
de.hhn.mi.coala.groovy.PDQRouteBuilder
[...]

here the code of the iti-21.xml (HL7 mapping removed):
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<camel:camelContext id="camelContext">
<camel:routeBuilder ref="routeBuilder"/>
</camel:camelContext>
<bean id="routeBuilder" depends-on="routeModelExtender"
class="de.hhn.mi.coala.groovy.PDQRouteBuilder">
</bean>
<bean id="pdqModelExtension"
class="de.hhn.mi.coala.groovy.PDQModelExtension">
</bean>

<!-- HAPI extensions -->
<bean id="hapiModelExtension"

class="org.openehealth.ipf.modules.hl7.extend.HapiModelExtension">
</bean>

<!-- Camel DSL extensions -->
<bean id="hl7ModelExtension"

class="org.openehealth.ipf.platform.camel.hl7.extend.Hl7ModelExtension">
</bean>
<bean id="coreModelExtension"

class="org.openehealth.ipf.platform.camel.core.extend.CoreModelExtension">
</bean>
<bean id="routeModelExtender"

class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender">
<property name="routeModelExtensions">
<list>
<ref bean="coreModelExtension" />
<ref bean="pdqModelExtension" />
<ref bean="hl7ModelExtension" />
<ref bean="hapiModelExtension" />
</list>
</property>
</bean>
</beans>

and here the code of the test class:

class TestPDQTransaction extends MllpTestContainer{
@BeforeClass
static void setUpClass() {
init('iti-21.xml')
}

@Test
void testPDQ() {
def body = '[...]
def retMsg = '[...]'
def endpointUri = 'pix-iti21://...'
def msg = send(endpointUri, body)
assertEquals(msg, retMsg)
assertACK(msg)
}
}

and finally the code of the PDQRouteBuilder (=the code you posted some
posts above):
class PDQRouteBuilder extends SpringRouteBuilder {
void configure() {
from('file://myRequest.txt')
.onException(MllpAcceptanceException)
.maximumRedeliveries(0)
.process { println 'Not a PDQ message' }
.end()
.onException(ValidationException)
.maximumRedeliveries(0)
.process { println 'Invalid PDQ message' }
.end()
.onException(Exception.class)
.maximumRedeliveries(10)
.process { println 'MPI unreachable' }
.end()
.process(PixPdqCamelValidators.iti21RequestValidator())
.to('pix-iti21://...')
.process(PixPdqCamelValidators.iti21ResponseValidator())
.process {
assert it.in.body instanceof MessageAdapter
println it.in.body
it.in.body = it.in.body.toString()
}
.to('file://myResponse.txt')
}
}

I didn't found anything like the 'MllpAcceptanceException' in the
example files I mentioned some posts before. So probably I missed
anything else. Id would be nice if you could give us another hint.
Thanks.
Best Regards,

Sven


I inserted these parts because of the HL7 processing
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
Apr 30, 2011, 7:01:02 AM4/30/11
to ipf-...@googlegroups.com
Hi Sven,

the following statement is missing in your Groovy file:
import org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpAcceptanceException

(I suppose that other classes mentioned in the snippet will require import statements as well.)

Regards,
Dmytro

Sven Siekmann

unread,
Apr 30, 2011, 7:45:05 AM4/30/11
to ipf-user
Oh, shame on me. It seems as if I am a little bit too used to the
eclipse error highlighting for missing imports:\ I also used the wrong
protocoll (pix-iti21:\). Now corrected to pdq-iti21. But now I get the
following error:

org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1 at: >>> To[pdq-iti21://141.7.10.203:3750] <<< in route:
Route[[From[file://myRequest.txt]] -> [OnException[[class or...
because of Failed to resolve endpoint: pdq-iti21://141.7.10.203:3750
due to: null
[...]

We tested the endpoint with the HL7-Client and it worked. What does
this error mean? Is the MPI down or unwilling to communicate with us?
Or is something wrong with the file that is containing our test
message?
Thanks.

Best Regards,

Sven

Dmytro Rud

unread,
Apr 30, 2011, 7:52:29 AM4/30/11
to ipf-...@googlegroups.com
Hi Sven,

have you defined a HL7v2 codec bean? Read here about it:
http://repo.openehealth.org/confluence/display/ipf2/mllp-common-parameters

Best Regards,

Sven Siekmann

unread,
Apr 30, 2011, 8:14:37 AM4/30/11
to ipf-user
Hi Dmytro,

now it is defined:-D Sorry for that. Now the next error:\

org.apache.camel.RuntimeCamelException:
java.lang.IllegalArgumentException: Only directory is supported.
Endpoint must be configured with a valid starting directory:
myRequest.txt
[...]
at
de.hhn.mi.coala.groovy.test.TestPDQTransaction.setUpClass(TestPDQTransaction.groovy:
50)
[...]

that is the line where I call "init('iti-21.xml')". The file
"myRequest.txt" is placed in src/test/ressources and src/main/
ressources (same content). The PDQRouteBuilder is in /src/main/groovy
and the testfile in /src/test/groovy. I am a little bit confused
concerning the paths. The init()-method is reading the route from the
PDQRouteBuilder?! What path do I have to specify in the from()?
from('file://myRequest.txt') correct?

Best Regards,

Sven


On 30 Apr., 13:52, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Hi Sven,
>
> have you defined a HL7v2 codec bean?  Read here about it:http://repo.openehealth.org/confluence/display/ipf2/mllp-common-param...

Dmytro Rud

unread,
Apr 30, 2011, 8:32:07 AM4/30/11
to ipf-...@googlegroups.com
Hi Sven,

I'm not sure whether the Camel file component (http://camel.apache.org/file.html) respects the classpath when searchig for files. Probably it doesn't. Try to specify absolute path in from(file://...).

Sven Siekmann

unread,
Apr 30, 2011, 8:38:07 AM4/30/11
to ipf-user
Hi Dmytro,

I will have closer look at that later. Thanks a lot.

Best Regards,

Sven

Dmytro Rud

unread,
May 1, 2011, 7:48:27 AM5/1/11
to ipf-user
Correction: the file component of Camel 2.x (http://camel.apache.org/
file2.html) uses a different URI syntax and accepts only directories
in the path. File names can be specified in URI parameter "fileName".

Regards,
Dmytro


On 30 Apr., 14:32, Dmytro Rud <dmytro....@googlemail.com> wrote:

Sven Siekmann

unread,
May 1, 2011, 8:50:49 AM5/1/11
to ipf-user
Hi,
yes I read that and corrected the "from" to "from('file://.?
fileName="myRequest.txt"')" and the "to" to "to('file://.?
fileName="myResponse.txt"')". I hope it is possible to specify the
current directory as teh directory? Now I get the following
NoClassDefFoundError:

java.lang.NoClassDefFoundError:
org.openehealth.ipf.commons.ihe.atna.MockedSender
at
org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpTestContainer.class
$(MllpTestContainer.groovy)
at org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpTestContainer.
$get$$class$org$openehealth$ipf$commons$ihe$atna
$MockedSender(MllpTestContainer.groovy)
at
org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpTestContainer.init(MllpTestContainer.groovy:
52)
[...]

I found something that in the test root directory has to be a context
file called context.xml, so I renamed the "iti-21.xml" (in /src/test/
ressources) in "context.xml" - without success:(
Do you have another hint for me? Thanks.

Best Regards,

Sven

Dmytro Rud

unread,
May 1, 2011, 9:09:11 AM5/1/11
to ipf-...@googlegroups.com
Hi,

renaming of the context file was not neccessary.
MockedSender is here:

<dependency>
<groupId>org.openehealth.ipf.commons</groupId>
<artifactId>commons-ihe-atna</artifactId>


<version>${ipf-version}</version>
<!--scope>test</scope-->
<type>test-jar</type>
</dependency>

Regards,

Sven Siekmann

unread,
May 1, 2011, 9:17:34 AM5/1/11
to ipf-user
Thank you. Test is almost running. Just an AssertionError left - that
is something I can deal with^^ Thank you very much for your help.
Regards,

Sven
Message has been deleted
Message has been deleted

Dmytro Rud

unread,
Apr 29, 2011, 11:49:54 AM4/29/11
to ipf-...@googlegroups.com
Hi,

IPF 2.2.1 comes with Spring 3.0.4, while your pom.xml references
2.5.6. So you have incompatible set of JARs in the classpath. I
suppose this is the error cause.

In order to avoid such problems, you can automatically inherit
dependency configuration from IPF. Add the following item to the
<dependenciesManagement> section of your pom.xml:

<dependencyManagement>
<dependencies>
.....
<dependency>
<groupId>org.openehealth.ipf</groupId>

<artifactId>ipf</artifactId>
<version>${ipf-version}</version>


<type>pom</type>
<scope>import</scope>
</dependency>
.....
</dependencies>
</dependencyManagement>

After that, <version> elements of third-party dependencies can be
omitted, because Maven will use versions configured in IPF.

Regards,
Dmytro


2011/4/29 slowessam <wessa...@googlemail.com>:

Sven Siekmann

unread,
May 3, 2011, 11:54:06 AM5/3/11
to ipf-user
Hi again,

we have one further question. We established a running unit test (see
above). And now we are not sure how to connect the route in the
PDQRouteBuilder.groovy with our Java code.
The idea is that we have a method that gets a string (HL7 request for
the MPI) and should return the HL7 response from the MPI. How do we
build the connection and trigger the request?
We found the class-uri (http://camel.apache.org/class.html) which
seems to fit good to our task. But we found also some examples that
use the bean-uri. Is it enough to add a new route to our
PDQRouteBuilder.groovy that looks something like

from("class:de.hhn.mi.coala.ipf.GateClass.class?
method=send&request=HL7-string")
.to("class:de.hhn.mi.coala.ipf.GateClass.class"); ( String
GateClass.request(String request) should be the method)

And then the next question: how do we trigger the method? Is it
automatically called when we call "request(...)" and the result is
given back to the caller?
In the unit test we used the init() and send()-method from the
MllpTestContainer. But probably we should not use this way to
communicate with the MPI?
Sorry for all the basic questions but we are a little bit lost in all
the documentation. It would be nice if you could give us a little
hint. Thanks a lot.

Best Regards,

Wessam and Sven
Message has been deleted

Dmytro Rud

unread,
Apr 29, 2011, 10:40:24 AM4/29/11
to ipf-...@googlegroups.com
Hi,

IPF 2.2.1 comes with Spring 3.0.4, while your pom.xml references
2.5.6. So you have incompatible set of JARs in the classpath. I
suppose this is the error cause.

In order to avoid such problems, you can automatically inherit
dependency configuration from IPF. Add the following item to the
<dependenciesManagement> section of your pom.xml:

<dependencyManagement>
<dependencies>
.....
<dependency>
<groupId>org.openehealth.ipf</groupId>

<artifactId>ipf</artifactId>
<version>${ipf-version}</version>


<type>pom</type>
<scope>import</scope>
</dependency>
.....
</dependencies>
</dependencyManagement>

After that, <version> elements of third-party dependencies can be
omitted, because Maven will use versions configured in IPF.

Regards,
Dmytro


2011/4/29 slowessam <wessa...@googlemail.com>:

Dmytro Rud

unread,
May 4, 2011, 4:19:17 AM5/4/11
to ipf-...@googlegroups.com
Hi,

so, you have a route and want to execute this route from a plain
Java application --- right? The approach applied in unit tests
(ProducerTemplate & Co.) is suitable in this case as well.

(But then, probably, arises the question about why the business
logic to be triggered has been implemented as a Camel route).

Regards,
Dmytro


2011/5/3 Sven Siekmann <sven.s...@web.de>:

Sven Siekmann

unread,
May 4, 2011, 1:02:08 PM5/4/11
to ipf-user
Hi,
ok. Now I am really a little bit confused. So you say we can just use
this ProducerTemplate like in the unit test - right? In the unit test
we inherited the relevant methods from "MllpTestContainer" - is there
a class we can inherit from to get these methods for our application
code? Or do we need to write these methods on our own? Or should we
use the MllpTestContainer?
Concerning your remark in parentheses: Do you suggest not to use the
implementation via Camel route in our case (maybe even for the whole
application?)? And what do we have to do to use Camel routes? Could
you give us some code snippets or point us to some example files so
that we maybe get an idea how it works. Thank you for your help.
Best Regards,

Sven


On 4 Mai, 10:19, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Hi,
>
> so, you have a route and want to execute this route from a plain
> Java application --- right?  The approach applied in unit tests
> (ProducerTemplate & Co.) is suitable in this case as well.
>
> (But then, probably, arises the question about why the business
> logic to be triggered has been implemented as a Camel route).
>
> Regards,
> Dmytro
>
> 2011/5/3 Sven Siekmann <sven.siekm...@web.de>:

Dmytro Rud

unread,
May 5, 2011, 3:07:17 AM5/5/11
to ipf-...@googlegroups.com
Hi Sven,

> ok. Now I am really a little bit confused. So you say we can just use
> this ProducerTemplate like in the unit test - right? In the unit test
> we inherited the relevant methods from "MllpTestContainer" - is there
> a class we can inherit from to get these methods for our application
> code? Or do we need to write these methods on our own? Or should we
> use the MllpTestContainer?

you can keep using MllpTestContainer, or you can write something like

===============
// build Camel infrastructure
CamelContext camelContext = new DefaultCamelContext();
camelContext.start();

// prepare request
String request = "MSH|...|blabla|...";
Exchange requestExchange = new DefaultExchange(camelContext);
requestExchange.getIn().setBody(request);

// send request
ProducerTemplate producerTemplate = new DefaultProducerTemplate(camelContext);
producerTemplate.start();
Exchange responseExchange = producerTemplate.send("direct:start",
requestExchange);

// get response
String response = responseExchange.getOut().getBody(String.class);
===============

This example assumes that your route starts with from("direct:start")
instead of from("file...") and does not contain to("file...") at the
end.

> Concerning your remark in parentheses: Do you suggest not to use the
> implementation via Camel route in our case (maybe even for the whole
> application?)? And what do we have to do to use Camel routes? Could
> you give us some code snippets or point us to some example files so
> that we maybe get an idea how it works. Thank you for your help.

I see at least two possible scenarios here:
1. As in the sample code above: a Java application uses
ProducerTemplate to send a request to a Camel route via direct
endpont, the route performs message validation and communicates with
MPI using IPF components.
2. A Java application performs message validation and uses
ProducerTemplate to communicate with MPI using IPF components. No
route definitions, no DSL extensions and no context descriptors are
required in this case.

The implementation of the second scenario could look like

===============
// build Camel infrastructure
CamelContext camelContext = new DefaultCamelContext();
camelContext.start();

// prepare request
String request = "MSH|...|blabla|...";
Exchange requestExchange = new DefaultExchange(camelContext);
requestExchange.getIn().setBody(request);

// validate request
try {
PixPdqCamelValidators.iti21RequestValidator().process(requestExchange);
} catch (ValidationException e) {
System.out.println("Request validation failed");
System.exit(1);
}

// send request
ProducerTemplate producerTemplate = new DefaultProducerTemplate(camelContext);
producerTemplate.start();
try {
Exchange responseExchange =
producerTemplate.send("pdq-iti21://...", requestExchange);
if (responseExchange.getException() != null) {
throw responseExchange.getException();
}
} catch (Exception e) {
System.out.println("Request failed");
responseExchange.getException().printStackTrace();
System.exit(1);
}

// validate response
responseExchange.getIn().setBody(responseExchange.getOut().getBody());
try {
PixPdqCamelValidators.iti21ResponseValidator().process(responseExchange);
} catch (ValidationException e) {
System.out.println("Response validation failed");
System.exit(1);
}

// process response
MessageAdapter response =
responseExchange.getIn().getBody(MessageAdapter.class);
Terser terser = new Terser((Message) response.getTarget());
.......
===============

Kind Regards,
Dmytro

Dmytro Rud

unread,
May 5, 2011, 4:56:13 AM5/5/11
to ipf-user
In the second code fragment, variable "responseExchange" should be
declared outside of the try/catch block, of course... ;-)

Sven Siekmann

unread,
May 7, 2011, 6:56:39 AM5/7/11
to ipf-user
Hi Dmytro,

thank you very much for the snippets. That was exactly what we were
looking for:-D Have a nice weekend.

Best Regards,

Sven

slowessam

unread,
May 9, 2011, 5:21:43 AM5/9/11
to ipf-user
Hi Dmytro,

we still have an error in our reasoning. We used the first sample code
above with the endpoint: "direct:start"
but we get:

===========
2011-05-09T11:14:10,806 [main] WARN - component.direct.DirectProducer
| No consumers available on endpoint: Endpoint[direct://start] to
process: Exchange[Message: MSH|^~\&|OHFConsumer|OHFFacility|
OTHER_KIOSK|HIMSSSANDIEGO|20070108145322-0800||QBP^Q22|
9416994431147258002|P|2.5|
QPD|Q22^Find Candidates|7891956360974608557281601076319|@PID.5.1^M*|
RCP|I|2^RD]
null
==========

and with the endpooint: "pdq-iti21://icw-pxs.iap.hs-heilbronn.de:3750"
we get ResolveEndpointFailedException:

==========
Exception in thread "main"
org.apache.camel.ResolveEndpointFailedException: Failed to resolve
endpoint: pdq-iti21://icw-pxs.iap.hs-heilbronn.de:3750 due to: null
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:
437)
at
org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:
423)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:
90)
at
de.hhn.mi.coala.binding.PDQTransactor.sendPDQrequest(PDQTransactor.java:
23)
at de.hhn.mi.coala.binding.PDQTransactor.main(PDQTransactor.java:33)
Caused by: java.lang.NullPointerException
at
org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpComponent.createEndpoint(MllpComponent.java:
133)
at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:
75)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:
419)
... 4 more
==========

best regards,

Sven and Wessam
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 9, 2011, 5:27:49 AM5/9/11
to ipf-...@googlegroups.com
Hi,

1. Does your route definition begin with from("direct:start") ?
2a. Does your pom.xml contain platform-camel-ihe-pixpdq as dependency?
2b. Did you define a HL7v2 codec as described early in this mailing list?

Regards,
Dmytro


2011/5/9 slowessam <wessa...@googlemail.com>:

Message has been deleted

Dmytro Rud

unread,
May 9, 2011, 6:45:41 AM5/9/11
to ipf-...@googlegroups.com
Looks good.
Excepting the fact that the route does not contain any communication with MPI.

Regards,
Dmytro.


2011/5/9 slowessam <wessa...@googlemail.com>:
> Hi Dmytro,
>

> this is our route definition:
> =========
> from('direct:start')


>       .onException(MllpAcceptanceException)
>           .maximumRedeliveries(0)
>           .process { println 'Not a PDQ message' }
>           .end()
>       .onException(ValidationException)
>           .maximumRedeliveries(0)
>           .process { println 'Invalid PDQ message' }
>           .end()
>       .onException(Exception.class)
>           .maximumRedeliveries(10)
>           .process { println 'MPI unreachable' }
>           .end()
>       .process(PixPdqCamelValidators.iti21RequestValidator())

>       .process(PixPdqCamelValidators.iti21ResponseValidator())
>       .process {
>            assert it.in.body instanceof MessageAdapter
>            println it.in.body
>            it.in.body = it.in.body.toString()
>       }

> ==========
>
> this is our cntext.xml
>
> ==========


> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:lang="http://www.springframework.org/schema/lang"
>        xmlns:camel="http://camel.apache.org/schema/spring"
>        xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> http://www.springframework.org/schema/lang
> http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>
>        <camel:camelContext id="camelContext">
>                <camel:routeBuilder ref="routeBuilder" />
>        </camel:camelContext>
>
>        <bean id="routeBuilder" depends-on="routeModelExtender"

>                class="de.hhn.mi.coala.PDQRouteBuilder">
>        </bean>
>
>        <bean id="pdqModelExtension"
> class="de.hhn.mi.coala.PDQModelExtension">
>        </bean>
>
>        <bean id="hl7codec"
> class="org.apache.camel.component.hl7.HL7MLLPCodec">
>                <property name="charset" value="iso-8859-1" />


>        </bean>
>
>        <!-- HAPI extensions -->
>        <bean id="hapiModelExtension"
>                class="org.openehealth.ipf.modules.hl7.extend.HapiModelExtension">

>                <!-- <property name="mappingService" ref="..." /> -->
>        </bean>
>
>        <!-- General Mapping extensions <bean id="mappingExtension"
> class="org.openehealth.ipf.commons.map.extend.MappingExtension">
>                <property name="mappingService" ref="..." /> </bean> -->


>
>        <!-- Camel DSL extensions -->
>        <bean id="hl7ModelExtension"
>
> class="org.openehealth.ipf.platform.camel.hl7.extend.Hl7ModelExtension">
>        </bean>
>
>        <bean id="coreModelExtension"
>
> class="org.openehealth.ipf.platform.camel.core.extend.CoreModelExtension">
>        </bean>
>
>        <bean id="routeModelExtender"
>
> class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender">
>                <property name="routeModelExtensions">
>                        <list>
>                                <ref bean="coreModelExtension" />
>                                <ref bean="coreModelExtension" />
>                                <ref bean="pdqModelExtension" />
>                                <ref bean="hl7ModelExtension" />
>                                <ref bean="hapiModelExtension" />

>                                <!-- <ref bean="mappingExtension" /> -->
>                        </list>
>                </property>
>        </bean>
>
> </beans>
>
> ===========
>
> .
> and our pom.xml
>
> ===========

>        <dependencyManagement>
>                <dependencies>
>                        <dependency>
>                                <groupId>org.openehealth.ipf</groupId>
>                                <artifactId>ipf</artifactId>
>                                <version>${ipf-version}</version>


>                                <type>pom</type>
>                                <scope>import</scope>
>                        </dependency>

>                </dependencies>
>        </dependencyManagement>


>        <dependencies>
>                <dependency>
>                        <groupId>org.openehealth.ipf.platform-camel</groupId>

>                        <artifactId>platform-camel-ihe-pixpdq</artifactId>
>                        <version>${ipf-version}</version>


>                </dependency>
>                <!-- USE with Camel -->
>                <dependency>
>                        <groupId>org.openehealth.ipf.platform-camel</groupId>

>                        <artifactId>platform-camel-hl7</artifactId>
>                        <version>${ipf-version}</version>


>                </dependency>
>                <!-- HAPI version? -->
>                <!-- Dependency for HL7 v2.5 -->
>                <dependency>
>                        <groupId>ca.uhn.hapi</groupId>
>                        <artifactId>hapi-structures-v25</artifactId>

>                        <!-- <version>0.6</version> -->


>                </dependency>
>                <dependency>
>                        <groupId>net.sf.saxon</groupId>
>                        <artifactId>saxon</artifactId>

>                        <!-- <version>9.1.0.8</version> -->


>                </dependency>
>                <dependency>
>                        <groupId>org.springframework</groupId>
>                        <artifactId>spring-core</artifactId>

>                        <!-- <version>2.5.6</version> -->
>                </dependency>
>                <dependency>
>                        <groupId>org.openehealth.ipf.platform-camel</groupId>
>                        <artifactId>platform-camel-ihe-mllp</artifactId>


>                        <version>${ipf-version}</version>
>                        <!--scope>test</scope -->
>                        <type>test-jar</type>
>                </dependency>
>                <dependency>
>                        <groupId>org.openehealth.ipf.commons</groupId>
>                        <artifactId>commons-ihe-atna</artifactId>
>                        <version>${ipf-version}</version>
>                        <!--scope>test</scope -->
>                        <type>test-jar</type>

> =============
>
> and at least this is the hl7v2 codec that we defined:


>
> "MSH|^~\\&|OHFConsumer|OHFFacility|OTHER_KIOSK|HIMSSSANDIEGO|
> 20070108145322-0800||"

>               + "QBP^Q22|9416994431147258002|P|2.5|\nQPD|Q22^Find
> Candidates|"
>               + "7891956360974608557281601076319|@PID.5.1^M*|\nRCP|I|
> 2^RD"
>
> Regards,
>
> Wessam


>
>
> On 9 Mai, 11:27, Dmytro Rud <dmytro....@googlemail.com> wrote:
>> Hi,
>>

>> 1. Does your route definition begin with from("direct:start") ?
>> 2a. Does your pom.xml contain platform-camel-ihe-pixpdq as dependency?
>> 2b. Did you define a HL7v2 codec as described early in this mailing list?
>>
>> Regards,
>> Dmytro
>>

>> 2011/5/9 slowessam <wessamk...@googlemail.com>:


>>
>> > Hi Dmytro,
>>
>> > we still have an error in our reasoning. We used the first sample code
>> > above with the endpoint: "direct:start"
>> > but we get:
>>
>> > ===========
>> > 2011-05-09T11:14:10,806 [main] WARN  - component.direct.DirectProducer
>> > | No consumers available on endpoint: Endpoint[direct://start] to
>> > process: Exchange[Message: MSH|^~\&|OHFConsumer|OHFFacility|
>> > OTHER_KIOSK|HIMSSSANDIEGO|20070108145322-0800||QBP^Q22|
>> > 9416994431147258002|P|2.5|

>> > QPD|Q22^Find Candidates|78919563609746085572816010763...@PID.5.1^M*|

>> ...
>>
>> Erfahren Sie mehr »

slowessam

unread,
May 9, 2011, 6:46:42 AM5/9/11
to ipf-user
Hi Dmytro,

I just corrected my last post.

this is our route definition:
=========
from('direct:start')
.onException(MllpAcceptanceException)
.maximumRedeliveries(0)
.process { println 'Not a PDQ message' }
.end()
.onException(ValidationException)
.maximumRedeliveries(0)
.process { println 'Invalid PDQ message' }
.end()
.onException(Exception.class)
.maximumRedeliveries(10)
.process { println 'MPI unreachable' }
.end()
.process(PixPdqCamelValidators.iti21RequestValidator())
.to('pdq-iti21://...')
.process(PixPdqCamelValidators.iti21ResponseValidator())
.process {
assert it.in.body instanceof MessageAdapter
println it.in.body
it.in.body = it.in.body.toString()
}
==========

this is our context.xml where hl7v2codec bean is defined:

==========
class="de.hhn.mi.coala.PDQRouteBuilder">
</bean>

<bean id="pdqModelExtension"
class="de.hhn.mi.coala.PDQModelExtension">
</bean>

<bean id="hl7codec"
class="org.apache.camel.component.hl7.HL7MLLPCodec">
<property name="charset" value="iso-8859-1" />
</bean>

<!-- HAPI extensions -->
<bean id="hapiModelExtension"

class="org.openehealth.ipf.modules.hl7.extend.HapiModelExtension">
<!-- <property name="mappingService" ref="..." /> -->
</bean>

<!-- General Mapping extensions <bean id="mappingExtension"
class="org.openehealth.ipf.commons.map.extend.MappingExtension">
<property name="mappingService" ref="..." /> </bean> --
>

<!-- Camel DSL extensions -->
<bean id="hl7ModelExtension"

class="org.openehealth.ipf.platform.camel.hl7.extend.Hl7ModelExtension">
</bean>

<bean id="coreModelExtension"

class="org.openehealth.ipf.platform.camel.core.extend.CoreModelExtension">
</bean>

<bean id="routeModelExtender"

class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender">
<property name="routeModelExtensions">
<list>
<ref bean="coreModelExtension" />
<ref bean="coreModelExtension" />
<ref bean="pdqModelExtension" />
<ref bean="hl7ModelExtension" />
<ref bean="hapiModelExtension" />
<artifactId>ipf</artifactId>
<version>${ipf-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.openehealth.ipf.platform-camel</
groupId>
<artifactId>platform-camel-ihe-pixpdq</
artifactId>
<version>${ipf-version}</version>
</dependency>
<!-- USE with Camel -->
<dependency>
<groupId>org.openehealth.ipf.platform-camel</
groupId>
<artifactId>platform-camel-hl7</artifactId>
<version>${ipf-version}</version>
</dependency>
<!-- HAPI version? -->
<!-- Dependency for HL7 v2.5 -->
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<!-- <version>0.6</version> -->
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<!-- <version>9.1.0.8</version> -->
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<!-- <version>2.5.6</version> -->
</dependency>
<dependency>
<groupId>org.openehealth.ipf.platform-camel</
groupId>
<artifactId>platform-camel-ihe-mllp</
artifactId>
<version>${ipf-version}</version>
<!--scope>test</scope -->
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.openehealth.ipf.commons</groupId>
<artifactId>commons-ihe-atna</artifactId>
<version>${ipf-version}</version>
Regards,

Wessam

On 9 Mai, 11:27, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Hi,
>
> 1. Does your route definition begin with from("direct:start") ?
> 2a. Does your pom.xml contain platform-camel-ihe-pixpdq as dependency?
> 2b. Did you define a HL7v2 codec as described early in this mailing list?
>
> Regards,
> Dmytro
>
> 2011/5/9 slowessam <wessamk...@googlemail.com>:
>
> > Hi Dmytro,
>
> > we still have an error in our reasoning. We used the first sample code
> > above with the endpoint: "direct:start"
> > but we get:
>
> > ===========
> > 2011-05-09T11:14:10,806 [main] WARN  - component.direct.DirectProducer
> > | No consumers available on endpoint: Endpoint[direct://start] to
> > process: Exchange[Message: MSH|^~\&|OHFConsumer|OHFFacility|
> > OTHER_KIOSK|HIMSSSANDIEGO|20070108145322-0800||QBP^Q22|
> > 9416994431147258002|P|2.5|
> > QPD|Q22^Find Candidates|78919563609746085572816010763...@PID.5.1^M*|
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 9, 2011, 6:55:25 AM5/9/11
to ipf-...@googlegroups.com
Because I don't see class and file names: are you sure that the route
is the one that is actually referenced from the Spring context, and
that the Spring context is the one that is actually referenced from
the application?

Regards,
Dmytro

2011/5/9 slowessam <wessa...@googlemail.com>:

Sven Siekmann

unread,
May 9, 2011, 11:23:52 AM5/9/11
to ipf-user
Hi Dmytro,

it seems as if we are not referring the Spring context. I looked at
the MllpTestContainer and tried to make the referrence in the
following way in our PDQTransactor:

public class PDQTransactor{

public static String sendPDQrequest(String request) throws Exception
{
CamelContext camelContext = new DefaultCamelContext();
ProducerTemplate producerTemplate = new
DefaultProducerTemplate(camelContext);

ClassPathXmlApplicationContext appContext = new
ClassPathXmlApplicationContext("./context.xml");
producerTemplate = appContext.getBean("template",
ProducerTemplate.class);
camelContext = appContext.getBean("camelContext",
CamelContext.class);

camelContext.start();
// prepare request
Exchange requestExchange = new DefaultExchange(camelContext);
requestExchange.getIn().setBody(request);

// send request
producerTemplate.start();
Exchange responseExchange = producerTemplate.send(
"direct:start", requestExchange);

// get response
String response = responseExchange.getOut().getBody(String.class);
camelContext.stop();
return response;
}
}
}
Now we are getting the following error:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'template': Initialization of bean failed;
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'camelContext': Invocation of init method
failed; nested exception is org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'routeModelExtender' defined in class path
resource [context.xml]: Invocation of init method failed; nested
exception is java.lang.ArrayIndexOutOfBoundsException: 0
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
527)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
190)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
563)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
425)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:
139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:
83)
at
de.hhn.mi.coala.binding.PDQTransactor.sendPDQrequest(PDQTransactor.java:
17)
[...]

Probably we are trying to connect the Spring context in the wrong way.
Or have we misconfigrured our context.xml?
class="de.hhn.mi.coala.groovy.PDQRouteBuilder">
</bean>

<bean id="pdqModelExtension"
class="de.hhn.mi.coala.groovy.PDQModelExtension">
</bean>

<bean id="hl7codec"
class="org.apache.camel.component.hl7.HL7MLLPCodec">
<property name="charset" value="iso-8859-1" />
</bean>

<!-- HAPI extensions -->
<bean id="hapiModelExtension"
class="org.openehealth.ipf.modules.hl7.extend.HapiModelExtension">
</bean>

<!-- Camel DSL extensions -->
<bean id="hl7ModelExtension"

class="org.openehealth.ipf.platform.camel.hl7.extend.Hl7ModelExtension">
</bean>

<bean id="coreModelExtension"

class="org.openehealth.ipf.platform.camel.core.extend.CoreModelExtension">
</bean>

<bean id="routeModelExtender"

class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender">
<property name="routeModelExtensions">
<list>
<ref bean="coreModelExtension" />
<ref bean="pdqModelExtension" />
<ref bean="hl7ModelExtension" />
<ref bean="hapiModelExtension" />
</list>
</property>
</bean>
</beans>

Id would be nice if you have a little hint for us. Thank you.

Best regards,

Sven


On 9 Mai, 12:55, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Because I don't see class and file names: are you sure that the route
> is the one that is actually referenced from the Spring context, and
> that the Spring context is the one that is actually referenced from
> the application?
>
> Regards,
> Dmytro
>
> 2011/5/9 slowessam <wessamk...@googlemail.com>:
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 9, 2011, 11:41:51 AM5/9/11
to ipf-...@googlegroups.com
1. The stack trace is incomplete, please show the complete one. It
seems that one of DSL model extensions is unable to be instantiated or
applied.
2. When you get Camel context and producer template from a Spring
application context, you do not need to start() them manually.

Regards,
Dmytro


2011/5/9 Sven Siekmann <sven.s...@web.de>:

Sven Siekmann

unread,
May 9, 2011, 11:45:49 AM5/9/11
to ipf-user
Here is the complete stack trace:
at
de.hhn.mi.coala.java.test.PDQMessageTest.testMPIConnection(PDQMessageTest.java:
17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod
$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:
15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:
41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:
20)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
76)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
197)
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'camelContext': Invocation of init
method failed; nested exception is
org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'routeModelExtender' defined in class path
resource [context.xml]: Invocation of init method failed; nested
exception is java.lang.ArrayIndexOutOfBoundsException: 0
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1420)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
190)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:
1075)
at
org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:
95)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:
394)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1413)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
519)
... 34 more
Caused by: org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'routeModelExtender' defined in class path
resource [context.xml]: Invocation of init method failed; nested
exception is java.lang.ArrayIndexOutOfBoundsException: 0
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:
1140)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:
56)
at
org.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:
105)
at
org.apache.camel.model.RouteBuilderDefinition.createRouteBuilder(RouteBuilderDefinition.java:
64)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.installRoutes(AbstractCamelContextFactoryBean.java:
683)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:
285)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1477)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1417)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'routeModelExtender' defined in class
path resource [context.xml]: Invocation of init method failed; nested
exception is java.lang.ArrayIndexOutOfBoundsException: 0
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1420)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
190)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
281)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
194)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:
1079)
at
org.apache.camel.spring.spi.ApplicationContextRegistry.lookup(ApplicationContextRegistry.java:
41)
at
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:
54)
... 51 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at
org.codehaus.groovy.runtime.dgmimpl.arrays.ObjectArrayGetAtMetaMethod.invoke(ObjectArrayGetAtMetaMethod.java:
38)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.invoke(PojoMetaMethodSite.java:
47)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:
52)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
40)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
116)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
124)
at
org.openehealth.ipf.commons.core.extend.ExtensionMethodActivator.generateExtensionCode(ExtensionMethodActivator.groovy:
69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
88)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite
$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:
148)
at
org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:
99)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:
48)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:
165)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:
181)
at org.openehealth.ipf.commons.core.extend.ExtensionMethodActivator
$_activate_closure2.doCall(ExtensionMethodActivator.groovy:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
88)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:
1070)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at groovy.lang.Closure.call(Closure.java:276)
at groovy.lang.Closure.call(Closure.java:289)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:
1198)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:
1174)
at org.codehaus.groovy.runtime.dgm$109.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite
$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:
270)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:
52)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
40)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
116)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
124)
at
org.openehealth.ipf.commons.core.extend.ExtensionMethodActivator.activate(ExtensionMethodActivator.groovy:
48)
at
org.openehealth.ipf.commons.core.extend.DefaultActivator.activate(DefaultActivator.java:
55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite
$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:
229)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:
52)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
40)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:
54)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
124)
at org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender
$_activate_closure1.doCall(DefaultModelExtender.groovy:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
88)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:
1070)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at groovy.lang.Closure.call(Closure.java:276)
at groovy.lang.Closure.call(Closure.java:289)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:
1198)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:
1174)
at org.codehaus.groovy.runtime.dgm$109.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite
$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:
270)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:
52)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
40)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
116)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
124)
at
org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender.activate(DefaultModelExtender.groovy:
72)
at org.openehealth.ipf.platform.camel.core.extend.RouteModelExtender
$activate.callCurrent(Unknown Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:
44)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:
141)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:
145)
at
org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender.afterPropertiesSet(DefaultModelExtender.groovy:
68)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1477)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1417)
... 62 more

Thanks.

best regards,

Sven


On 9 Mai, 17:41, Dmytro Rud <dmytro....@googlemail.com> wrote:
> 1. The stack trace is incomplete, please show the complete one.  It
> seems that one of DSL model extensions is unable to be instantiated or
> applied.
> 2. When you get Camel context and producer template from a Spring
> application context, you do not need to start() them manually.
>
> Regards,
> Dmytro
>
> 2011/5/9 Sven Siekmann <sven.siekm...@web.de>:
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 9, 2011, 12:14:52 PM5/9/11
to ipf-...@googlegroups.com
Can you show me the class de.hhn.mi.coala.groovy.PDQModelExtension ?

Regards,
Dmytro


2011/5/9 Sven Siekmann <sven.s...@web.de>:

Sven Siekmann

unread,
May 9, 2011, 2:17:36 PM5/9/11
to ipf-user
It's empty at the moment:

class PDQModelExtension {

}

Regards,

Sven


On 9 Mai, 18:14, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Can you show me the class de.hhn.mi.coala.groovy.PDQModelExtension ?
>
> Regards,
> Dmytro
>
> 2011/5/9 Sven Siekmann <sven.siekm...@web.de>:
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 9, 2011, 2:22:51 PM5/9/11
to ipf-...@googlegroups.com
Do not mention this file in context.xml.
DSL exension files are supposed to contain DSL extensions.

Dmytro.


Sven Siekmann writes:

>> Erfahren Sie mehr �

Sven Siekmann

unread,
May 9, 2011, 2:34:06 PM5/9/11
to ipf-user
Ok! Errors solved! But still the following problem when executing
test:

2011-05-09T20:31:58,269 [main] WARN - component.direct.DirectProducer
| No consumers available on endpoint: Endpoint[direct://start] to
process: Exchange[Message: MSH|^~\&|OHFConsumer|OHFFacility|
OTHER_KIOSK|HIMSSSANDIEGO|20070108145322-0800||QBP^Q22|
9416994431147258002|P|2.5|
QPD|Q22^Find Candidates|7891956360974608557281601076319|@PID.5.1^M*|
RCP|I|2^RD]

Testclass is as follows (--> AssertionError):
public class PDQMessageTest {

@Test
public void testMPIConnection() {
String reqString = "MSH|^~\\&|OHFConsumer|OHFFacility|OTHER_KIOSK|
HIMSSSANDIEGO|20070108145322-0800||"
+ "QBP^Q22|9416994431147258002|P|2.5|\nQPD|Q22^Find Candidates|"
+ "7891956360974608557281601076319|@PID.5.1^M*|\nRCP|I|2^RD";
try {
String retString = PDQTransactor.sendPDQrequest(reqString);
assertNotNull(retString);
} catch (Exception e) {
// should not happen
System.out.println("Wrong things happened!!!\n");
e.printStackTrace();
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 9, 2011, 2:43:31 PM5/9/11
to ipf-...@googlegroups.com
Your route definition contains a consumer for "direct:start", but the producerTemplate is unable to find it. So, either they run in different Camel contexts, or the route does not run at all, or the endpoint URI is incorrectly spelled somewhere, or...

(Definitely not an IPF issue.)

Best Regards,
Dmytro


Sven Siekmann writes:

>> Erfahren Sie mehr �

Sven Siekmann

unread,
May 9, 2011, 3:02:10 PM5/9/11
to ipf-user
Ok. Thanks for your help. Switched to the MllpTestContainer approach.
Works fine. Maybe try to investigate the other way later.

Best Regards,

Sven



On 9 Mai, 20:43, Dmytro Rud <dmytro....@googlemail.com> wrote:
> Your route definition contains a consumer for "direct:start", but the producerTemplate is unable to find it.  So, either they run in different Camel contexts, or the route does not run at all, or the endpoint URI is incorrectly spelled somewhere, or...
>
> (Definitely not an IPF issue.)
>
> Best Regards,
> Dmytro
>
>
>
>
>
>
>
> Sven Siekmann writes:
> > Ok! Errors solved! But still the following problem when executing
> > test:
>
> > 2011-05-09T20:31:58,269 [main] WARN  - component.direct.DirectProducer
> > | No consumers available on endpoint: Endpoint[direct://start] to
> > process: Exchange[Message: MSH|^~\&|OHFConsumer|OHFFacility|
> > OTHER_KIOSK|HIMSSSANDIEGO|20070108145322-0800||QBP^Q22|
> > 9416994431147258002|P|2.5|
> > QPD|Q22^Find Candidates|78919563609746085572816010763...@PID.5.1^M*|
> > RCP|I|2^RD]
>
> > Testclass is as follows (--> AssertionError):
> > public class PDQMessageTest {
>
> >    @Test
> >    public void testMPIConnection() {
> >            String reqString = "MSH|^~\\&|OHFConsumer|OHFFacility|OTHER_KIOSK|
> > HIMSSSANDIEGO|20070108145322-0800||"
> >                            + "QBP^Q22|9416994431147258002|P|2.5|\nQPD|Q22^Find Candidates|"
> >                            + "78919563609746085572816010763...@PID.5.1^M*|\nRCP|I|2^RD";
> ...
>
> Erfahren Sie mehr »

Dmytro Rud

unread,
May 10, 2011, 3:11:24 AM5/10/11
to ipf-user
BTW, your request message is invalid --- it does not contain segment
separators ('\r' or '\n'). After parsing it with HAPI you will get a
message with a looong MSH segment while all other segments will be
empty.

(But this is not the cause of the problem we discussed yesterday.)

Regards,
Dmytro

On 9 Mai, 20:34, Sven Siekmann <sven.siekm...@web.de> wrote:
> Ok! Errors solved! But still the following problem when executing
> test:
>
> 2011-05-09T20:31:58,269 [main] WARN  - component.direct.DirectProducer
> | No consumers available on endpoint: Endpoint[direct://start] to
> process: Exchange[Message: MSH|^~\&|OHFConsumer|OHFFacility|
> OTHER_KIOSK|HIMSSSANDIEGO|20070108145322-0800||QBP^Q22|
> 9416994431147258002|P|2.5|
> QPD|Q22^Find Candidates|78919563609746085572816010763...@PID.5.1^M*|
> RCP|I|2^RD]
>
> Testclass is as follows (--> AssertionError):
> public class PDQMessageTest {
>
>         @Test
>         public void testMPIConnection() {
>                 String reqString = "MSH|^~\\&|OHFConsumer|OHFFacility|OTHER_KIOSK|
> HIMSSSANDIEGO|20070108145322-0800||"
>                                 + "QBP^Q22|9416994431147258002|P|2.5|\nQPD|Q22^Find Candidates|"
>                                 + "78919563609746085572816010763...@PID.5.1^M*|\nRCP|I|2^RD";
> ...
>
> Erfahren Sie mehr »

slowessam

unread,
May 11, 2011, 7:34:26 AM5/11/11
to ipf-user
Hi Dmytro,

first of all thank you very much for your help and advises. We used
the first recommended scenario, we fixed the errors and now evrything
regarding to pdq is running.

Best regards

Sven and Wessam
Reply all
Reply to author
Forward
0 new messages