Upgraded Community Commons Module now getting java compile error

4
I just upgraded to the latest community commons module in my project and now i'm getting a Java compile error:   [javac] \\Mac\Home\Documents\Mendix\SGMS2-main\javasource\communitycommons\Misc.java:656: error: unreported exception COSVisitorException; must be caught or declared to be thrown     [javac]         overlay.overlay(new HashMap<Integer, String>()).save(baos);     [javac]                                                             ^   Has anyone seen this before?
asked
3 answers
21

I suspect it's a library conflict. Do you have fontbox-1.8.5.jar, joda-time-1.6.2.jar and pdfbox-1.8.5.jar in the userlib folder of your project?
You should remove these (see release notes of the module for more details).

answered
1

Open the project in eclipse.

Go to the error and use quick fix from the context menu, this will give you the option to add the throws declaration to fix the error.

answered
1

Strange, I thought this error had already been corrected. Are you sure you have downloaded the latest version from the App Store?

If you still have the error, you could try the following. Edit ...\javasource\communitycommons\Misc.java

Add the line in the import section (about line 24) : import org.apache.pdfbox.exceptions.COSVisitorException;

Edit the line (about line 641) to add the COSVisitorException, like

    public static boolean overlayPdf(IContext context, IMendixObject generatedDocumentMendixObject, IMendixObject overlayMendixObject) throws IOException, COSVisitorException {    

Hope this helps.

 

answered