On 12/21/05, Simon Kitching <[EMAIL PROTECTED]> wrote:
Tonio Caputo wrote:
> Hi,
>
>   I'm having a big problem trying to use MyFaces.
>
>   I have an application running with Java reference implementation
> all works ok.
>
>   When I try to use it with MyFaces I'm getting this problem:
>
> javax.servlet.ServletException:
>  Could not restore StateHolder of type
>      com.avivacanada.pampa.util.jsf.BasePageBean$1
>      (missing no-args constructor?)
>
>   Of course BasePageBean$1 is an anonymous class, no constructor in
> it.
>
>
> I will describe you some characteristics of my application
> that could help (of course if you need the source no problem)
>
>   Every jsp has a java class java-page associated with it.
>   They all extend BasePageBean, all components in the
>   jsp are bound to a corresponding one in the java class.
>
>   BasePageBean has a CommandButton common to all pages
>   and it adds a listener to this command-button, this
>   is the anonymous class that gives the problem.
>
> Any help will be welcomed
> thank you in advance
>

First thing that strikes me: why is the "restore view" process trying to
restore an instance of a backing bean? Restore view only restores the
UIViewRoot and its components, not backing beans.

Well, that depends on the circumstances ...

If you use the "binding" attribute on your component, to bind the component instance to a backing bean instance:

    <h:outputText ... binding="#{mybean.myOutputTextComponent}" .../>

then you will have to be restoring the backing bean instance (if it is in request scope, or if it doesn't exist already) as part of the Restore View phase.

The particular exception reported above, however, implies that the BasePageBean$1 class being referenced does not have a public, no-args constructor.

Craig


Are you using the t:saveState component perhaps?

And as Bruno noted, the full stack trace is really required to help with
this. Typically when this happens, you'll get about 4 ERROR log messages
  generated together. The first is the most useful, but it looks like
you've just given us the first 4 lines of the last exception.

Cheers,

Simon

Reply via email to