Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A required class was missing while executing org.mule.munit.tools: org/codehaus/jackson/annotate/JsonClass

Tags:

maven

mule

When I run mav test target getting following error:

        A required class was missing while executing org.mule.munit.tools:
                munit-maven-plugin:3.4-M4-SNAPSHOT:test: org/codehaus/jackson/annotate/JsonClass
            ...
            [ERROR] Number of foreign imports: 1
            [ERROR] import: Entry[import  from realm ClassRealm[project>com.sfdc.it.ei.esb.service:
    workday-employee-target-adapter:
        1.0.1-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
            [ERROR] 
            [ERROR] -----------------------------------------------------: org.codehaus.jackson.annotate.JsonClass
            [ERROR] -> [Help 1]
...
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/annotate/JsonClass

POM.xml:

 <munit.version>3.4-M4-SNAPSHOT</munit.version> 

    <testResources>
        <testResource>
            <directory>src/test/munit</directory>
        </testResource>
        <testResource>
            <directory>src/test/resources</directory>
        </testResource>     
    </testResources>

    <dependency>
        <groupId>org.mule.tests</groupId>
        <artifactId>mule-tests-functional</artifactId>
        <version>${mule.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
       <groupId>commons-cli</groupId>
       <artifactId>commons-cli</artifactId>
       <version>1.1</version>
    </dependency>
    <dependency>
       <groupId>org.mule.munit</groupId>
       <artifactId>munit-runner</artifactId>
       <version>${munit.version}</version>
       <scope>test</scope>
    </dependency>
    <dependency>
   <groupId>org.codehaus.jackson</groupId>
   <artifactId>jackson-core-asl</artifactId>
   <version>1.9.13</version>
</dependency>
<dependency>
       <groupId>org.codehaus.jackson</groupId>
       <artifactId>jackson-core-lgpl</artifactId>
       <version>1.9.7</version>
       <scope>runtime</scope>
    </dependency>

Do I need to include any dependency for JsonClass?

I have two projects, mule-tests-functional which is included in this project. If I run both the project separately( i.e without this dependency) maven in working fine.

like image 261
AKB Avatar asked Dec 20 '22 20:12

AKB


1 Answers

Using latest version (at time of writing 1.9.13) of jackson-mapper-asl fixed this issue for me :

<dependency>
    <groupId>org.codehaus.jackson</groupId>
    <artifactId>jackson-mapper-asl</artifactId>
    <version>1.9.13</version>
</dependency>
like image 64
blue-sky Avatar answered Apr 30 '23 14:04

blue-sky