2 Replies Latest reply on Dec 17, 2008 5:08 AM by valatharv

    Suggestion for redirecting to error page

    valatharv
      I am trying to redirect to error.xhtml whenever any error occurs, for testing I generated this error but it is not directing to error.xhtml

      Is the process wrong..

      --I have provied exception class in main pages.xml under "...WEB-INF/resources"
      <exception class="org.jboss.seam.InstantiationException">      
           <redirect view-id="/error.xhtml">
               <message>Test for exception...</message>
           </redirect>
      </exception>

      --TestHome function which generates error and entering catch :
      @Name("testHome")
      public class testHome extends EntityHome<Test> {
      ...................
      private Test2Entity initializeEntity(Test2Entity re){          
           try {          
                log.debug("testHome.initializeEntity(), initialized Test2Entity ");
           } catch (RuntimeException e) {
                
                System.out.println("******** In catch............");
                log.debug("testHome.initializeEntity(), could not initialize Test2Entity : "+e.getMessage());
           }
           return "";
      }

      Error details:
      --------------
      INFO  [STDOUT] ******** In catch............
      .................
      ERROR [STDERR] com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/ProjectList.xhtml]
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: testHome
           at org.jboss.seam.Component.newInstance(Component.java:1986)
           ........
           at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: TestHome
           at org.jboss.seam.Component.newInstance(Component.java:1986)
           .....
      2008-12-16 20:06:13,210 ERROR [STDERR] 8)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:41)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           ... 80 more
      Caused by: java.lang.NullPointerException
           at com.session.TestHome.initializeEntity(TestHome.java:131)
           at com.session.TestHome.<init>(TestHome.java:143)
           at org.jboss.seam.Component.newInstance(Component.java:1970)
           ... 113 more