JBoss AS 7.1 and MyFaces 1.2
mreinhardt Feb 24, 2012 6:15 AMI've trying to migrate an existing application from JBoss 4.2.3 to AS 7.1. The application is using MyFaces, Facelets and Hibernate 3. During startup it still tries to load JSF RI 1.2:
12:07:46,117 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.subunit."MyApp2.ear"."MyApp-Web.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."MyApp2.ear"."MyApp-Web.war".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "MyApp-Web.war" of deployment "MyApp2.ear" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011093: Could not load component class com.sun.faces.config.ConfigureListener at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:113) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:54) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final] ... 5 more Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener from [Module "deployment.MyApp2.ear.MyApp-Web.war:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA] at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:111) ... 7 more
My jboss-deployment-structure.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <dependencies> <module name="javax.faces.api" slot="1.2" export="true"/> </dependencies> <exclusions> <module name="javax.faces.api" slot="main" /> <module name="javax.faces.api" slot="sun"/> </exclusions> </deployment> <sub-deployment name="MyApp-Web.war"> <exclusions> <module name="javaee.api"/> <module name="javax.faces.api" slot="main" /> </exclusions> <dependencies> <module name="javax.faces.api" slot="1.2"/> </dependencies> </sub-deployment> </jboss-deployment-structure>
Here's my web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <context-param> <description>Specifies if JBoss should ignore its built-in JSF implementation. Note: Works only with the default JBoss classloader settings. You must not declare a classloader in jboss-web.xml or set useJBossWebLoader = true. Note: This is a community-only feature. It is not officially supported.</description> <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name> <param-value>true</param-value> </context-param> <context-param> <description>State saving method: "client" or "server" (= default) See JSF Specification 2.5.3</description> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <description>Only applicable if state saving method is "server" (= default). Defines the amount (default = 20) of the latest views are stored in session.</description> <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name> <param-value>20</param-value> </context-param> <context-param> <description>Only applicable if state saving method is "server" (= default). If true (default) the state will be serialized to a byte stream before it is written to the session. If false the state will not be serialized to a byte stream.</description> <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name> <param-value>false</param-value> </context-param> <context-param> <description>Only applicable if state saving method is "server" (= default) and if org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default) If true (default) the serialized state will be compressed before it is written to the session. If false the state will not be compressed.</description> <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name> <param-value>false</param-value> </context-param> <context-param> <description>This parameter tells MyFaces if javascript code should be allowed in the rendered HTML output. If javascript is allowed, command_link anchors will have javascript code that submits the corresponding form. If javascript is not allowed, the state saving info and nested parameters will be added as url parameters. Default: "true"</description> <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> <description>If true, rendered HTML code will be formatted, so that it is "human readable". i.e. additional line separators and whitespace will be written, that do not influence the HTML code. Default: "true"</description> <param-name>org.apache.myfaces.PRETTY_HTML</param-name> <param-value>false</param-value> </context-param> <context-param> <description>If true, a javascript function will be rendered that is able to restore the former vertical scroll on every request. Convenient feature if you have pages with long lists and you do not want the browser page to always jump to the top if you trigger a link or button action that stays on the same page. Default: "false"</description> <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> <param-value>true</param-value> </context-param> <context-param> <description>Validate managed beans, navigation rules and ensure that forms are not nested.</description> <param-name>org.apache.myfaces.VALIDATE</param-name> <param-value>false</param-value> </context-param> <context-param> <description>A class implementing the org.apache.myfaces.shared.renderkit.html.util.AddResource interface. It is responsible to place scripts and css on the right position in your HTML document. Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"</description> <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name> <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name> <param-value>/faces/myFacesExtensionResource</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.USE_ENCRYPTION</param-name> <param-value>false</param-value> </context-param> <!-- we handle errors ourselves --> <context-param> <param-name>org.apache.myfaces.ERROR_HANDLER</param-name> <param-value>com.app.my.presentation.util.ErrorHandler</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jsp</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>false</param-value> </context-param> <!-- Facelets pages will use the .xhtml extension --> <context-param> <param-name>facelets.VIEW_MAPPINGS</param-name> <param-value>*.xhtml</param-value> </context-param> <context-param> <param-name>facelets.LIBRARIES</param-name> <param-value>/WEB-INF/taglib/pos.taglib.xml</param-value> </context-param> <filter> <filter-name>MyFacesExtensionsFilter</filter-name> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class> <init-param> <description>Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB</description> <param-name>maxFileSize</param-name> <param-value>30m</param-value> </init-param> <init-param> <description>Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB</description> <param-name>uploadThresholdSize</param-name> <param-value>1</param-value> </init-param> </filter> <filter> <filter-name>JaasLoginFilter</filter-name> <filter-class>com.app.my.presentation.auth.JaasLoginFilter</filter-class> </filter> <filter> <display-name>Ajax4jsf Filter</display-name> <filter-name>ajax4jsf</filter-name> <filter-class>com.app.my.presentation.IE9AjaxFilter</filter-class> </filter> <filter> <filter-name>NoCacheFilter</filter-name> <filter-class>com.app.my.presentation.NoCacheFilter</filter-class> </filter> <filter> <filter-name>AuthFilter</filter-name> <filter-class>com.app.my.presentation.scheduler.rest.AuthFilter</filter-class> </filter> <filter> <filter-name>AuthFilterWithLogin</filter-name> <filter-class>com.app.my.presentation.scheduler.rest.AuthFilter</filter-class> <init-param> <param-name>redirectToLoginPage</param-name> <param-value>true</param-value> </init-param> </filter> <filter> <filter-name>RestExceptionHandlingFilter</filter-name> <filter-class>com.app.my.presentation.scheduler.rest.RestExceptionHandlingFilter</filter-class> </filter> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/admin/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/reports/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/insureradmin/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/IS*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/workflow/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/workflow_eCQRF/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/user/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>JaasLoginFilter</filter-name> <!-- servlet-name must match the name of your JaasLoginFilter entry --> <url-pattern>/faces/pages/login/changePassword.jsp</url-pattern> </filter-mapping> <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages --> <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry --> <servlet-name>Faces Servlet</servlet-name> </filter-mapping> <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) --> <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <url-pattern>/faces/myFacesExtensionResource/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>AuthFilter</filter-name> <servlet-name>Jersey Web Application</servlet-name> </filter-mapping> <filter-mapping> <filter-name>RestExceptionHandlingFilter</filter-name> <servlet-name>Jersey Web Application</servlet-name> </filter-mapping> <filter-mapping> <filter-name>NoCacheFilter</filter-name> <servlet-name>Jersey Web Application</servlet-name> </filter-mapping> <filter-mapping> <filter-name>AuthFilterWithLogin</filter-name> <servlet-name>ApplicationImportPerEmailJobTriggerServlet</servlet-name> </filter-mapping> <filter-mapping> <filter-name>AuthFilterWithLogin</filter-name> <servlet-name>JobDispatcherServlet</servlet-name> </filter-mapping> <filter-mapping> <filter-name>NoCacheFilter</filter-name> <url-pattern>/faces/scheduler/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>AuthFilterWithLogin</filter-name> <url-pattern>/faces/scheduler/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>ajax4jsf</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener> <listener> <listener-class>com.app.my.presentation.listener.SessionListener</listener-class> </listener> <!-- <listener> --> <!-- <listener-class> --> <!-- com.sun.faces.config.ConfigureListener --> <!-- </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> <servlet-name>JobDispatcherServlet</servlet-name> <servlet-class>com.app.my.presentation.JobDispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>ImagesServlet</servlet-name> <servlet-class>com.app.my.presentation.util.ImagesServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet> <servlet-name>Jersey Web Application</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.app.my.presentation.ecqrf.rest,com.app.my.presentation.scheduler.rest</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>ApplicationImportPerEmailJobTriggerServlet</servlet-name> <servlet-class>com.app.my.presentation.dataimport.ApplicationImportPerEmailJobTriggerServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Jersey Web Application</servlet-name> <url-pattern>/api/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ImagesServlet</servlet-name> <url-pattern>/IS</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ApplicationImportPerEmailJobTriggerServlet</servlet-name> <url-pattern>/dataimport/appimportperemailtrigger</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>JobDispatcherServlet</servlet-name> <url-pattern>/job/reload</url-pattern> </servlet-mapping> <session-config> <session-timeout>60</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.html</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/faces/pages/login/login.jsp</location> </error-page> <error-page> <error-code>500</error-code> <location>/faces/technicalError.jsp</location> </error-page>
And this is the contents of my EAR:
MyApp.ear --> lib --> *.jar -->MyApp-EJB.war -->MyApp-Web.war --> lib -->ajax4jsf-1.1.1.jar -->commons-el-1.0.jar -->jdbc2_0-stdext.jar -->jettison-1.1.jar -->jsr311-api-1.1.1.jar -->myfaces-api-1.2.11.jar -->oscache-2.3.2.jar -->standard.jar -->asm-3.1.jar -->flexjson-2.1.jar -->jersey-bundle-1.6.jar -->jsf-facelets-1.1.15-seam.jar -->jstl-1.1.0.jar -->myfaces-impl-1.2.11.jar -->saxon9he.jar -->tomahawk-1.1.11.jar
Any ideas what I'm doing wrong?