Error while install and use dependencies AEM | Community
Skip to main content
Level 4
May 10, 2024
Solved

Error while install and use dependencies AEM

  • May 10, 2024
  • 2 replies
  • 2138 views

Hello, what happens is that I'm developing a code that asks me to install a package to implement it, this package is called: flying-saucer-pdf

To install it I need to add it through maven to my pom.xml file, the pom.xml file is located in the path:
core > pom.xml of the project.


What happens is that when running the build locally it throws the following error:


[org.xhtmlrenderer.pdf, com.lowagie.text] in start level 20 but no bundle is exporting these for that start level.

This is the dependency I use:

<dependencies>

<dependency>

<groupId>org.xhtmlrenderer</groupId>

<artifactId>flying-saucer-pdf</artifactId>

<version>9.1.22</version>

</dependency>

</dependencies>

What can I do to solve it, I have seen several cases with different solutions but none of them help me, I am doing all this at the project code level, I am not allowed to use the crxde UI or similar.

Am I installing the maven in the correct pom.xml or is there something I am doing wrong?

 

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

No, but I found the solution, what I need to do is first of all in the pom.xml file from core folder add the dependency as the following way:

<dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
    </dependency>

Then after that in the pom.xml file from all folder add the dependency again as:

<dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
    </dependency>
But in the same file, you need to embedd the dependency, to do that you need to add

<embedded>
     <groupId>com.itextpdf</groupId>
     <artifactId>itextpdf</artifactId>
     <target>target path</target>
</embedded>


And finally in the pom.xml file from the root of the project add the dependency:

<dependency>
                <groupId>com.itextpdf</groupId>
                <artifactId>itextpdf</artifactId>
                <version>5.5.13.2</version>
 </dependency>

2 replies

Shashi_Mulugu
Community Advisor
Community Advisor
May 10, 2024

@aaron_dempwolff is your external dependency flying-saucer-pdf osgi compatible? If yes you need to add that dependency to your all package similar to core dependency.

 

If that external dependency is not OSGI compatible, you create one.

 

 

https://aemconcepts.com/aem-osgi/use-3rd-party-api-or-jar-or-dependency-in-aem/

 

Revsolve External Dependencies in AEMaCS
https://www.linkedin.com/pulse/revsolve-external-dependencies-aemacs-arunkumar-papena?utm_source=share&utm_medium=member_android&utm_campaign=share_via

Level 4
May 11, 2024

Hello, how can I know if my dependency is compatible with osgi, I got it from the official maven repository.

https://mvnrepository.com/artifact/org.xhtmlrenderer/flying-saucer-pdf/9.1.22

By the way I tried the first link documentation and even doing all the steps I still have the same issue:

[requirements-capabilities] com.tfs:aem-tfs-project.common-core:0.0.1-SNAPSHOT: Artifact com.tfs:aem-tfs-project.common-core:0.0.1-SNAPSHOT requires [com.tfs.aem-tfs-project.common-core/0.0.1.SNAPSHOT] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))" in start level 20 but no artifact is providing a matching capability in this start level. (com.tfs:aem-tfs-project.all:0.0.1-SNAPSHOT)

tushaar_srivastava
Level 6
May 12, 2024

Hi @aaron_dempwolff  Maybe you can :  the error could be  Missing Dependency or incorrect version or dependency not available during speficied start level.
Checks if all the requirements declarations made in OSGi bundles are satisfied by the capabilities declarations of other bundles included in the Maven project.

An error would look like this:

[ERROR] org.acme:mybundle:0.0.1-SNAPSHOT: Artifact org.acme:mybundle:0.0.1-SNAPSHOT requires org.foo.bar in start level 20 but no artifact is providing a matching capability in this start level.

To troubleshoot, look at the manifest of the bundle that you would expect to be declaring a capability to determine why it is missing, or check in the manifest of the requiring bundle to see that the requirement in there is correct.

AEM as a Cloud Service SDK Build Analyzer Maven Plugin | Adobe Experience Manager

 

kautuk_sahni
Community Manager
Community Manager
May 16, 2024

@aaron_dempwolff Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
Aaron_DempwolffAuthorAccepted solution
Level 4
May 16, 2024

No, but I found the solution, what I need to do is first of all in the pom.xml file from core folder add the dependency as the following way:

<dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
    </dependency>

Then after that in the pom.xml file from all folder add the dependency again as:

<dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
    </dependency>
But in the same file, you need to embedd the dependency, to do that you need to add

<embedded>
     <groupId>com.itextpdf</groupId>
     <artifactId>itextpdf</artifactId>
     <target>target path</target>
</embedded>


And finally in the pom.xml file from the root of the project add the dependency:

<dependency>
                <groupId>com.itextpdf</groupId>
                <artifactId>itextpdf</artifactId>
                <version>5.5.13.2</version>
 </dependency>