cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report Java API export to PDF error

pavants
Explorer
0 Kudos

Hello All,

I wrote a simple app that render a crystal report to pdf in java. This works correctly inside my Eclipse and if I export the jar and run it manually on my machine, if I move to another machine it doesn't work retunrning this error:

com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriterSpi could not be instantiated

With the below stack:

-[JRCCommunicationAdapter]- detected an exception: javax.imageio.spi.ImageReaderSpi: Provider com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi could not be instantiated
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)
at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at javax.imageio.ImageIO.<clinit>(Unknown Source)
at com.crystaldecisions.reports.common.image.ImageUtils.a(SourceFile:888)
at com.crystaldecisions.reports.common.image.ImageUtils.if(SourceFile:873)
at com.crystaldecisions.reports.common.JavaImage.do(SourceFile:183)
at com.crystaldecisions.reports.common.CrystalImage.createImage(SourceFile:50)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.FormattedBlobFieldObject.if(SourceFile:103)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.FormattedBlobFieldObject.<init>(SourceFile:57)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.FormattedReportObject.a(SourceFile:155)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.w.for(SourceFile:105)
----

Does someone had the same issue and have a workaround please?

Mike

Accepted Solutions (0)

Answers (1)

Answers (1)

pavants
Explorer
0 Kudos

Hello *

I found the solution by myself.

The issue is generated by

vendorName == null exception visible in the error stack

To resolve the issue edit the manifest file generated by eclipse and add these lines:

Main-Class: com.pacorini.crystal.Starter
Implementation-Vendor: Sun Microsystems, Inc
Implementation-Title: Java Runtime Environment

Implementation-Version: 1.8.0.191

Correct the java version accordingly.

Hope it helps someone else.