Tejas Mehta [
https://community.jboss.org/people/tmehta] created the discussion
"Re: Accessing spring beans that are deployed in a war."
To view the discussion, visit:
https://community.jboss.org/message/830053#830053
--------------------------------------------------------------
Just to make sure attempted to deploy an ear with an ejb getting a spring injected by
snowdrop from a *.spring deployment. The following was the configuration:
The EJB:
@Stateful
@Interceptors({SpringLifecycleInterceptor.class})
public class GreeterEJB implements IGreeterEJB {
@Spring(bean = "springBean", jndiName = "MyApp")
private Object memberDao;
/** rest of class **/
In the ear pom.xml:
Note scope is not set provided:
<dependency>
<groupId>org.jboss.snowdrop</groupId
<artifactId>snowdrop-deployers-core</artifactId>
<version>2.1.1.SNAPSHOT</version>
</dependency>
Content of resources/META-INF/jboss-deployment-structure.xml:
Make sure this at the top level of the ear.
<jboss-deployment-structure
xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="org.springframework.spring"
slot="snowdrop" export="true">
<exports>
<include path="META-INF**"/>
<include path="org**"/>
</exports>
<imports>
<include path="META-INF**"/>
<include path="org**"/>
</imports>
</module>
<module name="org.jboss.snowdrop" export="true"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
In META-INF/jboss-spring.xml of either the ear
top level or a seperate *.spring application:
Hopefully this helps you out. If not I can send over this sample working solution (much
smaller than sporstclub) and hopefully you can take it from there.
Cheers,
Tejas M.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/830053#830053]
Start a new discussion in Snowdrop at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]