Hi,

I found something strange when using ADF EA19 and MyFaces 1.1.1.

I took the blank.war files ( from MyFaces examples ), unzip into a dir, and 
then delete ALL jar files under WEB-INF/lib and copied just these 3 files : 
adf-faces-api-ea19.jar, adf-faces-impl-ea19.jar, and adfshare-3218.jar.

My next step is to modify the web.xml into this :

<?xml version="1.0"?>

<!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd";>

<web-app>

    <description>debug web.xml</description>

    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/examples-config.xml</param-value>
    </context-param>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>

    <filter>
        <filter-name>ADF Faces</filter-name>            
      <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ADF Faces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>

    <listener>        
       <listener-class>org.apache.myfaces.webapp.StartupServletContextListener
       </listener-class>
    </listener>

    <servlet>
        <servlet-name>ADF Resources</servlet-name>
        <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet
        </servlet-class>
    </servlet>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>ADF Resources</servlet-name>
        <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>

Then modify the examples-config.xml by adding just this :

<application>
    <default-render-kit-id>oracle.adf.core</default-render-kit-id>
</application>

OK, that's for the jar files, web.xml and config files.
Now, I need to modify the jsp files.

For helloWorld.jsp, I modified from the original into this :

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces"; prefix="af" %>

<f:view>

    <af:document title="Blank">
    <af:form>
    <af:panelPage title="Blank ADF - Hello World">

        <f:facet name="messages">
            <af:messages />
        </f:facet>

        <af:inputText label="Please enter your name" 
                              value="#{helloWorldBacking.name}"/>
        <af:commandButton text="Press Me" 
                                        action="#{helloWorldBacking.send}" />
    </af:panelPage>
    </af:form>
    </af:document>

</f:view>

And for page2.jsp, I did the same :

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces"; prefix="af" %>

<f:view>

    <af:document title="Blank">
    <af:form>
    <af:panelPage title="Blank ADF - Page2">

        <f:facet name="messages">
            <af:messages />
        </f:facet>

        <af:outputText value="Hello #{helloWorldBacking.name}. 
                                 We hope you enjoy Apache MyFaces"/>
        <af:commandButton text="GO HOME" action="back" />

    </af:panelPage>
    </af:form>
    </af:document>

</f:view>

I keep the same bean as it is.
Then I build a blank.war and deploy into JBoss 4.0.3SP1.
Works great, no problem at all.

Now, here comes the strange things.

If my welcome file is helloWorld.jsp, instead of index.jsp, I got errors. Or, 
if I keep my welcome file remains index.jsp but I replace the header of 
helloWorld.jsp and page2.jsp with this :

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"; version="1.2"
    xmlns:f="http://java.sun.com/jsf/core";
    xmlns:h="http://java.sun.com/jsf/html";
    xmlns:af="http://xmlns.oracle.com/adf/faces"; >

<jsp:directive.page contentType="text/html;charset=utf-8"/>

<f:view>
..
</jsp:root>

The error I got is this "Faces context not found" :
...
19:32:38,200 ERROR [javax.faces.webapp.UIComponentTag] Faces context not 
found. getResponseWriter will fail. Check if the FacesServlet has been 
initialized at all in your web.xml.
19:32:38,203 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].
[localhost].[/blank].[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at 
javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
at org.apache.jsp.helloWorld_jsp._jspx_meth_f_view_0
(org.apache.jsp.helloWorld_jsp:101)
at org.apache.jsp.helloWorld_jsp._jspService(org.apache.jsp.helloWorld_jsp:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
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(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
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.Http11Processor.process(Http11Processor.java:856)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at 
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)

Any comments on this strange behaviour ? Why do I get this error ?
Am I missing something ? A jar file maybe ?

Any help/pointers/suggestions would be great.

Thanks,  

                
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com

Reply via email to