geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul McMahan <paulmcma...@gmail.com>
Subject Re: MyFaces 1.1.5 and Geronimo 2.0.2
Date Fri, 02 Nov 2007 16:34:31 GMT
Starting with Java EE 5 the JSF classes are provided by the web  
container.  The spec says that the JSF classes should not be included  
in the web application archive.  When Geronmio deploys a webapp it  
automatically merges this setting into webapp's deployment plan:

     <non-overridable-classes>
          <filter>java.</filter>
          <filter>javax.</filter>
          <filter>org.apache.geronimo.</filter>
          <filter>org.apache.jasper.</filter>
          <filter>org.apache.naming.</filter>
          <filter>org.apache.catalina.</filter>
          <filter>org.apache.tomcat.</filter>
          <filter>org.apache.myfaces.</filter>
          <filter>org.apache.taglibs.</filter>
          <filter>org.xml.</filter>
          <filter>org.w3c.</filter>
     </non-overridable-classes>

The effect of this non-overridable-classes element as defined by the  
Geronimo deployment schema is:

       A list of classes which will only be loaded from parent
       ClassLoaders of this module (never from the module's own
       ClassLoader). For example, this is used to prevent a web
       application from redefining "javax.servlet", so those
       classes will *always* be loaded from the server instead
       of from the web web application's own ClassPath.

This is why you saw the unexpected behavior when you tried to use the  
<hidden-classes> filter to load the JSF classes from your webapp.

In order to use the MyFaces 1.1.x in Geronimo 2.0 you would need to  
stop or undeploy the myfaces and myfaces-deployer components before  
deploying your webapp like David suggested.   You would also need to  
overwrite the MyFaces core api jar at:

     geronimo/repository/org/apache/myfaces/core/myfaces-api/1.2.0/ 
myfaces-api-1.2.0.jar

with your desired version of MyFaces - using the same filename.    
That jar (like all the other JavaEE API jars) is automatically  
inherited by webapps deployed into Geronimo as a descendent of the  
jee-specs component.   I have verified that this works using the  
MyFaces 1.1.5 sample app.  Obviously after taking these steps you  
would no longer have a JavaEE 5 compliant container since every JSF  
enabled webapp in the container would be using the JSF 1.1 API.


Best wishes,
Paul

On Nov 1, 2007, at 1:30 PM, David Jencks wrote:

> Paul may have more info, but my understanding is that for javaee  
> compliance we need to, by default, support myfaces 1.2 and ignore  
> any attempt to use earlier/other jsf implementations.
>
> You might be able to disable this support by turning off the  
> myfaces and myfaces-deployer modules in config.xml by adding a  
> load="false" attribute.  I can't promise this will work but it  
> might be worth a try.
>
> thanks
> david jencks
>
> On Nov 1, 2007, at 8:57 AM, Jochen Zink wrote:
>
>> Hello all,
>>
>> I try to deploy a JSF-Webapplication which depends on myfaces  
>> 1.1.5. This Application runs successfully under Tomcat 6.
>>
>> Know, I want deploy this application under Geronimo 2.0.2. With  
>> exactly the same WAR file, nothing is happen. No Error Messages  
>> and no HTML Page is shown in the browser, if I call the URL from  
>> the Webapplication. Just a empty page, containing no HTML appears.
>>
>> I expect, that this could be, that Geronimo has myfaces1.2 Libs  
>> loaded.
>>
>> After this, I added
>> <dep:hidden-classes>
>>     <dep:filter>org.apache.myfaces</dep:filter>
>> </dep:hidden-classes>
>> to the deploymentdescriptor of the Webapp.
>>
>> And know I get the following Error Message, after calling the  
>> WebApplication URL:
>>
>> Some Messages looks like this:
>>
>> An error occurred at line: 114 in the jsp file: /template.jsp
>> The method setHeight(String) in the type HtmlGraphicImageTagBase  
>> is not applicable for the arguments (JspValueExpression)
>> 111: 						<h:graphicImage value="pics/spacer.gif" width="0"  
>> height="20" />
>> 112: 						<h:outputText />
>> 113: 						<h:graphicImage value="pics/spacer.gif" width="0"  
>> height="20" />
>> 114: 						<h:graphicImage value="pics/spacer.gif" width="0"  
>> height="20" />
>> 115:
>> 116: 						<h:outputText />
>> 117: 						<h:outputText />
>>
>>
>> And an Exception which looks like:
>> javax.servlet.ServletException: java.lang.InstantiationException:  
>> Can't load class org.apache.jsp.template_jsp in classloader:  
>> org.apache.jasper.servlet.JasperLoader@106fbae
>> 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
>> 	org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter 
>> (ExtensionsFilter.java:147)
>>
>> root cause
>>
>> javax.faces.FacesException: java.lang.InstantiationException:  
>> Can't load class org.apache.jsp.template_jsp in classloader:  
>> org.apache.jasper.servlet.JasperLoader@106fbae
>> 	 
>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatc 
>> h(ServletExternalContextImpl.java:425)
>> 	 
>> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.d 
>> ispatch(JspTilesViewHandlerImpl.java:236)
>> 	 
>> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.r 
>> enderView(JspTilesViewHandlerImpl.java:222)
>> 	org.apache.myfaces.lifecycle.RenderResponseExecutor.execute 
>> (RenderResponseExecutor.java:41)
>> 	org.apache.myfaces.lifecycle.LifecycleImpl.render 
>> (LifecycleImpl.java:132)
>> 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>> 	org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter 
>> (ExtensionsFilter.java:147)
>>
>>
>>
>> Has anyone an idea, what I must do, to use myfaces 1.1.5 with  
>> geronimo 2.0.2?
>> We're not able to switch to myfaces 1.2!
>>
>> Thanks!
>> Regards
>> Jochen
>>
>>
>> _____________________________________________________________________ 
>> __
>> Jetzt neu! Sch├╝tzen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
>> kostenlos testen. http://www.pc-sicherheit.web.de/startseite/? 
>> mc=022220
>>
>


Mime
View raw message