We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

java.lang.NoClassDefFoundError: com/aspose/ms/System/b/a

Environment:

Linux 2.6.32-431.11.2.el6.x86_64

java version "1.7.0_51"
Java™ SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot™ 64-Bit Server VM (build 24.51-b03, mixed mode)

aspose libs:
‘com.aspose:cells:7.5.3’
‘com.aspose:words:13.8.0’
‘com.aspose:pdf:4.1.2’
'com.aspose:slides:7.7.0’

Problem description:
after standard call to javax.imageio.ImageIO.write, I’ve got an exception:
{code}
java.lang.NoClassDefFoundError: com/aspose/ms/System/b/a
at com.aspose.ms.imagecodecs.png.spi.PngImageWriter.a(Unknown Source)
at com.aspose.ms.imagecodecs.png.spi.PngImageWriter.write(Unknown Source)
at javax.imageio.ImageWriter.write(ImageWriter.java:615)
at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
at javax.imageio.ImageIO.write(ImageIO.java:1578)

{code}

What is wrong there?

Hi Martin,

Can you please share your complete code and your sample file(s) to reproduce the issue?

Best Regards,

Hi,


It is not so easy to reproduce - it really depends on the application start up. (I think in successful case com.aspose.ms.imagecodecs.png.spi.PngImageWriter.write is not registered to process images).

What I have seen in the com.aspose.ms.imagecodecs.png.spi.PngImageWriter.a method

private static void a(BufferedImage bufferedimage, IIOMetadata iiometadata)
{
try
{
float f = ((Float)bufferedimage.getProperty(“dpiX”)).floatValue();
bufferedimage = ((Float)bufferedimage.getProperty(“dpiY”)).floatValue();
double d = (1.0D * (double)bufferedimage) / 10D / 2.54D;
double d1 = (1.0D * (double)f) / 10D / 2.54D;
(bufferedimage = new IIOMetadataNode(“HorizontalPixelSize”)).setAttribute(“value”, Double.toString(d));
IIOMetadataNode iiometadatanode;
(iiometadatanode = new IIOMetadataNode(“VerticalPixelSize”)).setAttribute(“value”, Double.toString(d1));
IIOMetadataNode iiometadatanode1;
(iiometadatanode1 = new IIOMetadataNode(“Dimension”)).appendChild(bufferedimage);
iiometadatanode1.appendChild(iiometadatanode);
(bufferedimage = new IIOMetadataNode(“javax_imageio_1.0”)).appendChild(iiometadatanode1);
if(iiometadata != null)
iiometadata.mergeTree(“javax_imageio_1.0”, bufferedimage);
return;
}
catch(Exception _ex)
{
com.aspose.ms.System.b.a.a(“PNG dpi metadata was not saved”);
}
}


1. Exception is catched but it is not propogated to the com.aspose.ms.System.b.a.a
2. pdf-4.1.2 has dependency on com.aspose.ms.System.b.a which is not in the classpath (according to log).
But:
$ find . -name ‘.jar’ -print0 | xargs -0 -I ‘{}’ sh -c 'jar tf {} | grep PngImageWriter.class && echo {}'
com/aspose/ms/imagecodecs/png/spi/PngImageWriter.class
./apache-tomcat-7.0.47/webapps/ROOT/WEB-INF/lib/pdf-4.1.2.jar
$ find . -name '.jar’ -print0 | xargs -0 -I ‘{}’ sh -c 'jar tf {} | grep com/aspose/ms/System/b/a.class && echo {}'
com/aspose/ms/System/b/a.class
./apache-tomcat-7.0.47/webapps/ROOT/WEB-INF/lib/pdf-4.1.2.jar

com.aspose.ms.System.b.a is in the pdf-4.1.2.jar.
I was not able to reproduce this issue on Windows (linux only).

3. com.aspose.ms.System.b.a.a method is empty.

Do you have any recommendation how to fix it?
(Could check whether dpiX/dpiY is not
/**
* The UndefinedProperty object should be returned whenever a
* property which was not defined for a particular image is fetched.
*/
public static final Object UndefinedProperty = new Object();

help?

)

Regards
Martin

Hi Martin,

We will investigate the issue in detail and let you know.

Best Regards,

Hi Martin,

The versions you are using are around a year old. Can you please also try with the latest versions?

Best Regards,

Is there any possibility to avoid the use of com.aspose.ms.imagecodecs.png.spi.PngImageWriter?

PngImageWriter was removed in the latest libs.

Hi,


pdf-> 9.1.0
slides-> 8.6.0

error is similar:
java.lang.NoClassDefFoundError: com/aspose/ms/imagecodecs/tiff/spi/metadata/TiffImageMetadata
at com.aspose.ms.imagecodecs.tiff.spi.TiffImageWriterSpi.createWriterInstance(Unknown Source)

Hi Martin,

The classes you are referring are internal and we were unable to reproduce this issue using our samples and code at our end. Your assistance will be required to reproduce this issue. Can you please share your complete code and sample documents?

It would be even better if you can share a sample application to reproduce the issue. This issue is not general and your samples will help us find what is going wrong.

Best Regards,

Hi,


does it make sense to reproduce this issue on the following configuration:
Environment:
Linux 2.6.32-431.11.2.el6.x86_64

java version "1.7.0_51"
Java™ SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot™ 64-Bit Server VM (build 24.51-b03, mixed mode)

aspose libs:
‘com.aspose:cells:7.5.3’
‘com.aspose:words:13.8.0’
‘com.aspose:pdf:4.1.2’
‘com.aspose:slides:7.7.0’


We are not planning to upgrade.


Hi Martin,

We will test again in detail and try to reproduce the issue and will let you know once done. Sorry for the inconvenience.

Best Regards,

Hi Martin,

Sorry, we were unable to reproduce this issue using our samples. Can you please attach your samples to reproduce the issue. Also, the versions you are using are a bit old now. Can you please give latest versions a try and let us know if it works for you.

Best Regards,

Hi Muhamad.



Regards
Martin

Hi Martin,

Thanks for this link. I have asked my colleague to check the status of that issue and update in the mentioned thread.

Best Regards,