1 Reply Latest reply on Apr 20, 2006 1:37 PM by wcydaip

    StatefulSession caching ejb references

    wcydaip

      Hi,

      I have a stateful session bean which holds references to various ejb's and performs queries against them. When I deploy the app several times one set of ejb's stop working. The only way to get them to work again, randomly, is to change the problem ejb's, so as, I guess, to give them a different footprint.

      What's the cause?

      My deployment looks like the following:
      app.ear
      -jar1-ejb.jar
      -jar1-ejb-client.jar
      -jar2-ejb.jar
      -jar2-ejb-client.jar
      -app.war

      app.war
      -war/web-inf/lib/
      --jar1-ejb-client.jar
      --jar2-ejb-client.jar

      jar2-ejb.jar's ejb-jar.xml references classes in jar1-ejb.jar, like so:

      <ejb-relation>
       <ejb-relation-name>test-site-test-price-lists</ejb-relation-name>
       <ejb-relationship-role >
      
      <ejb-relationship-role-name>test-has-site-test-price-list</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <relationship-role-source >
       <ejb-name>TestEJB</ejb-name> - jar2-ejb.jar
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>siteTestPriceList</cmr-field-name>
       <cmr-field-type>java.util.Collection</cmr-field-type>
       </cmr-field>
       </ejb-relationship-role>
       <ejb-relationship-role>
      
      <ejb-relationship-role-name>site-test-price-list-has-test</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <relationship-role-source >
       <ejb-name>SiteTestPriceListEJB</ejb-name> - jar1-ejb.jar
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>testId</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
       </ejb-relation>
      


      Checking the jmx-concolse I see that since the SiteTestPriceListEJB is listed in both jar's ejb-jar.xml file it is deployed twice...

      I wonder if that might be causing my grief?

      Thanks for any suggestions!

      Graham

        • 1. Re: StatefulSession caching ejb references
          wcydaip

          Looks to be fixed at least I hope. The packaging needs to be broken down for specific functions and these functions must be self contained. The cross reference between the two ejb.jar files was mixing up the sfsb ejb reference.