gbrown1 wrote:
It is a Spring annotation (org.springframework.stereotype.Service). However, I'm not sure that's the source of the problem. For example, this code works fine:
@Service
public class ClusterMembershipService
{
@Resource(lookup = "java:jboss/clustering/group/default")
private Group group = null;
...
}
Greg
This only works because the service providing the Group happened to already be started - and the static jndi binding created. However, this service may stop at any time if your deployment hasn't established itself as a dependency (thereby keeping it up).
Use the deployment descriptor approach I mentioned earlier in the thread. This will both ensure the appropriate dependencies are established to your deployment and allow Spring to process the @Resource annotation using the "java:comp/env" namespace with a simple JNDI lookup.
That makes sense - thanks for the explanation!