you want to swallow the exception? then you would return a null into a proxy and cause an npe later...
-igor On Wed, Mar 19, 2008 at 1:43 PM, Zappaterrini, Larry <[EMAIL PROTECTED]> wrote: > It might be a nice improvement to Wicket's Spring support to allow for > missing bean definitions to be handled gracefully. This would allow for > the use of a sane default in the absence of explicit declaration in the > context XML. Right now using the Spring annotations support I get the > following error when I don't define the object in the XML: > > org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean > named 'beanName' is defined > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.get > BeanDefinition(DefaultListableBeanFactory.java:355) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getMergedB > eanDefinition(AbstractBeanFactory.java:800) > at > org.springframework.beans.factory.support.AbstractBeanFactory.isSingleto > n(AbstractBeanFactory.java:343) > at > org.springframework.context.support.AbstractApplicationContext.isSinglet > on(AbstractApplicationContext.java:654) > at > org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLoc > ator.java:133) > at > org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.get > FieldValue(AnnotProxyFieldValueFactory.java:91) > at org.apache.wicket.injection.Injector.inject(Injector.java:108) > at > org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInje > ctor.java:39) > at > org.apache.wicket.injection.ComponentInjector.onInstantiation(ComponentI > njector.java:52) > at > org.apache.wicket.Application.notifyComponentInstantiationListeners(Appl > ication.java:973) > at org.apache.wicket.Component.<init>(Component.java:866) > > ... truncated for brevity > > Using getSpringContext().contains(String) either within or as an exposed > method of SpringBeanLocator would probably be sufficient to avoid > hitting this exception. > > Thanks, > Larry > > ______________ > > The information contained in this message is proprietary and/or > confidential. If you are not the > intended recipient, please: (i) delete the message and all copies; (ii) do > not disclose, > distribute or use the message in any manner; and (iii) notify the sender > immediately. In addition, > please be aware that any message addressed to our domain is subject to > archiving and review by > persons other than the intended recipient. Thank you. > _____________ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]