You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volker Weber (JIRA)" <de...@myfaces.apache.org> on 2006/02/27 10:52:58 UTC
[jira] Closed: (MYFACES-1125) problem that blocks tests with
htmlunit
[ http://issues.apache.org/jira/browse/MYFACES-1125?page=all ]
Volker Weber closed MYFACES-1125:
---------------------------------
Resolution: Duplicate
Closed as dublicate of MYFACES-1121 on Alin Dosonius request.
> 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