31.7.09

Camel Mina and "java.lang.NoSuchFieldError: name" error

We decide to use IPF for HL7 processing validation and integration. If you think HAPI is not enough or a bit cumbersome for you IPF might be the solution you look for.

Anyway after reading tutorials I try to write an example app which uses Camel-mina component to listen tcp for messages. But there is strange error thrown by Surefire component. After googling and trying a few hours finally I can find the solution here. The problem is about dependencies camel-mina component depends on both mina-core 1.1.7  and slf4j 1.5.5 while the mina-core 1.1.7 itself depends on slf4j 1.4.3.

And the solution is reorganizing dependencies in pom.xml as below;

...

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-hl7</artifactId>
            <version>1.6.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.mina</groupId>
                    <artifactId>mina-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-mina</artifactId>
            <version>1.6.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.mina</groupId>
                    <artifactId>mina-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.mina</groupId>
            <artifactId>mina-core</artifactId>
            <version>1.1.7</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>



...

1 yorum:

  1. You can probably as well just add a dependency on version 1.5.5 of slf4j-simple or slf4j-log4j12 in your pom, which will override the outdated slf4j api.

    Also, please use camel-hl7 1.6.1 due to a severe bug in 1.6.0 [issues.apache.org/activemq/browse/CAMEL-1566], which cuts HL7 messages after 1kb.

    If you have more questions about IPF, give us a note on ipf-user@gforge.openehealth.org

    best regards
    Christian

    YanıtlaSil