3 Replies Latest reply on May 14, 2010 6:16 PM by nbelaevski

    Can't instantiate the class problem

    lenyas66

      I created a new class, which has very simple structure, but somehow JSF is throwing "cant instantiate exception", when I try to access it.

       

      18:03:07,781 FATAL [application] JSF1001: Managedbean piPublisherBean could not be created.

      18:03:07,781 ERROR [STDERR] May 13, 2010 6:03:07 PM com.sun.facelets.FaceletViewHandler

      handleRenderException

      SEVERE: Error Rendering View[/piPublisher.xhtml]

      javax.faces.FacesException

       

      : javax.faces.FacesException: Cant instantiate class: com.nb.pi.web.beans.PIPublisherBean.. com.nb.pi.web.beans.PIPublisherBean

       

      Could somebody advise why it is happening? I think, I may have some really simple error, but can't see the cause.

        • 1. Re: Can't instantiate the class problem
          ilya_shaikovsky

          attach file with complete server log.

          • 2. Re: Can't instantiate the class problem
            lenyas66

            I figured out what was the issue: it had nothing to do with this particular class, but rather with subclass, which had an error in XHTML file (referencing undefined variable).

             

            I am curious though, why this would be an issue even before I attempted to load the screen, which had the problem? Does JSF try to instantiate all classes from faces-config.xml in advance?

            • 3. Re: Can't instantiate the class problem
              nbelaevski

              Hi Leonid,

               

              I am curious though, why this would be an issue even before I attempted to load the screen, which had the problem? Does JSF try to instantiate all classes from faces-config.xml in advance?

               

              According to the log, exception happens during view rendering:

               

              handleRenderException

              SEVERE: Error Rendering View[/piPublisher.xhtml]

              javax.faces.FacesException

               

              so there should be request for this view.