Community commons module compilation issue

0
I am using latest version of the community commons module for the mendix version 10.18.0.  But getting the below error while compiling. It was working fine but when I have imported the simple scheduler widget from the market place and try to run the application I am getting the below error.   D:\Mendix Project\ExplorationApp\javasource\communitycommons\StringUtils.java:231: error: cannot find symbol        return IOUtils.toString(BOMInputStream.builder().setInputStream(inputStream).get(), charset);                                              ^  symbol:   method builder()  location: class BOMInputStreamNote: Some input files use or override a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: D:\Mendix Project\ExplorationApp\javasource\simplescheduler\proxies\microflows\Microflows.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.1 error FAILURE: Build failed with an exception. * What went wrong:Execution failed for task ':compile'.> Compilation failed; see the compiler error output for details. * Try:> Run with --scan to get full insights. BUILD FAILED in 1s
asked
3 answers
3

This sounds like the Simple Scheduler module is bringing in an older version of the commons.io.jar library that is incompatible with Community Commons. 

 

To fix this, look in your application's userlib folder. If there is commons-io-X.X.X.jar file there, please delete it and try to build your application again.

 

Good luck!

answered
1

If you are using the latest Community commons, you can enable Gradle synchronization in Edit->Preferences->Deployment->Gradle synchronization and the correct jar versions will be downloaded to the vendorlib directory automatically.

Note, however, that if you have conflicting jars in your userlib directory, you will need to delete them manually.

Mendix should publish best practices for migrating to jar management with Gradle.

{DC32B719-EB19-43A1-85C7-D39B13039C04}.png

 

{13CA15AC-4C82-438F-98B6-CAF980A1E52D}.png

answered
0

This is issue is happening because of this line of code which is 

public static String stringFromInputStream(InputStream inputStream, Charset charset) throws IOUtils.toString(BOMInputStream.builder().setInputStream(inputStream).get(), charset);

which will you fine in first open your app in your directory then go to javasources in find community commons in there you will find this file called StringUtils.java open that file and then go to your line code 231 and replace the code with this code

return IOUtils.toString(new BOMInputStream(inputStream), charset); 

then your issue will get resolved.

answered