No class definition found error with Aspose slides

Hi,

I am using Aspose 16.11 version. It was working fine in local setup , but when deployed in Linux server it’s giving below error. Please reply ASAP
java.lang.NoClassDefFoundError: Could not initialize class com.aspose.slides.ms.pbdb106a0.p6a2feef8.q
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:434)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)
at org.jboss.ejb.Container.invoke(Container.java:1072)
at sun.reflect.GeneratedMethodAccessor345.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)

@sivanakshay,

I have observed your comments. Can you please share sample project to reproduce issue along with complete environment details so that we may further investigate to help you out.

public void buildDocument(List dashboardInfo, Dashboard dashboard, DashboardAdt dashboardAdt,
Locale locale, String tennantId, String fileName, AggregatedJMSExportMessage jmsMsg) throws Exception {
ExportTemplateUtil.setPresentaionLicense();
int slideCount = 0;
StringBuilder dashletList = new StringBuilder("");
int dashletCount = 1;
for (DashboardExportInfo exportInfo : dashboardInfo) {
if (exportInfo.getDataTable() != null) {
dashletList.append(dashletCount + “. " + exportInfo.getDashletName());
dashletList.append(”\n");
dashletCount++;
}
}
ExportTemplateService exportTemplateService = ExportTemplateFactory.getExportTemplateService();
ExportTemplate exportTemplate = exportTemplateService.getPPTExportTemplate(tennantId);
Presentation template;
Presentation defaultTemplate = null;
String templateFilePath = EnvironmentSettings.getInstance().getValue(“CONFIG_BASE_DIR”);
if (exportTemplate != null && !exportTemplate.getDisabled()) {
template = ExportTemplateUtil.loadPresentation(exportTemplate.getFilePath());
defaultTemplate=new Presentation(templateFilePath + File.separator +“default.pptx”);

	} else {
		exportTemplate=new ExportTemplate();
		exportTemplate.setContentPresent(true);
		exportTemplate.setCoverPresent(true);
		exportTemplate.setDisabled(false);
		exportTemplate.setEndPresent(true);
		template = new Presentation(templateFilePath + File.separator +"default.pptx");
	}
	ISlide templateSlide;

	if (exportTemplate.isCoverPresent()) {
		if(exportTemplate.isContentPresent())
		{
			templateSlide = template.getSlides().get_Item(1);
		}
		else
		{
			templateSlide = defaultTemplate.getSlides().get_Item(1);
		}
		DynamicContent dynamicContent;
		dynamicContent = DynamicContent.build(jmsMsg.getAdhocQuery().getCubeName(), dashboard.getStrName(),
				dashboard.getStrDescription(), DateUtils.getDateFormatObj(dashboardAdt.getUser()),
				dashboardAdt.getUser().getCompanyName(),
				dashboardAdt.getUser().getFirstName() + " " + dashboardAdt.getUser().getLastName());
		template = exportTemplateService.getPPTExportForDashboard(template, dynamicContent);
	} else {
		if(exportTemplate.isContentPresent())
		{
			templateSlide = template.getSlides().get_Item(0);
		}
		else
		{
			templateSlide = defaultTemplate.getSlides().get_Item(1);
		}
	}

	IShape chartPlaceHolderShape = null;
	IShape titlePlaceHolderShape = null;
	for (IShape shape : templateSlide.getShapes()) {
		if (shape.getPlaceholder() != null && shape.getPlaceholder().getType() == PlaceholderType.Object) {
			chartPlaceHolderShape = shape;
			break;
		}
		
	}
	for (IShape shape : templateSlide.getShapes()) {
		if (shape.getPlaceholder() != null && shape.getPlaceholder().getType() == PlaceholderType.Title) {
			titlePlaceHolderShape = shape;
			break;
		}
		
	}
	if (chartPlaceHolderShape == null) {
		chartPlaceHolderShape = new AsposeShape();
		chartPlaceHolderShape.setX((float) 10);
		chartPlaceHolderShape.setY((float) 158.71904);
		chartPlaceHolderShape.setHeight((float) 271.7018);
		chartPlaceHolderShape.setWidth((float) 700.1634);
	}
	if (exportTemplate != null && exportTemplate.isCoverPresent())
	{
		template.getSlides().insertClone(++slideCount, templateSlide);
	}
	createSummarySlide(dashboard, jmsMsg.getAdhocQuery().getCubeName(), locale, dashletList, dashboardAdt.getEmailId(),
			template.getSlides().get_Item(slideCount), chartPlaceHolderShape,titlePlaceHolderShape);
	++slideCount;
	String numberFormat = jmsMsg.getUser().getPreference().getNumberFormat();
	if(numberFormat==null||numberFormat.isEmpty())
	{
		numberFormat= "###,###.###";
	}
	for (DashboardExportInfo exportInfo : dashboardInfo) {
       
		template = createSlides(slideCount, template, templateSlide, chartPlaceHolderShape, titlePlaceHolderShape,
				exportInfo,numberFormat);

	}
	
	//int size = template.getSlides().size();

/* if(exportTemplate.isContentPresent())
{
if (exportTemplate.isEndPresent())
{
template.getSlides().removeAt(size-2);
}
else
{
template.getSlides().removeAt(size-1);
}
}*/
if (exportTemplate.getIncludeConfidentialityDisclaimer()&& titlePlaceHolderShape!=null)
{
ISlide sld = template.getSlides().addClone(templateSlide);
//ISlide sld = template.getSlides().get_Item(template.getSlides().size()-1);
IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, chartPlaceHolderShape.getX(), chartPlaceHolderShape.getY(), chartPlaceHolderShape.getWidth(), chartPlaceHolderShape.getHeight());
ashp.addTextFrame(“Confidentiality Disclaimer”);
ITextFrame txtFrame = ashp.getTextFrame();
IParagraph para = txtFrame.getParagraphs().get_Item(0);
IPortion portion = para.getPortions().get_Item(0);
portion.setText(jmsMsg.getStrCompanyDisclaimer());
IAutoShape dashboardTitle = sld.getShapes().addAutoShape(ShapeType.Rectangle, titlePlaceHolderShape.getX(),
titlePlaceHolderShape.getY(), titlePlaceHolderShape.getWidth(),
titlePlaceHolderShape.getHeight());
ITextFrame dashboardTitleTf = dashboardTitle.getTextFrame();
dashboardTitleTf.getParagraphs().get_Item(0).getPortions().get_Item(0).setText(“Confidentiality Disclaimer”);

			if(exportTemplate.isContentPresent())
			{
				if (exportTemplate.isEndPresent())
				{
					template.getSlides().removeAt(template.getSlides().size()-3);
				}
				else
				{
					template.getSlides().removeAt(template.getSlides().size()-2);
				}
			}
		
		
	}
	else
	{
		if(exportTemplate.isContentPresent())
		{
			if (exportTemplate.isEndPresent())
			{
				template.getSlides().removeAt(template.getSlides().size()-2);
			}
			else
			{
				template.getSlides().removeAt(template.getSlides().size()-1);
			}
		}
	}
	/*if (exportTemplate.getIncludeConfidentialityDisclaimer())
	{
		if(exportTemplate.isEndPresent())
		{
			ISlide sld = template.getSlides().get_Item(template.getSlides().size()-1);
			IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, chartPlaceHolderShape.getX(), chartPlaceHolderShape.getY(), chartPlaceHolderShape.getWidth(), chartPlaceHolderShape.getHeight());
			ashp.addTextFrame(" ");
			ITextFrame txtFrame = ashp.getTextFrame();
			IParagraph para = txtFrame.getParagraphs().get_Item(0);
			IPortion portion = para.getPortions().get_Item(0);
			portion.setText(jmsMsg.getStrCompanyDisclaimer());
		
		}
	}*/
	template.save(fileName + '.' + PPTX_TYPE, SaveFormat.Pptx);

}

Hi i feel this has got nothing to do with code. Got a similar issue in your forum SLIDESJAVA-35086. Please let me know how we can solve this issue

below are the logs:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.aspose.slides.ms.pbdb106a0.p6a2feef8.q
at com.aspose.slides.p6a2feef8.pafdec700.k.do(Unknown Source)
at com.aspose.slides.p6a2feef8.pafdec700.k.do(Unknown Source)
at com.aspose.slides.p6a2feef8.pafdec700.h.do(Unknown Source)
at com.aspose.slides.acm.do(Unknown Source)
at com.aspose.slides.abz.(Unknown Source)
at com.aspose.slides.abz.do(Unknown Source)
at com.aspose.slides.bvu.int(Unknown Source)
at com.aspose.slides.bvu.extends(Unknown Source)
at com.aspose.slides.bum.do(Unknown Source)
at com.aspose.slides.bum.do(Unknown Source)
at com.aspose.slides.bum.(Unknown Source)
at com.aspose.slides.TextFrame.do(Unknown Source)
at com.aspose.slides.TextFrame.do(Unknown Source)
at com.aspose.slides.TextFrame.else(Unknown Source)
at com.aspose.slides.ca.do(Unknown Source)
at com.aspose.slides.agd.do(Unknown Source)
at com.aspose.slides.agd.do(Unknown Source)
at com.aspose.slides.ec.do(Unknown Source)
at com.aspose.slides.bod.do(Unknown Source)
at com.aspose.slides.bgm.do(Unknown Source)
at com.aspose.slides.bex.do(Unknown Source)
at com.aspose.slides.SlideCollection.addClone(Unknown Source)
at com.aspose.slides.SlideCollection.insertClone(Unknown Source)

Environment Details:
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.9 (Santiago)
Release: 6.9
Codename: Santiago

@sivanakshay,

I have observed your comments. Can you please try to use Aspose.Slides latest version 17.10 on your end. Please share feedback with us if there is still an issue so that we may further proceed to help you out.

Hi Adnan,

Upgrading the jar to latest version solved the issue. But i need RCA for this issue.

Please let us know what the issue was, IN which version.platform it is reproducible and the version in which it was fixed.

Thanks and regards,
Akshay

@sivanakshay,

I have observed your comments. I regret to inform that issue occurs due to internal initialization of fonts, some fonts do not load properly. This issue was reproduced in Aspose.Slides for Java 15.8.0 and than was resolved in Aspose.Slides for Java 16.4.0.

please respond asap. I have seen such issues in your forum before like Nullpointerexception at SlideCollection.addclone method - #6 by nikhilskedar. Please let me know in what circumstances/environment the issue is present

Hi adnan,

Please let me know if you had any issues stating no class def found. Like java.lang.NoClassDefFoundError: Could not initialize class com.aspose.slides.ms.pbdb106a0.p6a2feef8.q
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:434)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209)

