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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -