The problem is not the stub (and yes those still exist in EJB3) returned via lookup.
Look carefully at the ClassCastException
:
myfirstpackage.ejb3._TriggerManually_Stub incompatible with anotherpackage.ejb.remoteclient.TriggerManually
You probably have a TriggerManually
class in package anotherpackage.ejb.remoteclient
as well.
This will probably fix it:
myfirstpackage.ejb3.TriggerManually triggerManually;
try {
InitialContext ctx = new InitialContext(props);
triggerManually = (myfirstpackage.ejb3.TriggerManually) ctx.lookup("myjdniname");
triggerManually.resetTasks();
} catch (NamingException e) {
e.printStackTrace();
}