"ClassNotFoundException" when trying to use Jackson in a CDI + JAX-RS application deployed into EAP 6

Solution Verified - Updated -

Issue

I have one application that uses the JSON Jackson library and when we try to deploy it we have ClassNotFound exception. The dependency is, however, available in development. The stack trace is similar to the following:

INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-1) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.acme.YourClassThatUsesJackson
    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:167) [weld-core-1.1.8.Final-redhat-1.jar:1.1.8.Final-redhat-1]
    at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:108) [weld-core-1.1.8.Final-redhat-1.jar:1.1.8.Final-redhat-1]
    at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.8.Final-redhat-1.jar:1.1.8.Final-redhat-1]
    at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:123) [weld-core-1.1.8.Final-redhat-1.jar:1.1.8.Final-redhat-1]
    at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.8.Final-redhat-1.jar:1.1.8.Final-redhat-1]
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:350) [weld-core-1.1.8.Final-redhat-1.jar:1.1.8.Final-redhat-1]
    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
    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(Unknown Source) [rt.jar:1.7.0_15]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_15]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_15]
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonMappingException
... 
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException from [Module "deployment.teste-cdi-jackson.jar:main" from Service Module Loader]
... 

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.0
    • 6.0.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.