Just moved some Lightning Component code (run via Lightning Out from a Visualforce page) from a non-namespace org where it works fine to a namespace org (where a managed package is created) where it doesn't.
The broken code is of this form:
public with sharing class LifePaymentsController {
public class Data {
@AuraEnabled public Payee[] payees;
...
}
public class Payee {
@AuraEnabled public String id;
@AuraEnabled public String name;
...
}
@AuraEnabled
public static Data init(Id psId) {
...
}
}
with this gack reported:
An internal server error has occurred
Error ID: 262515546-19951 (-1487509830)
org.auraframework.throwable.AuraUnhandledException: apex://LifePaymentsController.Payee: 404 Not Found (Application Error)
at .(apex://LifePaymentsController.Payee)
at org.auraframework.impl.adapter.ServletUtilAdapterImpl.handleServletException(ServletUtilAdapterImpl.java:191)
at aura.impl.sfdc.bean.adapter.SFDCAuraServletsUtilAdapter.actionServletGetPre(SFDCAuraServletsUtilAdapter.java:82)
...
at ui.aura.util.impl.AuraServletsUtilImpl.preAuraRequest(AuraServletsUtilImpl.java:93)
at aura.impl.sfdc.bean.adapter.SFDCAuraServletsUtilAdapter.actionServletGetPre(SFDCAuraServletsUtilAdapter.java:73)
... 162 more
Caused by: java.lang.NullPointerException
at aura.impl.apex.utils.AuraApexUtils.getUiTierCompatibleApexType(AuraApexUtils.java:133)
... 181 more
I am wondering if the problem is the use of nested classes; in a no-namespace org the class name is:
LifePaymentsController.Payee
but in the namespace org the class name is:
nsprefix.LifePaymentsController.Payee
and perhaps not handled well.
If this scenario does or does not work for you please answer so I know whether to look elsewhere for the cause of the problem or need to go ahead and refactor to avoid the nested classes (there are quite a few of them).
(Will also pursue Salesforce support to get any info they can supply from the gack error ID.)