Announcement Announcement Module
Collapse
No announcement yet.
Accessing EJBs without configure them in xml as beans Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      thanks. IŽll try to do that.
      /henrik

      Comment

      Working...
      X