Error installing itextpdf dependency in a servlet in AEM | Community
Skip to main content
Level 4
May 13, 2024

Error installing itextpdf dependency in a servlet in AEM

  • May 13, 2024
  • 2 replies
  • 1011 views

Hello, what happens is that I am creating a servlet that generates a pdf, this pdf structure is made with html and styles with css, once generated the pdf sends it to the frontend to be downloaded.


And the dependency itextpdf package is downloaded in my pom.xml:

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

When I just install the dependency it doesn't throw errors, but when I start to send to call the package in the servlet code I get the following error:

[com.itextpdf.text] in start level 20 but no bundle is exporting these for that start level.

Researching said that I need to declare maven-bundle-plugin to export and/or import the package and fix the error in the same pom.xml file that I installed the itextpdf dependency, which is the following code

<plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>5.1.5</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Export-Package>
                        com.itextpdf.text.*;version="[5.5,6)"
                    </Export-Package>
                </instructions>
            </configuration>
            </plugin>

but I keep getting errors, both the pom.xml and the servlet are in the core folder of the project, what can I do to solve it? I have tried several documentations and forum help but no matter how many times I do the solutions it still doesn't disappear

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

2 replies

Shashi_Mulugu
Community Advisor
Community Advisor
May 14, 2024
kautuk_sahni
Community Manager
Community Manager
May 20, 2024

@aaron_dempwolff Did you find the suggestion 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