I have two feature layers, one which I got from an authorized publisher (in the form of a shapefile), and the other which I created from scratch (using ArcMap).
I'm able to load the former using the following snippet,
ServiceFeatureTable serviceFeatureTable = new ServiceFeatureTable(<service_url>);
serviceFeatureTable.addDoneLoadingListener(() -> {
if (serviceFeatureTable.getLoadStatus() == LoadStatus.LOADED) {
System.err.println("loaded layer");
featureLayer = new FeatureLayer(serviceFeatureTable);
map.getOperationalLayers().add(featureLayer);
} else {
System.err.println("cannot load");
throw serviceFeatureTable.getLoadError();
}
});
while, in the second one, addDoneLoadingListener isn't being called at all.
In the second feature layer, I'm using REST addFeatures to populate/update entries.
What could cause the second layer to not load? What all things should I check for in the portal/server?