myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Handling Server Errors" by PaJaSoft
Date Fri, 27 Feb 2009 15:43:11 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by PaJaSoft:
http://wiki.apache.org/myfaces/Handling_Server_Errors

------------------------------------------------------------------------------
  
  This reduces the number of technologies required to show the error page which might improve
the availablity of this page ;-)
  
+ 
+ == Custom error handler under Apache Geronimo JavaEE server ==
+ 
+ If you would use your own error handler (org.apache.myfaces.ERROR_REDIRECT_ALTERNATE_HANDLER)
under Apache Geronimo, you must set properly your deployment plan (geronimo-web.xml usualy),
otherwise you will have classloading problem of your class. By default the MyFaces classes
are loaded to your classpath through dependencies at org.apache.geronimo.framework.jee-specs/CAR.
This is OK for common cases, but if you instruct MyFaces to use your own error handler class,
you get the error because MyFaces cannot find your class in calling class.forName(). Avoid
this situation is quite simple - in your deployment plan specify dependencies on myfaces-api
and myfaces-impl and then modify classloading via hidden-classes setting.
+ 
+ A fragment of your dependency plan would be like this:
+ 
+ {{{
+ <dep:dependencies>
+ .
+ .
+ 	<dep:dependency>
+ 		<dep:groupId>org.apache.myfaces.core</dep:groupId>
+ 		<dep:artifactId>myfaces-api</dep:artifactId>
+ 		<dep:type>jar</dep:type>
+ 	</dep:dependency>
+ 	<dep:dependency>
+ 		<dep:groupId>org.apache.myfaces.core</dep:groupId>
+ 		<dep:artifactId>myfaces-impl</dep:artifactId>
+ 		<dep:type>jar</dep:type>
+ 	</dep:dependency>
+ .
+ .
+ </dep:dependencies>
+ 
+ <dep:hidden-classes>
+ 	<dep:filter>javax.faces</dep:filter>
+ 	<dep:filter>org.apache.myfaces</dep:filter>
+ </dep:hidden-classes>
+ }}}
+ 
+ This solution was tested under Apache Geronimo 2.1.3., but will probably be similar in other
versions.
+ 

Mime
View raw message