To get around all these ejb-refs I thought I could use an MBean that at startup triggers static intialization of a class that caches stateless session bean and local entity bean homes. This would require using global locators. These homes would be the same for every client, so is there a problem?
-----Original Message----- From: Adrian Brock [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 3:20 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] JNDI Context question Are you caching the java:comp/env context? If so, your locator is using the ENC (Enterpise Naming Context) from the first application to use it. Some j2ee implementations re-resolve it to the application's ENC on every lookup. JBoss (and at least Tomcat standalone as well) resolves it when you lookup the context (it is more efficient). A global locator for java:comp/env won't work anyway. Consider what happens when two ejbs decide java:comp/env/jdbc/DataSource should be different databases. Regards, Adrian On Mon, 2003-10-06 at 20:02, Matthew Hixson wrote: > We currently have an EJB app that we've migrated from Resin. We have a > SessionLocator class that looks up all of the session beans and caches > references to their local homes in a static initializer. This worked > great under Resin, but under JBoss this fails if the first call to > SessionLocator is from a bean that does not declare an <ejb-local-ref> > for all the other session beans and entity beans. > > <ejb-local-ref > > <ejb-ref-name>Category</ejb-ref-name> > <ejb-ref-type>Entity</ejb-ref-type> > > <local-home>com.company.ejb.entity.CategoryLocalHome</local-home> > <local>com. company.ejb.entity.CategoryLocal</local> > <ejb-link>Category</ejb-link> > </ejb-local-ref> > > I have added xdoclet tags to one of our SessionBeans so that the > <ejb-local-ref> tags like that above get put into ejb-jar.xml. This is > just duct tape until I find a better solution. The catch is that we > have to hit a specific servlet before anything else, otherwise we get a > NamingException that says: > > 10:59:21,852 ERROR [system] > NamingExceptionjavax.naming.NameNotFoundException: Foo not bound > > As far as I can tell I need to add <ejb-local-ref> tags to each of my > session beans to declare what other beans it depends on. Is there a > reason for this? It seemed that Resin made everything under com/env > available to lookup. I've never had to use the <ejb-local-ref> tag > until now. I'd rather not be troubled with doing that if I don't > absolutely have to. > Is there a way to configure JBoss to behave more like Resin in this > regard? Or is there any way around having to add <ejb-local-ref>s to > all of my session beans? > -M@ > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- xxxxxxxxxxxxxxxxxxxxxxxx Adrian Brock Director of Support Back Office JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