We get this issue with aspose slides 16.11 and 16.12. This worked fine in local and qc setups. But failed in production. We had to apply an urgent patch of aspose release 17.12 to fix this issue.

Please help us know why this issue was not reproducible in some setups. Do you have any fix in 17.x versions which specifically addresses this issue. We need this to update rca so that we can avoid such issues in other setups . Please reply asap

@sivanakshay,

I have observed similar inquiry from you in another forum thread as well. I request you to please provide Java details, Operating System details, sample application along with source presentation and complete stack trace. I will share with our product team to analyze RCA of the issue if possible by adding an investigation ticket. Please share the requested information with us.

Hi mudassir,

I have already shared the requested information in previous threads. Can you share with me what was fixed in SLIDESJAVA-35738? . Was that an environment specific issue?

Thanks and regards,
Akshay

hello,

I have made a list of os version,Aspose jars and where they are failing

Linux version Aspose slides 16.11 Aspose slides 17.12
CentOS release 6.6 (Final) Working Working
CentOS release 6.7 Fail Working
Red Hat Enterprise Linux Server release 6.9 Fail Working
Red Hat Enterprise Linux Server release 6.8 (Santiago) Fail Working
Red Hat Enterprise Linux Server release 6.7 (Santiago) Fail Working

Please confirm if aspose slides 16.11 has a problem with linux 6.6 + Versions.

