Including com.fasterxml.jackson dependency - Causing errors | Community
Skip to main content
Level 4
February 9, 2016

Including com.fasterxml.jackson dependency - Causing errors

  • February 9, 2016
  • 4 replies
  • 22051 views

I've added the following dependencies to my pom file

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>2.6.5</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.6.5</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.6.5</version>
            </dependency>

When I start my AEM server, I constantly get the following error ..

09.02.2016 11:41:55.297 *ERROR* [FelixStartLevel] ERROR: Error starting jcrinsta
ll:/apps/ewcm/install/ewcm.global.core-1.0.44-SNAPSHOT.jar (org.osgi.framework.B
undleException: Unresolved constraint in bundle ewcm.global.core [457]: Unable t
o resolve 457.7: missing requirement [457.7] osgi.wiring.package; (&(osgi.wiring
.package=com.fasterxml.jackson.core.type)(version>=2.6.0)(!(version>=3.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle ewcm.global.
core [457]: Unable to resolve 457.7: missing requirement [457.7] osgi.wiring.pac
kage; (&(osgi.wiring.package=com.fasterxml.jackson.core.type)(version>=2.6.0)(!(
version>=3.0.0)))
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:398
0)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2043)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1297)

        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
LevelImpl.java:304)
        at java.lang.Thread.run(Unknown Source)

Additionally, when I look in the system/console it says

com.fasterxml.jackson.core.type,version=[2.6,3) -- Cannot be resolved
com.fasterxml.jackson.databind,version=[2.6,3) -- Cannot be resolved

Thank you in advance for helping with this issue.

-Dean
            

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Lokesh_Shivalingaiah
Level 10
February 9, 2016

Goto http://<host>:<port>/system/console/bundles and see if all these 3 dependency bundles exists or not. If not, upload these bundles manually and it should resolve.

Post your pom.xml to see what is missing.

Level 4
February 9, 2016

I've attached the pom.xml

Checked system/console/bundles ... None of those bundles are deployed ...

I've attached the MANIFEST.MF as well.

Thank you for your help.

-Dean

Level 4
February 10, 2016

Can you try replacing your maven bundle plugin as mentioned below

I want to try configuring import package 

 

<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>

                        <Import-Package>

                            *.*
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>


I loaded the three individual jar files via http://localhost:4502/system/console/bundles.

Everything works fine now.

However, I still do not understand WHY I cannot add these files in the POM and have things work.

Isn't that the intent of the pom.xml file?

ronnyfm
Level 4
June 10, 2016

Try:

<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Export-Package> com.fasterxml.jackson.* </Export-Package> ... ... ... </instructions> </configuration> </plugin>

You need to export the package.

Level 2
August 11, 2017

I tried this. It does resolves the bundle issue but it causes the services to stop.

JoseBerciano
Level 3
October 4, 2017

Currently facing the same issue here in AEM 6.3 as mentioned in the first post.

com.fasterxml.jackson.databind,version=[2.9,3) -- Cannot be resolved

I am using the following dependency in my parent pom

<dependency>

<groupId>com.fasterxml.jackson.core</groupId>

<artifactId>jackson-databind</artifactId>

<version>2.9.1</version>

</dependency>

Downloading the package jackson-databind-2.9.1.jar and installing via package Install/update seems to be fixing the issue, although I was hoping to automate this process in the Maven build

I tried <Import-Package></Import-Package> but I could not get it to work.

Any suggestions?

ronnyfm
Level 4
October 4, 2017

Hi,

Did you try the export bundle as I suggest in a previous post?

January 15, 2019

Hi,

One solution, that we use in our project is :

  • Add jackson dependencies with maven scope provided

<!-- JACKSON -->
<dependency>

   <groupId>com.fasterxml.jackson.core</groupId>

   <artifactId>jackson-annotations</artifactId>

   <version>${jackson_version}</version>

   <scope>provided</scope>

</dependency>

<dependency>

   <groupId>com.fasterxml.jackson.core</groupId>

   <artifactId>jackson-core</artifactId>

   <version>${jackson_version}</version>

   <scope>provided</scope>

</dependency>

<dependency>

   <groupId>com.fasterxml.jackson.core</groupId>

   <artifactId>jackson-databind</artifactId>

   <version>${jackson_version}</version>

   <scope>provided</scope>

</dependency>

  • Embed jackson dependencies to your package via content-package-maven-plugin to avoid uploading third party jar via osgi console package install / update

<build>

   <plugins>

   <plugin>

   <artifactId>maven-clean-plugin</artifactId>

   </plugin>

   <plugin>

   <groupId>com.day.jcr.vault</groupId>

   <artifactId>content-package-maven-plugin</artifactId>

   <configuration>

   <embeddeds>

   <embedded>

   <groupId>com.fasterxml.jackson.core</groupId>

   <artifactId>jackson-annotations</artifactId>

   <target>/apps/${app-folder}/install</target>

   </embedded>

   <embedded>

   <groupId>com.fasterxml.jackson.core</groupId>

   <artifactId>jackson-core</artifactId>

   <target>/apps/${app-folder}/install</target>

   </embedded>

   <embedded>

   <groupId>com.fasterxml.jackson.core</groupId>

   <artifactId>jackson-databind</artifactId>

   <target>/apps/${app-folder}/install</target>

   </embedded>

   </embeddeds>

   </configuration>

   </plugin>

   </plugins>

</build>