Web Push Notifications error Compilation of Java actions failed

0
I get the error "Compilation of Java actions failed” when i run locally after adding  Web Push Notifications  module from appstore https://appstore.home.mendix.com/link/app/114331/ I have made a specialization of System.User in MyModule.TenantUser and made the replacement in my forms and microflows Buildfile: C:\Active\Q-SMART-Development_Ajit_20200827\deployment\build_core.xml compile:     [javac] Compiling 31 source files to C:\Active\Q-SMART-Development_Ajit_20200827\deployment\run\bin     [javac] C:\Active\Q-SMART-Development_Ajit_20200827\javasource\webpushnotifications\actions\SendNotification.java:90: error: incompatible types: User cannot be converted to TenantUser     [javac]         if ( ! Microflows._UserHasAtLeastOneSubscription(getContext(), User_) )     [javac]                                                                        ^     [javac] Note: C:\Active\Q-SMART-Development_Ajit_20200827\javasource\webpushnotifications\actions\SendNotification.java uses or overrides a deprecated API.     [javac] Note: Recompile with -Xlint:deprecation for details.     [javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output     [javac] 1 error BUILD FAILED C:\Active\Q-SMART-Development_Ajit_20200827\deployment\build_core.xml:29: Compile failed; see the compiler error output for details. Total time: 3 seconds  
asked
1 answers
1

I see downcasting issue.

You are sending User object where TenantUser is expected. And application failed to downcast the User object to TenantUser object.

Upcasting is always done automatically. Meaning, when you pass TenantUser then it can be converted to User. 

Did you by any chance also changed the Microflows and/or other actions for widget to use TenantUser.

If so, this is not needed. You can use User and safely TenantUser.

To fix this, you could revert your changes within the appstore module and keep the User entity. This is safe, because, it helps to easily update the widget in future.

Or, you could also cast the User object being passed to a TenantUser.

answered