1 2 Previous Next 16 Replies Latest reply on Jun 26, 2019 8:40 AM by gbrown1 Go to original post
      • 15. Re: Transparent deployment for Cluster and Standalone modes
        pferraro

        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.

        1 of 1 people found this helpful
        • 16. Re: Transparent deployment for Cluster and Standalone modes
          gbrown1

          That makes sense - thanks for the explanation!

          1 2 Previous Next