myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alin Dosoniu (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-1125) problem that blocks tests with htmlunit
Date Sun, 26 Feb 2006 18:36:57 GMT
    [ http://issues.apache.org/jira/browse/MYFACES-1125?page=comments#action_12367852 ] 

Alin Dosoniu commented on MYFACES-1125:
---------------------------------------

This issue is a duplicate of MYFACES-1121. The solution from that issue is the same as the
solution for this problem. 
Please, close it and hope that someone will solve/find a solution for 1121.

> problem that blocks tests with htmlunit
> ---------------------------------------
>
>          Key: MYFACES-1125
>          URL: http://issues.apache.org/jira/browse/MYFACES-1125
>      Project: MyFaces Core
>         Type: Bug
>   Components: General
>     Versions: 1.1.2-SNAPSHOT
>  Environment: JDK 1.5, Tomcat 5.5.12, application with MyFaces and Tiles
>     Reporter: Alin Dosoniu

>
> I want to write a testcase for my application with HtmlUnit. Everytime when I make a
request to first page of the application I get this in log:
> java.lang.NullPointerException
>  at org.apache.myfaces.renderkit.html.HtmlRendererUtils.selectContentType(HtmlRendererUtils.java:995)
>  at org.apache.myfaces.renderkit.html.util.DefaultAddResource.writeResponse(DefaultAddResource.java:786)
>  at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:142)
>  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValvejava:213)
>  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValvejava:178)
>  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
>  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>  at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
>  at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:652)
>  at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
>  at java.lang.Thread.run(Unknown Source)
>  
> Because of this, there is an error 500 in the response, so I cannot go on with my testcase.
> I modified the HtmlRendererUtils source to test for null and I can access my application
from HtmlUnit.
> So, I replaced this:
> contentTypeListString = (String)
>                     context.getExternalContext().getRequestHeaderMap().get("Accept");
> with this:
> if (context != null && context.getExternalContext() != null &&  context.getExternalContext().getRequestHeaderMap()
!= null) {
>             contentTypeListString = (String)
>                     context.getExternalContext().getRequestHeaderMap().get("Accept");
> }
>  
> It is possible that I have an error in my jsps but I think these tests with null should
be also in Myfaces code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message