Announcement Announcement Module
Collapse
No announcement yet.
Confused about using BeanFactoryLocator from ContextSingletonBeanFactoryLocator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Confused about using BeanFactoryLocator from ContextSingletonBeanFactoryLocator

    Spring 1.2.8, Java 5, WebLogic 9.x.

    For quite a while I've been doing work on application-specific portions (not framework pieces) of a Spring 1.2.8 app, using JDK 1.4.2 and WLS 8.1.4. In this app, the Spring context is loaded through the DispatcherServlet. The Spring context is divided into multiple files (loaded through the classpath), where each separate file constitutes a major component in the application (a sub-application). The main app and framework is a message router, and headers in the message are looked up in the Chain Catalog to determine a specific commons-chain bean to execute to handle the message.

    I'm now doing an experiment, attempting to port one of the sub-application services to an annotation-based WebLogic web service in WebLogic Workshop 9.2, but after getting into the service operation, I'd like to hand off the execution to a specific commons-chain bean from the catalog (the specific name would either be hard-coded in the operation method or retrieved from a property). I'd like to keep mostly intact the sub-application Spring context file, with some edits to deal with some of the framework differences.

    At this point, I'm a little confused about what exactly the code in the web service operation should do. I think I would use ContextSingletonBeanFactoryLocator, perhaps like this:

    BeanFactoryLocator beanFactoryLocator =
    ContextSingletonBeanFactoryLocator.
    getInstance("classpath*:applicationContext.xml");

    Then I would need to get the BeanFactory, but I don't understand exactly what is required for the argument to the "useBeanFactory()" method.

  • #2
    I think I've made a little progress here, but I'm still a little stuck.

    My application is a web application, so I can declaratively initialize the ApplicationContext in my web.xml file.

    The entry points to my application are not servlets, however (or at least they don't present that interface to me). They are annotation-based web services. My ApplicationContext may be initialized by the ContextLoaderListener, but how can I get the ApplicationContext in my web service operation? I'm sure this is simple to do, but it seems hard to sort through how to get here.

    Comment


    • #3
      I'm doing the same thing with WLS9.2 WebServices and I got it to work by following the acticle below:

      http://www.onjava.com/pub/a/onjava/2...html?page=last

      Comment

      Working...
      X