java - Handle absence of JNDI -
i have configured jndi reference in spring
<bean id="optionalbean" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jndiname" value="name"/> </bean>
but jndi property not configured. in case tomcat doesn't start.
how can tell spring jndi optional?
update: after adding lookuponstartup
error:
nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'optionalbean': cannot resolve reference bean 'optionalbean' while setting bean property 'optionalbean'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'optionalbean': invocation of init method failed; nested exception java.lang.illegalstateexception: cannot deactivate 'lookuponstartup' without specifying 'proxyinterface' or 'expectedtype'
this should
<bean id="optionalbean" class="org.springframework.jndi.jndiobjectfactorybean" lazy-init="true"> <property name="jndiname" value="name"/> </bean>
Comments
Post a Comment