Solved! Go to Solution.
Checking some of my desktop apps, when I use the Append geoprocessing tool, I use FeatureLayer objects as inputs and targets.
public FeatureLayer getLayerByName(String layerName, com.esri.arcgis.carto.Map map) {
FeatureLayer layer = null;
try {
for (int i = 0; i < map.getLayerCount(); i++) {
if (map.getLayer(i).getName().equalsIgnoreCase(layerName)) {
layer = (FeatureLayer) map.getLayer(i);
break;
}
}
} catch (AutomationException ae) {
ae.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return layer;
}