My EJB 3 session deployment fails on AS 7.1.1 with error:
org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011068: Injection target session2 on class Session1Bean is not compatible with the type of injection: interface Session2Local
In short:
As far as I can see, this is a bug in JBoss. In org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.processInjectionTargets there is this check:
if (!classType.isAssignableFrom(injectionTargetType))
classType seems to be what is defined in the <local> element in <ejb-local-ref> (Session2Local). injectionTargetType is the type of the field (Session2).
Thus the check checks: is Session2Local assignable from Session2. The check is of course wrong: it should be the reverse:
if (!injectionTargetType.isAssignableFrom(classType)))
that is: is Session2 assignable from Session2Local.
Attached broken JAR with source.