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>



...