Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Including com.fasterxml.jackson dependency - Causing errors

Avatar

Level 5

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
            

16 Replies

Avatar

Level 10

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.

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

While I take a look at it, you can download these bundles here [1] and upload it manually from the console and check if that resolves the issue

[1] http://mvnrepository.com/artifact/com.fasterxml.jackson.core

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>

Same error.

org.osgi.framework.BundleException: Unresolved constraint in bundle ewcm.global.
core [457]: Unable to resolve 457.10: missing requirement [457.10] osgi.wiring.p
ackage; (&(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)

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?

It should be.. 

Basically, these jar files are not present in the adobe public repository and hence it is not able to download the same via mvn. I will let you know what can be done for the same

Regards,

Lokesh

Avatar

Level 2

Could you find anything for this?
I still cannot resolve the issue

Avatar

Level 4

What the error.log say when the bundle stops? If all dependencies are resolved, there could be another reason for the bundle error.

@Lokesh_Shivalingaiah 

I am facing the same issue. Have you find anything related to above?

Avatar

Level 4

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.

Avatar

Level 2

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

Avatar

Level 3

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?

Avatar

Level 4

Hi,

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

Avatar

Level 1

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>