Announcement Announcement Module
Collapse
No announcement yet.
Letting Spring go on even though EJB can not be invoked Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Letting Spring go on even though EJB can not be invoked

    Hi,

    I have configured a EJB session bean "myBean" using the
    org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean.

    Its properties are set as:

    <property name="jndiName">
    <value>ejb/*my name*</value>
    </property>
    <property name="businessInterface">
    <value>*my class*</value>
    </property>
    <property name="jndiEnvironment">
    <ref bean=*myJNDI.properties*/>
    </property>

    This is not a critical EJB remote for the app. The problem is that when
    application starts and when EJB server is down application will not start
    because this bean can not be instantiated.

    Is there any way that I can let application go on without this bean being instantiated. It is used for trivial purposes and the application can live without it being instantiated.

    Thank you,
    Edmon

  • #2
    You can set the bean attribute lazy-init to true. It won't be initialized until retrieved from the context.

    Comment


    • #3
      Besieds that, setting "lookupHomeOnStartup" to "false" might also be worth a try. I successfully used this approach in a similar scenario.

      Regards,
      Andreas

      Comment


      • #4
        lookupHomeOnStartup

        Originally posted by Andreas Senft
        Besieds that, setting "lookupHomeOnStartup" to "false" might also be worth a try. I successfully used this approach in a similar scenario.

        Regards,
        Andreas
        Thank you.

        Setting:

        <bean id="myBean" lazy-init="true" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
        <property name="lookupHomeOnStartup" value="false"/>
        ...
        </bean>

        did the trick.

        Comment

        Working...
        X