-
1. Re: does spring deployer _require_ ejb?
alesj Sep 15, 2006 3:36 AM (in response to ddouglass)Sure.
Simply do a JNDI lookup.
Use the same jndi name as you use in @Spring annotation. -
2. Re: does spring deployer _require_ ejb?
ddouglass Sep 15, 2006 10:03 AM (in response to ddouglass)Thanks for the reply Ales, and for Jboss Spring deployer ;)
That's what I've been trying to do via unit test -- the JNDI lookup gets me back a Reference object that refers to the NamedXmlApplicationContext, but any attempt to use the object (casting to ApplicationContext or BeanFactory) fails down in the Spring AOP layers with IllegalArgumentException: object not of declared type.
I've culled the forums (this one and others, JBoss and Spring) but have failed to find the magic to actual make use of the bound context in any meaningful way. I'm sure I'm just missing something.
Note that the unit test I refer to is running out-of-container, but a similar "test" done via a simple deployed war is giving similar results, though I haven't configured any resource/resource-ref in web.xml, etc., yet.
I've got several backup plans: write a simple stateless EJB wrapper that just delegates to injected deps. from the context and have the webapps use the EJB (though I'm trying to avoid EJB altogether); or, for now, I can package the context/services directly into the war and work out these details for my next iteration.
Thanks for any help/pointers,
Doug -
3. Re: does spring deployer _require_ ejb?
ddouglass Sep 15, 2006 12:36 PM (in response to ddouglass)Never mind...for my in-container tests the problem was class loader related -- I had duplicate jars in both my .spring and .war. Removing the duplicates fixed my problems.
Cheers,
Doug -
4. Re: does spring deployer _require_ ejb?
alesj Sep 15, 2006 1:00 PM (in response to ddouglass)"ddouglass" wrote:
That's what I've been trying to do via unit test -- the JNDI lookup gets me back a Reference object that refers to the NamedXmlApplicationContext, but any attempt to use the object (casting to ApplicationContext or BeanFactory) fails down in the Spring AOP layers with IllegalArgumentException: object not of declared type.
Just in the process of replying to you - about class loader issues with your problem.
Glad you fixed it. :-)