On 3/30/06, Hermod Opstvedt <[EMAIL PROTECTED]> wrote: > > Hi > > I am seeing some odd behaviour in my Shale/Clay application. My > backingbean > (ie ViewController) is being created twice, meaning I have 2 instances of > it. I was wondering if this is expected behaviour or if this is a bug. > From > the stacktrace:
How are you locating these two instances? Printing stuff in the constructor? I don't see how you could ever end up with two request scope instances under one name. ResultatPage.<init>() line: 71 > NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: > not > available [native method] This exception implies that the constructor threw an exception, which would cause the managed bean creation to fail, so no instance would ever get installed in scope. Every time an expression containing this managed bean name is evaluated, it will see "aha, there's no bean yet, so try to create one" -- and, I would assume, every attempt will fail. But its not surprising to see multiple attempts if your constructor is throwing exceptions. If the bean is a view controller, try moving the setup logic to the init() method instead of the constructor. Even if an exception is still thrown, the initial attempt to create the bean will succeed, so you won't get multiple failed instantiation attempts. Craig NativeConstructorAccessorImpl.newInstance(Object[]) line: 39 > DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27 > Constructor<T>.newInstance(Object...) line: 494 > Class<T>.newInstance0() line: 350 > Class<T>.newInstance() line: 303 > ClassUtils.newInstance(Class) line: 274 > ClassUtils.newInstance(String) line: 265 > ManagedBeanBuilder.buildManagedBean(FacesContext, ManagedBean) line: 49 > VariableResolverImpl.resolveVariable(FacesContext, String) line: 311 > ShaleVariableResolver.resolveVariable(FacesContext, String) line: 152 > DelegatingVariableResolver.resolveVariable(FacesContext, String) line: 110 > WebApplicationContextVariableResolver.resolveVariable(FacesContext, > String) > line: 87 > ViewViewHandler.setupViewController(FacesContext, UIViewRoot, String, > boolean) line: 233 > ViewViewHandler.restoreView(FacesContext, String) line: 160 > ... > > > Hermod > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >