Compilation of Java action failed

0
Hello all,   I have imported the Deeplink module older version from 9.0.3 to 9.12.2  in mendix studio pro , after doing that I am getting below java action error in OIDC module even though if I remove the deeplink module still the error occurs, PFB error.   Buildfile: C:\Users\ArunKumar\Documents\Mendix\UM6P-main\deployment\build_core.xml compile:     [javac] Compiling 740 source files to C:\Users\ArunKumar\Documents\Mendix\UM6P-main\deployment\run\bin     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\DecodeJWTPlainText.java:36: error: cannot find symbol     [javac]         return new String(Base64.getUrlDecoder().decode(jwt.getPayload()));     [javac]                                                            ^     [javac]   symbol:   method getPayload()     [javac]   location: variable jwt of type DecodedJWT     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\DecodeVerifyJWTPlainText.java:58: error: method RSA256 in class Algorithm cannot be applied to given types;     [javac]         Algorithm algorithm = Algorithm.RSA256((RSAPublicKey) jwk.getPublicKey(), null);             [javac]                                        ^     [javac]   required: RSAKey     [javac]   found: RSAPublicKey,<null>     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\DecodeVerifyJWTPlainText.java:69: error: incompatible types: com.auth0.jwt.JWTVerifier cannot be converted to com.auth0.jwt.interfaces.JWTVerifier     [javac]         JWTVerifier verifier = verification.build(); //Reusable verifier instance     [javac]                                                  ^     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\DecodeVerifyJWTPlainText.java:71: error: cannot find symbol     [javac]         return new String(Base64.getUrlDecoder().decode(jwtv.getPayload()));     [javac]                                                             ^     [javac]   symbol:   method getPayload()     [javac]   location: variable jwtv of type DecodedJWT     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\GenerateJWT.java:72: error: method RSA256 in class Algorithm cannot be applied to given types;     [javac]             alg = Algorithm.RSA256(pubKey, privKey);     [javac]                            ^     [javac]   required: RSAKey     [javac]   found: RSAPublicKey,RSAPrivateKey     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\GenerateJWT.java:75: error: method RSA384 in class Algorithm cannot be applied to given types;     [javac]             alg = Algorithm.RSA384(pubKey, privKey);     [javac]                            ^     [javac]   required: RSAKey     [javac]   found: RSAPublicKey,RSAPrivateKey     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\GenerateJWT.java:78: error: method RSA512 in class Algorithm cannot be applied to given types;     [javac]             alg = Algorithm.RSA512(pubKey, privKey);     [javac]                            ^     [javac]   required: RSAKey     [javac]   found: RSAPublicKey,RSAPrivateKey     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\oidc\actions\GenerateJWT.java:101: error: cannot find symbol     [javac]         if (jwt.getkid() != null && !jwt.getkid().isBlank()) builder.withKeyId(jwt.getkid());     [javac]                                                                     ^     [javac]   symbol:   method withKeyId(String)     [javac]   location: variable builder of type Builder     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\saml20\implementation\DelegatedAuthenticationHandler.java:308: error: constructor ByteArrayEntity in class ByteArrayEntity cannot be applied to given types;     [javac]             httpPost.setEntity(new ByteArrayEntity(authnState.getModifiedSOAPRequest().getBytes(), ContentType.APPLICATION_SOAP_XML));     [javac]                                ^     [javac]   required: byte[]     [javac]   found: byte[],ContentType     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\saml20\implementation\DelegatedAuthenticationHandler.java:486: error: constructor ByteArrayEntity in class ByteArrayEntity cannot be applied to given types;     [javac]             ByteArrayEntity postData = new ByteArrayEntity(authnState.getModifiedSOAPResponse().getBytes(), ContentType.APPLICATION_SOAP_XML);     [javac]                                        ^     [javac]   required: byte[]     [javac]   found: byte[],ContentType     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\ArunKumar\Documents\Mendix\UM6P-main\javasource\saml20\implementation\DelegatedAuthenticationHandler.java:506: error: constructor ByteArrayEntity in class ByteArrayEntity cannot be applied to given types;     [javac]             ByteArrayEntity postData = new ByteArrayEntity(authnState.getModifiedSOAPResponse().getBytes(), ContentType.APPLICATION_SOAP_XML);     [javac]                                        ^     [javac]   required: byte[]     [javac]   found: byte[],ContentType     [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] 11 errors BUILD FAILED C:\Users\ArunKumar\Documents\Mendix\UM6P-main\deployment\build_core.xml:30: Compile failed; see the compiler error output for details. Total time: 16 seconds   Answers are really much appreciated!  
asked
1 answers
0

These issues are almost always caused by duplicate jar files in different versions. Since Mendix does not support a formal dependency management for these jar files yet, you’ll have to manually clean up the userlib folder by removing duplicates, keeping only the ones with the highest version number. 

You can also try to use the userlib cleaner: https://github.com/cinaq/mendix-userlib-cleaner (but handle with care).

As another alternative, you can remove all jar files form userlib (move the userlib content to a backup folder), and then import all marketplace modules again. But be careful if there are changes made in the marketplace modules (which you should not do, but happens all the time): these will be overwritten when re-importing the modules from the marketplace. Also be careful if you have a custom Java implementation that requires a specific jar file in the userlib.

Hope this helps,

Thorsten

answered