Results 1 to 3 of 3

Thread: Accessing EJBs without configure them in xml as beans

  1. #1
    Join Date
    Oct 2006
    Posts
    23

    Default Accessing EJBs without configure them in xml as beans

    Hi!
    I wondering if it is possible to access EJBs without specifying them as beans in the spring xml-file.
    Normally I do the configuration in spring xml config and it would look something like this for EJB2:
    Code:
    <bean id="ecpTestEjb"
        class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean" lazy-init="true">
        <property name="jndiName" value="ecpTestEjb"/>
        <property name="businessInterface" value="se.ejb.EcpTest"/>
        </bean>
    In my project I would do the same but by specifying the EJB in code to make it possible to choose which EJB to use in a dynamic way.

    My question is: Is it possible to use an EJB without the bean configuration in the spring xml file?

    /henrik

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Quote Originally Posted by 2nice View Post
    My question is: Is it possible to use an EJB without the bean configuration in the spring xml file?
    Sure. Just instantiate the factory bean and set the properties programmatically. Don't forget to invoke "afterPropertiesSet()" when you're done with configuration.

    Regards,
    Andreas

  3. #3
    Join Date
    Oct 2006
    Posts
    23

    Default

    thanks. IŽll try to do that.
    /henrik

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •