runtime error for org.xhtmlrenderer.pdf.ITextRenderer

Avatar

Avatar
Level 1
Dipanjan1986
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
Dipanjan1986
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
Dipanjan1986
Level 1

03-11-2020

I am trying to do a poc for html to pdf generation.

I am using the dependency as below. 

 

<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-core</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-openpdf</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-itext5</artifactId>
<version>9.1.20</version>
</dependency>

<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-osgi</artifactId>
<version>9.1.2</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-core</artifactId>
<version>9.1.20</version>
</dependency>

<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-openpdf</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId>
<version>9.1.20</version>
</dependency>

 

and in plugin I have added this line 

<Import-Package>javax.inject;version=0.0.0,org.xhtmlrenderer.*;resolution:=optional,*</Import-Package>

 

The build is fine and the bundle is active. 

In my code I am able to get the apis of ITextRenderer. 

org.xhtmlrenderer.pdf.ITextRenderer iTextRenderer = new org.xhtmlrenderer.pdf.ITextRenderer();

 

But on Runtime I am getting this exception in error.log.

java.lang.ClassNotFoundException: org.xhtmlrenderer.pdf.ITextRenderer

 

Anyone please help ? 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 3
kiranparab
Level 3

Likes

23 likes

Total Posts

36 posts

Correct reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Level 3
kiranparab
Level 3

Likes

23 likes

Total Posts

36 posts

Correct reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
kiranparab
Level 3

03-11-2020

Looks like Depedency is not enough to cover this package to get imported for PDF package "org.xhtmlrenderer.pdf.ITextRenderer iTextRenderer" as it is still in installed state.

 

If you are building this using Eclipse, After package build please see if you find the below JAR getting downloaded in Eclipse with this respected class available "org.xhtmlrenderer.pdf.ITextRenderer iTextRenderer". If not means you are missing the depdency to fullfill the package requirement for "org.xhtmlrenderer.pdf.ITextRenderer iTextRenderer".

 

Answers (1)

Answers (1)

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

03-11-2020

Hi @Dipanjan1986 

Does itextpdf is in your bundle classpath? If not try adding to your bundle and check once.

AG