Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.2.2
-
None
-
None
-
Spring 2.5.6, Spring DM 1.2.0, Tomcat 6.20, MyFaces 1.2.2, Equinox 3.5
Servlet HTTP 2.5, JSP 2.1
Description
Hello,
We detect a problem when using MyFaces 1.2.2 within an OSGi container. The problem occurs when MyFaces tryies to initialize the default JspFactory from the Jsp21FacesInitializer class. It seems that the code which poses problem is the following:
if (jspFactory == null) {
// TODO: this Class.forName will be removed when Tomcat fixes a bug
// also, we should then be able to remove jasper.jar from the deployment
try
catch (ClassNotFoundException e)
{ ; // ignore }catch (Exception ex)
{ log.debug("An unexpected exception occured " + "while loading the JspRuntimeContext.", ex); } jspFactory = JspFactory.getDefaultFactory();
}
As a matter of fact, the getDefaultFactory method returns null in this context...
If we force MyFaces to use the Jsp20FacesInitializer class from the ContainerUtils class as following:
public class ContainerUtils
{
/**
- Determines whether we're running in a Servlet 2.5/JSP 2.1 environment.
- @return <code>true</code> if we're running in a JSP 2.1 environment,
- <code>false</code> otherwise
*/
public static boolean isJsp21()
{
/*try
{ // simply check if the class JspApplicationContext is available Class.forName("javax.servlet.jsp.JspApplicationContext"); return true; }catch (ClassNotFoundException ex)
{ ; // expected exception in a JSP 2.0 (or less) environment }
*/
return false;
}
(...)
}
the problem doesn't occur and MyFaces can be used.
Regards,
Thierry
Attachments
Issue Links
- is part of
-
MYFACES-2290 Add OSGi bundle information and bundle classloader / activator
- Closed