@sivanakshay,

I like to share that the concerned, SLIDESJAVA-35738 has not been reproduced by our product team using latest version when it was scheduled. Therefore, there is not RCA available for the issue that what went wrong in 16.11 that things are working in 17.12. I have requested our product team to share the details (if possible) in this regard that what was issue in 16.11. We will share the feedback with you as soon as it will be shared by our product team.

Hi Mudassir,

it has been mentioned in Aspose.Slides for Java 17.5 Release Notes that issue 35738 has been fixed. I believe this issue fix is present in version 17.5. Please let me know what the rca was.

Thanks and regards,
Akshay

@sivanakshay,

I have observed the ticket SLIDESJAVA-35738 on my end. It has been associated with following thread:

The SLIDESJAVA-35738 is relate to fonts problem. I have added a new issue with ID SLIDESJAVA-36732 in our issue tracking system to provide RCA for the issue SLIDESJAVA-35738. I also request you to please provide JDK version used along with information about Open or Oracle JDK. Please also provide information about installed fonts using following command:

fc-list command

We will be able to investigate the issue further on provision of requested information.

@sivanakshay,

We have tested using latest Aspose.Slides for Java on our end and have not been able to reproduce the problem described in SLIDESJAVA-35738. We have used CentOS 6.6 CentOS 6.7, RHEL Server 6.8, RHEL Server 6.9, RHEL Server 6.5 with JDK 1.8 and Aspose.Slides for Java 16.11.0 works fine (also I checked 16.10.0). Can you please try the same on your end and share your feedback.

Can you please share a list of installed fonts for CentOS 6.6, CentOS 6.7, RHEL 6.8 and RHEL 6.9?

The issues you have found earlier (filed as SLIDESJAVA-36732) have been fixed in this update.