Java compile error, upgrade from 5.21.6 to 6.10.7

1
Hi All, I am upgrading a V5 app to V7 and have successfully gone to 5.21.6 and am now stepping to 6.10.7. When I try to run locally I get the following java compile error, can anyone help resolve please? Thanks, Simon.     [javac] C:\Scratch\Mendix\myClarks-V5 to V7\javasource\usersignupresetpassword\actions\LoginUser.java:38: error: method initializeSession in class Core cannot be applied to given types;     [javac]         ISession session = Core.initializeSession(context, user, null, "");     [javac]                                ^     [javac]   required: IUser,String     [javac]   found: IContext,IUser,<null>,String     [javac]   reason: actual and formal argument lists differ in length
asked
2 answers
3

Hi Simon,

Seems like the interface has been changed - https://apidocs.mendix.com/6/runtime/com/mendix/core/component/ICore.html#initializeSession-com.mendix.systemwideinterfaces.core.IUser-java.lang.String-

Now you dont need the context or localle to initialize the session. So you can safely remove them from your code. Open your java file  C:\Scratch\Mendix\myClarks-V5 to V7\javasource\usersignupresetpassword\actions\LoginUser.java into an editor and replace
 

‚ÄčISession session = Core.initializeSession(context, user, null, "");
//with
‚ÄčISession session = Core.initializeSession(user, "");

That should be it.
If this action is comming from an appstore module perhaps you need to update that module?


Hope this helps,
-Andrej

answered
0

Hi Andrej,

Thank you, that cleared the error.

Best Regards,

Simon.

answered