Announcement Announcement Module
No announcement yet.
Injecting Spring bean into SLSB Web Service. Please help Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Injecting Spring bean into SLSB Web Service. Please help

    Nobody responded to my previous post and I am still quite confused.
    If someone can point me to a complete example, I will greatly appreciate it.
    I am not a newbie with Spring, however I am just starting with EJB3.

    I have written a web service in the form
    @SOAPBinding(style = Style.RPC)
    public class myWebService {
         * Web service operation
        public String[] myWebMethod(
              @WebParam(name="a") String a,
             @WebParam(name="b") String b,
             @WebParam(name="c") String c) {
    Here I need to get my Spring bean with its dependencies and then
           return mySpringBean.myMethod(a, b, c);
    The injected bean is the legacy code that previously accessed via WebXmlApplicationContext in the web application.
    In the Spring documentation there is only one applicable (???) way described:
    extend AbstractStatelessSessionBean and implement onEjbCreate() method.
    I believe it only relate to EJB 2.0 or EJB2.1 spec but not EJB3. Correct me if I am wrong.
    I am not sure that JndiObjectLocator is the proper solution for that either.
    Where do I put my application context files for EJB container to read them and instantiate all the dependencies (I am using JBOSS 4.2).

  • #2
    Am I asking something so trivial that nobody bothers to reply even with RTFM flame, or it is something that nobody knows? Do I have to dump Spring to work with SLSB? Anyone! Voice your opinion please.


    • #3
      Inject POJOs into EJB3 @Stateless Beans using Spring