Error after update community commons

Hi, I updated the comunity commons on a project, and after that when I try to run locally the project I get the following error: compile:     [javac] Compiling 615 source files to C:\Users\...-main_2\deployment\run\bin     [javac] C:\Users\...main_2\javasource\communitycommons\ error: method randomAlphanumeric in class RandomStringUtils cannot be applied to given types;     [javac]         String totalChars = RandomStringUtils.randomAlphanumeric(minLen - fixedNumber, maxLen - fixedNumber);     [javac]                                              ^     [javac]   required: int     [javac]   found: int,int     [javac]   reason: actual and formal argument lists differ in length     [javac] Note: Some input files use or override a deprecated API.     [javac] Note: Recompile with -Xlint:deprecation for details.     [javac] Note: C:\Users\...-main_2\javasource\saml20\implementation\common\ uses unchecked or unsafe operations.     [javac] Note: Recompile with -Xlint:unchecked for details.     [javac] 1 error   Now, even when I try to downgrade the community commons, I have the same error. How can I fix this?
4 answers

I have had this error before too. The problem often might be in the lang3 jar files. When you have multiple versions, errors occur. In this topic more information can be found:

For me the solution was in what Cyrille Guemba posted:

“To solve this, go in the userlib, and look for all the libraries with lang3, as below:

  • commons.lang3…
  • and also org.apache.commons.lang3…

remove all of them and keep the most recent one. I recommend to keep the most recent of type commons.lang3.”

Because the name starts different it is difficult to spot, but both commons.lang3 and org.apache.commons.lang3 is apparently the same library. When you have only one, the problem will probably be solved (don't forget to clean deployment directory before you run again).


Hi Rafael, 

Based on the following error it seems the issue is only with deployment directory. Please try cleaning it once.  


 [javac] Compiling 615 source files to C:\Users\...-main_2\deployment\run\bin
 [javac] C:\Users\...main_2\javasource\communitycommons\ error: method


This has been a thorn in my side for about a year (!!) now. CommunityCommons and other appstore modules like deeplink and SAML bring in JARs in the userlib that conflict. I already registered a ticket for this but Mendix is in no real hurry to fix it. There are workarounds, depending on the combination of appstore modules you use. Best to register a ticket with Mendix support so they can provide you with a workaround that at least allows you to continue. Also to raise the issue with Mendix support once more, hopefully it receives a bit more attention.


Edit: cleaning might help, could prevent you from the hassle with support.


I totally agree with Marcel Groeneweg.

What i sometimes do to fix issues, also when migrating to newer Mendix versions: empty the userlib folder and then reimport all appstore modules one by one. Most of the time that solves conflicts, but you also run the chance of removing an essential jar that was not imported via an appstore module but manually added by a previous developer. Or the chance that you undo previous manual changes in appstore modules. Regression testing is essential.