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.

Error installing itextpdf dependency in a servlet in AEM

Avatar

Level 5

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

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Administrator

@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