I get java.lang.NoClassDefFoundError when trying to convert a ppt to PDF

Following is the stack trace:
Exception in thread “main” java.lang.NoClassDefFoundError
at com.aspose.metafiles.obfuscated.au.do(SourceFile:93)
at com.aspose.metafiles.obfuscated.dF.do(SourceFile:48)
at com.aspose.metafiles.obfuscated.cJ.do(SourceFile:1083)
at com.aspose.metafiles.EmfMetafile.do(SourceFile:78)
at com.aspose.metafiles.EmfMetafile.(SourceFile:40)
at com.aspose.metafiles.Metafile.LoadMetafile(SourceFile:82)
at com.aspose.slides.obfuscated.va.do(SourceFile:491)
at com.aspose.slides.obfuscated.va.do(SourceFile:670)
at com.aspose.slides.obfuscated.va.drawImage(SourceFile:252)
at com.aspose.slides.PictureFrame.do(SourceFile:374)
at com.aspose.slides.Slide.do(SourceFile:1470)
at com.aspose.slides.Slide.saveToAps(SourceFile:1513)
at com.aspose.slides.obfuscated.vr.do(SourceFile:52)
at com.aspose.slides.Presentation.save(SourceFile:3398)
at com.aspose.slides.Presentation.save(SourceFile:3346)
at test.aspose.PptTest.main(PptTest.java:56)

I also have the metafiles jar in the classpath - this happens only with some presentations

OK. I found the problem.
It was a class loader collision. the jai jars were in both the ext folder of the jre and the project classpath.