Java compile error

1
Hi Mendix,   After upgrading my project from Mx 7.23.19 to 8.18.6, I'm getting compile error:   Buildfile: C:\Users\Desktop\TLS Main v8.18.6\deployment\build_core.xml   compile:     [javac] Compiling 757 source files to C:\Users\Desktop\TLS Main v8.18.6\deployment\run\bin     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\CreateSignature.java:19: error: cannot find symbol     [javac] import sun.misc.BASE64Decoder;     [javac]                ^     [javac]   symbol:   class BASE64Decoder     [javac]   location: package sun.misc     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\CreateSignature.java:20: error: cannot find symbol     [javac] import sun.misc.BASE64Encoder;     [javac]                ^     [javac]   symbol:   class BASE64Encoder     [javac]   location: package sun.misc     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\VerifySignature.java:18: error: cannot find symbol     [javac] import sun.misc.BASE64Decoder;     [javac]                ^     [javac]   symbol:   class BASE64Decoder     [javac]   location: package sun.misc     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\CreateSignature.java:41: error: cannot find symbol     [javac]                           byte[] privateKeyBytes = new BASE64Decoder().decodeBuffer(this.PPK);     [javac]                                                        ^     [javac]   symbol:   class BASE64Decoder     [javac]   location: class CreateSignature     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\CreateSignature.java:52: error: cannot find symbol     [javac]                     return new BASE64Encoder().encode(signatureBytes);     [javac]                                ^     [javac]   symbol:   class BASE64Encoder     [javac]   location: class CreateSignature     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\ExecuteMicroflowSynchronized.java:73: error: cannot find symbol     [javac]                           ArrayList<IFeedback> arrayList = new ArrayList<IFeedback>(newContext.getFeedbackList());     [javac]                                                                                               ^     [javac]   symbol:   method getFeedbackList()     [javac]   location: variable newContext of type IContext     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\ExecuteMicroflowSynchronized.java:76: error: cannot find symbol     [javac]                                         context.addFeedback(feedback);     [javac]                                                ^     [javac]   symbol:   method addFeedback(IFeedback)     [javac]   location: variable context of type IContext     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\VerifySignature.java:39: error: cannot find symbol     [javac]                           byte[] publikKeyBuytes = new BASE64Decoder().decodeBuffer(this.PublicKeyParameter1);     [javac]                                                        ^     [javac]   symbol:   class BASE64Decoder     [javac]   location: class VerifySignature     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\appactions\VerifySignature.java:48: error: cannot find symbol     [javac]         return sig.verify(new BASE64Decoder().decodeBuffer(Sign));     [javac]                               ^     [javac]   symbol:   class BASE64Decoder     [javac]   location: class VerifySignature     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\communitycommons\Misc.java:268: error: method getUser in interface ISession cannot be applied to given types;     [javac]         if (context.getSession().getUser() != null && username.equals(context.getSession().getUser().getName())) {     [javac]                                 ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\communitycommons\Misc.java:268: error: method getUser in interface ISession cannot be applied to given types;     [javac]         if (context.getSession().getUser() != null && username.equals(context.getSession().getUser().getName())) {     [javac]                                                                                           ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\communitycommons\ORM.java:183: error: cannot find symbol     [javac]                                                       List<IMendixObject> objs = Core.retrieveXPathQueryEscaped(ctx, "//%s[%s='%s']",     [javac]                                                                                      ^     [javac]   symbol:   method retrieveXPathQueryEscaped(IContext,String,String,String,String)     [javac]   location: class Core     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:137: error: method getUser in interface ISession cannot be applied to given types;     [javac]                           if ( session == null || (session!=null && session.getUser().isAnonymous()) ) {     [javac]                                                                            ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:170: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                                       serve404(request, response, session == null ? null : session.getUser().getName());     [javac]                                                                                                                   ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:186: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                         else if (!deeplink.getAllowGuests().booleanValue() && session.getUser().isAnonymous()) //guest session, which is not allowed     [javac]                                                                                                      ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:199: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                         String user = session.getUser().getName();     [javac]                                                              ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:204: error: cannot find symbol     [javac]                                         List<IMendixObject> pendinglinks = Core.retrieveXPathQueryEscaped(context, "//%s[%s='%s' and %s='%s']",     [javac]                                                                                ^     [javac]   symbol:   method retrieveXPathQueryEscaped(IContext,String,String,String,String,String,String)     [javac]   location: class Core     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:237: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                         link.setUser(session.getUser().getName());     [javac]                                                             ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\deeplink\actions\StartDeeplinkJava.java:389: error: cannot find symbol     [javac]                                         List<IMendixObject> result = Core.retrieveXPathQueryEscaped(context, "//%s[%s='%s']",     [javac]                                                                          ^     [javac]   symbol:   method retrieveXPathQueryEscaped(IContext,String,String,String,String)     [javac]   location: class Core     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\mxmodelreflection\metamodelBuilder\Builder.java:67: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Currency:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\mxmodelreflection\metamodelBuilder\Builder.java:79: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Float:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\mxmodelreflection\metamodelBuilder\Builder.java:111: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Currency:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\mxmodelreflection\metamodelBuilder\Builder.java:120: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Float:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\objecthandling\ORM.java:183: error: cannot find symbol     [javac]                                                       List<IMendixObject> objs = Core.retrieveXPathQueryEscaped(ctx, "//%s[%s='%s']",     [javac]                                                                                      ^     [javac]   symbol:   method retrieveXPathQueryEscaped(IContext,String,String,String,String)     [javac]   location: class Core     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\publish\RestServiceRequest.java:115: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                                       if (existingSession != null && session.getId().equals(existingSession.getId()) && existingSession.getUser().getName().equals(session.getUser().getName())) {     [javac]                                                                                                                                                        ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\publish\RestServiceRequest.java:115: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                                       if (existingSession != null && session.getId().equals(existingSession.getId()) && existingSession.getUser().getName().equals(session.getUser().getName())) {     [javac]                                                                                                                                                                                           ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\publish\RestServiceRequest.java:128: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                         if (session != null && session.getUser() != null && session.getUser().getUserRoleNames().contains(role)) {     [javac]                                                                       ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\publish\RestServiceRequest.java:128: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                         if (session != null && session.getUser() != null && session.getUser().getUserRoleNames().contains(role)) {     [javac]                                                                                                    ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\publish\RestServiceRequest.java:305: error: method getUser in interface ISession cannot be applied to given types;     [javac]                           return activeSession.getUser();     [javac]                                               ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\publish\DataService.java:61: error: method getUser in interface ISession cannot be applied to given types;     [javac]                                         constraint = constraint.replace(RestServices.CURRENTUSER_TOKEN, "'" + context.getSession().getUser().getMendixObject().getId() + "'");     [javac]                                                                                                                                   ^     [javac]   required: IContext     [javac]   found: no arguments     [javac]   reason: actual and formal argument lists differ in length     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\util\JSONSchemaBuilder.java:134: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Currency:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\util\JSONSchemaBuilder.java:135: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Float:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\util\JsonDeserializer.java:171: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Currency:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\util\JsonDeserializer.java:172: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                           case Float:     [javac]                                ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\util\JsonSerializer.java:161: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                                         case Currency:     [javac]                                              ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\restservices\util\JsonSerializer.java:162: error: an enum switch case label must be the unqualified name of an enumeration constant     [javac]                                         case Float:     [javac]                                              ^     [javac] C:\Users\Desktop\TLS Main v8.18.6\javasource\ssoclient\helpers\AanmeldingsServlet.java:74: error: method getUser in interface ISession cannot be applied to given types;     [javac]                           if(sessie != null && ssoclient.proxies.constants.Constants.getReuseSession() && sessie.getUser().getName().equals(account.getName()) ){     [javac]                                                                                                                 ^     [javac]   required: IContext     [javac]   found: no arguments     [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: Some input files use unchecked or unsafe operations.     [javac] Note: Recompile with -Xlint:unchecked for details.     [javac] 37 errors   BUILD FAILED C:\Users\Desktop\TLS Main v8.18.6\deployment\build_core.xml:29: Compile failed; see the compiler error output for details.   Total time: 6 seconds   Any help appreciated! Kind regards
asked
1 answers
2

It looks like you need to upgrade the following modules

Community Commons
Deeplink
MxModelReflection
Object Handling
REST Services
SSO Client
AppActions

I’m not familiar with App Actions, this may be a custom module someone has written in your company? If it is, then they would need to rewrite the action CreateSignature and VerifySignature as they’ve used Base64 methods that have been deprecated. They would need to use newer Java.util.Base64 classes., or something similar.

Hope this helps.

answered