JBoss Community

Re: Accessing spring beans that are deployed in a war.

created by Joshua Wilson in Snowdrop - View the full discussion

Which way are you trying to go Spring bean into EJB or EJB into Spring?

 

If are injecting a Spring Bean into an EJB Using Snowdrop then:

 

{code}

@Stateless

@Interceptors(SpringLifecycleInterceptor.class)

public class InjectedEjbImpl implements InjectedEjb

{

@Spring(bean = "springBean", jndiName = "MyApp")

private SpringBean springBean;

 

}

{code}

 

OR if you are injecting an EJB Using Annotations then:

 

{code}

public class ConsumerBean {

 

    @EJB(mappedName="ejb/exampleEJB")

    ExampleEjb exampleEJB;

 

}

{code}

Reply to this message by going to Community

Start a new discussion in Snowdrop at Community