0

I have upgraded my JSF application to MyFaces 2.1.12 from MyFaces 1.2.7. I set related dependencies in web.xml file and ran the app in the localhost. The app compiled without any error but when I wanted to run it on browser nothing appeared on the page. What could be cause of this issue?

Here is the web.xml content:

<servlet>
    <servlet-name>log4j-init</servlet-name>
    <servlet-class>Log4jInit</servlet-class>
    <init-param>
    <param-name>log4j-init-file</param-name>
    <param-value>WEB-INF\log4j.lcf</param-value>
    </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>WEB-INF/log4j.properties</param-value>
</context-param>
<welcome-file-list>
    <welcome-file>portal/html/index.xhtml</welcome-file>
</welcome-file-list>
<context-param>
    <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
    <param-value>false</param-value>
</context-param>
<!-- Special Debug Output for Development -->
<context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>facelets.REFRESH_PERIOD</param-name>
    <param-value>2</param-value>
</context-param>
<context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
    <param-value>true</param-value>
</context-param>
<!-- Richfaces -->
<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>tracker</param-value>
</context-param>
<!-- Richfaces end -->
<context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<listener>
    <listener-class>com.omega.src.util.InitializeListener</listener-class>
</listener>
<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>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>loginPage.xhtml</welcome-file>
</welcome-file-list>
<login-config>
    <auth-method>BASIC</auth-method>
</login-config>

Here is my pom.xml content:

<dependencies>
    <dependency>
        <groupId>org.apache.myfaces.core</groupId>
        <artifactId>myfaces-api</artifactId>
        <version>2.1.12</version>
    </dependency>
    <dependency>
        <groupId>org.apache.myfaces.core</groupId>
        <artifactId>myfaces-impl</artifactId>
        <version>2.1.12</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>

    <dependency>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-api</artifactId>
        <version>4.3.2.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-impl</artifactId>
        <version>4.3.2.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-components-ui</artifactId>
        <version>4.3.2.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-components-api</artifactId>
        <version>4.3.2.Final</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.6.8.Final</version>
    </dependency>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.1-901.jdbc4</version>
    </dependency>
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.12.1.GA</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.gmaps4jsf</groupId>
        <artifactId>gmaps4jsf-core</artifactId>
        <version>1.1.4</version>
    </dependency>
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>4.5.0</version>
    </dependency>
    <dependency>
        <groupId>net.sourceforge.jexcelapi</groupId>
        <artifactId>jxl</artifactId>
        <version>2.6.12</version>
    </dependency>
</dependencies>
nudastack
  • 125
  • 1
  • 4
  • 18
  • @BalusC -: I have read the link you provided but nothing refers to my specific problem. I think there is an issue with classloading policy regarding my application. How could I proceed regarding this matter? – nudastack Jul 02 '13 at 14:51
  • You need to be more specific in the problem. You need to elaborate the presentation problem in developer's perspective, not in enduser's perspective. To begin with, what exactly has the server sent as a response to the request? For starters understanding basic HTML, an easy way to figure that is rightclicking the page in browser and choosing *View Source*. For a bit more advanced starter understanding basic HTTP, another way is to press F12 in Chrome/IE>=9/Firebug and monitor the HTTP/network traffic and check if all requests/responses went as expected. – BalusC Jul 02 '13 at 17:05
  • I know basic HTML and HTTP errors but when I chose the source nothing appeared on the page it was empty. There was no HTTP error regarding the page. Will there be a paroblem with view technology? Before migrating the application, Facelets 1.1.14 was used with MyFaces 1.2.7. However, we replaced MyFaces 1.2.7 by MyFaces 2.1.12 and completely removed Facelets 1.1.14. Do I have to include Facelets 2.x with the MyFaces 2.1.12 or does MyFaces 2.1.12 include Facelets? – nudastack Jul 02 '13 at 20:34
  • Your question wasn't explicit enough about that. You also only posted maven dependencies from pom.xml which is rather irrelevant (maven is just a dependency (JAR file) management tool). Just summarize the versions used and relevant to JSF. The web.xml was been more interesting. Facelets 2.x is bundled in JSF 2.x. Have you been through http://stackoverflow.com/questions/4441713/migrating-from-jsf-1-2-to-jsf-2-0/4532870#4532870 as hinted in your previous question? – BalusC Jul 02 '13 at 20:46
  • Yes, I have read that page carefully and modified the entries in web.xml. I just shared the web.xml file above Sir. In your link it is said that "Update root declaration of existing Facelet taglib XML's to comply Facelets 2.0.". I don't have such Facelet taglib entry in any of my xml files. Should there be such Facelet taglib in web.xml or any other file? – nudastack Jul 02 '13 at 20:56
  • Did you also read the part about component libraries? RichFaces 3.3 is not out the box compatible with JSF 2.0. – BalusC Jul 02 '13 at 21:03
  • I read that part as well and went through many discusions. I replaced all the RichFaces 3.3.3 libs by Richfaces 4.3.2 libs and removed all filter and filter-mapping entries from web.xml file. Now, something else happened; all the dynamic components that are derived from RichFaces components does not resolved. The imported RichFaces components are not there anymore. What should I do now? The pom.xml and web.xml are updated above. – nudastack Jul 03 '13 at 08:51

0 Answers0