3 Replies Latest reply on Jul 21, 2003 3:48 AM by Denagbe

    Deployment of 2 identical set of beans

    Denagbe Newbie


      I would like to deploy within jboss two identical set of beans which will differ only by the datasource they access. How should I proceed?

      I thought I would have bean sufficient to deploy
      a jar archive containing the initial set of beans and then deploy another jar archive which contains only
      the META-INF directory (ejb-jar.xml, jboss.xml and jboss-cmp.xml) with the changed datasource
      reference and new JNDI names.
      When I do that and deploy my second jar, Jboss tells
      that it deployed it but actually as far I saw, nothing was done. As far as I saw I need to also put the classes in the second jar then jboss does the deployment but some other problems come like conflicting beans names, ...
      Can anybody explain me why? Or suggest me a good solution to achieve what I want?
      What I don't really understand is that everything that is described in an archive like the bean names, relations, ... should be local, isn't it? Except of course the jndi names.

      Thanks in advance for any answer.

        • 1. Re: Deployment of 2 identical set of beans
          Denagbe Newbie

          I found the problem. It is sufficient to create a new
          jar archive with only the changed META-INF directory.
          It didn't work the first time I tried because I tried
          quickly to test this idea and I used the windows context menu to create a zip from the META-INF directory (the jar), the problem is that the descriptors were in the jar file but not the META-INF directory therefore no deployment.

          • 2. Re: Deployment of 2 identical set of beans
            Denagbe Newbie

            I only needed a new jar file containing a META-INF
            directory. In the jboss.xml I changed the jndi-names
            and in the jboss-cmp.xml, I changed the datasource
            reference name.

            • 3. Re: Deployment of 2 identical set of beans
              Denagbe Newbie

              What has also to be made is to assign a local-jndi-name
              in the jboss.xml file to all beans which don't have one.
              Actually it seems that when no local-jndi-name, and certainly the same thing with jndi-name, is assigned to a bean, jboss assign a default one (local/<bean name>). Which results in a conflict when trying to deploy the second set of beans.
              So basically one has to ensure that both jndi-names and local-jndi-names that are associated to the beans are unique.