1 2 Previous Next 15 Replies Latest reply on Jun 20, 2013 4:51 PM by Stan Silvert

    Wildfly 8.0 Aplha1 and Seam 2

    H G Newbie

      Hi,

       

      We have Seam 2 app that is already working on Jboss AS 7.1. I'd like to upgrade to WildFly(currently 8.0 Alpha1) but receive the next error:

       

      12:58:56,305 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.undertow.deployment.default-host./warAlias.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jbos

      s.undertow.deployment.default-host./warAlias.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: 404 from [Module "deployment.warName.war:main" from Service Module Loader]

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:587)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:200)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1974) [jboss-msc-1.1.2.Final.jar:1.1.2.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1907) [jboss-msc-1.1.2.Final.jar:1.1.2.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

      Caused by: java.lang.ClassNotFoundException: 404 from [Module "deployment.warName.war:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final]

              at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_21]

              at java.lang.Class.forName(Class.java:266) [rt.jar:1.7.0_21]

              at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) [wildfly-server-8.0.0.Alpha1.jar:8.0.0.Alpha1]

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:515)

              ... 6 more

       

      12:58:56,414 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "warName.war")]) - failure description: {"JBAS014671: Failed services" => {"jb

      oss.undertow.deployment.default-host./warAlias.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-host./warAlias.UndertowDeploymentInfoService: java.lang.ClassNotFoundExcepti

      on: 404 from [Module \"deployment.warName.war:main\" from Service Module Loader]

          Caused by: java.lang.ClassNotFoundException: 404 from [Module \"deployment.warName.war:main\" from Service Module Loader]"}}

      12:58:56,461 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 27) JBAS018559: Deployed "warName.war" (runtime-name : "warName.war")

      12:58:56,476 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.undertow.deployment.default-host./empleo16.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-host./warAlias.Unde

      rtowDeploymentInfoService: java.lang.ClassNotFoundException: 404 from [Module "deployment.warName.war:main" from Service Module Loader]

       

       

      Seam 2 requieres JSF 1.2 so I added two modules:

       

      First: modules\system\layers\base\javax\faces\api\1.2

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="1.2">

          <dependencies>

              <module name="javax.el.api" export="true"/>

              <module name="javax.servlet.api" export="true"/>

              <module name="javax.servlet.jsp.api" export="true"/>

              <module name="javax.servlet.jstl.api" export="true"/>

              <module name="javax.validation.api" export="true"/>

          </dependencies>

       

          <resources>

              <resource-root path="jsf-api-1.2_15-jbossorg-2.jar"/>

          </resources>

      </module>

       

      Second: modules\system\layers\base\com\sun\jsf-impl\1.2

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.1" name="com.sun.jsf-impl" slot="1.2">

          <properties>

              <property name="jboss.api" value="private"/>

          </properties>

       

          <dependencies>

              <module name="javax.faces.api" slot="1.2"/>

              <module name="javaee.api"/>

              <module name="javax.servlet.jstl.api"/>

          </dependencies>

       

          <resources>

              <resource-root path="jsf-impl-1.2_15-jbossorg-2.jar"/>

          </resources>

      </module>

       

       

      In WEB-INF of the WAR we have jboss-deployment-structure.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

         <deployment>

              <exclusions>

                <module name="javax.faces.api" slot="main"/>

                <module name="com.sun.jsf-impl" slot="main"/>

              </exclusions>

              <dependencies>

                <module name="org.apache.commons.logging" />

                <module name="org.apache.commons.collections" />

                <module name="org.apache.log4j" />

                <module name="org.dom4j" />

                <module name="javax.faces.api" slot="1.2"/>

                <module name="com.sun.jsf-impl" slot="1.2"/>

              </dependencies>

          </deployment>  

      </jboss-deployment-structure>

       

      I tried to use also export="true" on dependencies without success.

       

      From the error stack is obvious that the problem is ClassNotFoundException but there is not info pointing which class is not found. I can see that in WildFly there is little difference between modules\system\layers\base\org\apache\log4j\main and modules\org\apache\log4j\main (Jboss As 7.1)

       

      How can be solved this error?

        • 1. Re: Wildfly 8.0 Aplha1 and Seam 2
          jaikiran pai Master

          What does the web.xml look like?

          • 2. Re: Wildfly 8.0 Aplha1 and Seam 2
            H G Newbie

            Hi,

             

            this is the web.xml:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

              <display-name>project_name</display-name>

              <welcome-file-list> 

                <welcome-file>index.html</welcome-file>

                <welcome-file>index.seam</welcome-file>

              </welcome-file-list>   

              <error-page>

                <exception-type>404</exception-type> 

                <location>/404.xhtml</location>

              </error-page>   

              <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>*.seam</url-pattern>

                <url-pattern>/faces/*</url-pattern>

              </servlet-mapping>

              <context-param>  

                <param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>

                <param-value>Mojarra-1.2</param-value>

              </context-param>

              <context-param>

                <param-name>org.richfaces.SKIN</param-name>

                <param-value>laguna</param-value>

              </context-param>

              <context-param>

                <param-name>facelets.SKIP_COMMENTS</param-name>

                <param-value>true</param-value> 

              </context-param> 

              <context-param>

                <param-name>org.richfaces.CONTROL_SKINNING</param-name>

                <param-value>enable</param-value>

              </context-param>

              <context-param>

                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                <param-value>.xhtml</param-value>

              </context-param>  

              <context-param>

                <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>

                <param-value>true</param-value>

              </context-param>

              <context-param>

                <param-name>facelets.DEVELOPMENT</param-name>

                <param-value>false</param-value>

              </context-param>

              <context-param>

                <param-name>com.sun.faces.externalizeJavaScript</param-name>

                <param-value>true</param-value>

              </context-param>

              <context-param>

                <param-name>com.sun.faces.sendPoweredByHeader</param-name>

                <param-value>false</param-value>

              </context-param>

              <context-param>

                <param-name>facelets.LIBRARIES</param-name>

                <param-value>/META-INF/functions.taglib.xml</param-value>

              </context-param>

             

              <listener>

                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>

              </listener>

             

             

             

              <filter>

                <filter-name>RichFacesFirefoxFilter</filter-name>

                <filter-class>com.mejoroferta.mo.session.browser.RichFacesFirefoxFilter</filter-class>

              </filter>

              <filter-mapping>

                <filter-name>RichFacesFirefoxFilter</filter-name>               

                <url-pattern>/a4j/*</url-pattern>

              </filter-mapping>     

             

             

                  

              <filter>

                <filter-name>Seam Filter</filter-name>

                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>

                <init-param>

                  <param-name>createTempFiles</param-name>

                  <param-value>false</param-value>

                </init-param>

                <init-param>

                  <param-name>maxRequestSize</param-name>

                  <param-value>2621440</param-value>

                </init-param>

              </filter> 

              <filter-mapping> 

                <filter-name>Seam Filter</filter-name>

                <url-pattern>/*</url-pattern>

              </filter-mapping>

               

                

              

              <servlet>              

                <servlet-name>Seam Resource Servlet</servlet-name>

                <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>

              </servlet>

              <servlet-mapping>

                <servlet-name>Seam Resource Servlet</servlet-name>

                <url-pattern>/seam/resource/*</url-pattern>

              </servlet-mapping>

             

             

             

              <session-config>

                <session-timeout>60</session-timeout>

              </session-config>

              <security-constraint>

                <display-name>Restrict raw XHTML Documents</display-name>

                <web-resource-collection>

                  <web-resource-name>XHTML</web-resource-name>

                  <url-pattern>*.xhtml</url-pattern>

                </web-resource-collection>

                <auth-constraint/>

              </security-constraint>

            </web-app>

            • 3. Re: Wildfly 8.0 Aplha1 and Seam 2
              jaikiran pai Master

              <error-page>

                  <exception-type>404</exception-type> 

              That looks wrong. The exception-type element is supposed to be the fully qualified class name of the exception. I think what you wanted to configure is the error-code:

               

              <error-page>
                <error-code>404</error-code>
              ....
              
              1 of 1 people found this helpful
              • 4. Re: Wildfly 8.0 Aplha1 and Seam 2
                Joshua Davis Expert

                Where did you get the jar files for your JSF 1.2 modules?

                • 5. Re: Wildfly 8.0 Aplha1 and Seam 2
                  Stan Silvert Master

                  If you can use a nightly build of Alpha 2, you can use the new improved WildFly Multi-JSF feature.  This will make sure that JSF 1.2 is installed properly and you won't need to use jboss-deployment-structure.xml.

                   

                  Stan

                  • 6. Re: Wildfly 8.0 Aplha1 and Seam 2
                    Joshua Davis Expert

                    Stan,

                     

                    I'm using the nightly build, so I'll check that out.  So I just take out all the JSF-related stuff out of my jboss-deployment-structure.xml file?

                     

                    Also, it would be great to have an example of how to install the JSF 1.2 (whatever implementation is used in AS 5).

                    • 7. Re: Wildfly 8.0 Aplha1 and Seam 2
                      Stan Silvert Master

                      Joshua Davis wrote:

                       

                      Stan,

                       

                      I'm using the nightly build, so I'll check that out.  So I just take out all the JSF-related stuff out of my jboss-deployment-structure.xml file?

                      Right.  You should never need jboss-deployment-structure.xml for JSF purposes.

                       

                       

                       

                      Also, it would be great to have an example of how to install the JSF 1.2 (whatever implementation is used in AS 5).

                      That's a good idea.  Since we removed JSF 1.2 in WildFly it's probably a good idea to provide a full tutorial for putting it back.  I suspect you won't be the only one who needs it.  I'll see if I can knock that out tomorrow.

                       

                      Stan

                      • 8. Re: Wildfly 8.0 Aplha1 and Seam 2
                        Joshua Davis Expert

                        Stan Silvert wrote:

                         

                        Joshua Davis wrote:

                         

                        Stan,

                         

                        I'm using the nightly build, so I'll check that out.  So I just take out all the JSF-related stuff out of my jboss-deployment-structure.xml file?

                        Right.  You should never need jboss-deployment-structure.xml for JSF purposes.

                         

                         

                         

                        So, the RightWay(TM) going forward would be to use the properties in web.xml to identify the JSF API and implementation?   For Seam2 apps using EJB3, this may be a little tricky since the EJB jar often has transitive dependencies on JSF for the Seam 2 backing beans.

                         

                         

                         

                        Also, it would be great to have an example of how to install the JSF 1.2 (whatever implementation is used in AS 5).

                        That's a good idea.  Since we removed JSF 1.2 in WildFly it's probably a good idea to provide a full tutorial for putting it back.  I suspect you won't be the only one who needs it.  I'll see if I can knock that out tomorrow.

                         

                        Great!  Let me know and I'll give it a try.

                        • 9. Re: Wildfly 8.0 Aplha1 and Seam 2
                          Stan Silvert Master

                          Joshua Davis wrote:

                           

                          So, the RightWay(TM) going forward would be to use the properties in web.xml to identify the JSF API and implementation?   For Seam2 apps using EJB3, this may be a little tricky since the EJB jar often has transitive dependencies on JSF for the Seam 2 backing beans.

                           

                          This shouldn't be an issue.  If it is, let me know.  When we add JSF to the deployment we actually add it to the top level deployment, so an EJB jar should have access to the same JSF version as your WAR.

                           

                          That being said, I consider it to be an architectural flaw for JSF to ever be needed by an EJB.  JSF is a web teir API that EJB's should never know about.  But I understand that Seam 2 apps often break this rule which is why we make JSF accesible to EJB's.

                           

                          Stan

                          • 10. Re: Wildfly 8.0 Aplha1 and Seam 2
                            Joshua Davis Expert

                            Stan Silvert wrote:

                             

                            This shouldn't be an issue.  If it is, let me know.  When we add JSF to the deployment we actually add it to the top level deployment, so an EJB jar should have access to the same JSF version as your WAR.

                             

                            That being said, I consider it to be an architectural flaw for JSF to ever be needed by an EJB.  JSF is a web teir API that EJB's should never know about.  But I understand that Seam 2 apps often break this rule which is why we make JSF accesible to EJB's.

                             

                            Stan

                            Yes.  I thought the same thing when first making 'backing beans' with Seam 2.  My plan is to move those 'jsf-y' EJBs into the WAR (because EJB3.1 let's me do that) shortly after I move everything to AS7.2 or WF8.x (whichever I can get to work first).

                            • 11. Re: Wildfly 8.0 Aplha1 and Seam 2
                              H G Newbie

                              Joshua Davis escribió:

                               

                              Where did you get the jar files for your JSF 1.2 modules?

                              If you are asking where you can download them, they already come shipped with jboss as 7.1.  For example you can go to: jboss-as-7.1.1.Final\modules\com\sun\jsf-impl\1.2

                              • 12. Re: Wildfly 8.0 Aplha1 and Seam 2
                                Joshua Davis Expert

                                H G wrote:

                                 

                                Joshua Davis escribió:

                                 

                                Where did you get the jar files for your JSF 1.2 modules?

                                If you are asking where you can download them, they already come shipped with jboss as 7.1.  For example you can go to: jboss-as-7.1.1.Final\modules\com\sun\jsf-impl\1.2

                                I thought you might have done that, but I wasn't sure.   Thanks for confirming that.

                                • 13. Re: Wildfly 8.0 Aplha1 and Seam 2
                                  H G Newbie

                                  Joshua Davis escribió:

                                   

                                  H G wrote:

                                   

                                  Joshua Davis escribió:

                                   

                                  Where did you get the jar files for your JSF 1.2 modules?

                                  If you are asking where you can download them, they already come shipped with jboss as 7.1.  For example you can go to: jboss-as-7.1.1.Final\modules\com\sun\jsf-impl\1.2

                                  I thought you might have done that, but I wasn't sure.   Thanks for confirming that.

                                  If you are trying to upgrade jboss as, I recommend you in first place to go with 7.x (7.1.1), then go with WildFly. Is much more easier. WildFly is under development and the focus are new functionalities as cdi1.1, weld 2, jsf 2.2, etc. I recommend WildFly if you start a new project. After a while when there is a beta or final version You can go directly to WildFly.

                                  • 14. Re: Wildfly 8.0 Aplha1 and Seam 2
                                    Joshua Davis Expert

                                    H G wrote:

                                     

                                    If you are trying to upgrade jboss as, I recommend you in first place to go with 7.x (7.1.1), then go with WildFly. Is much more easier. WildFly is under development and the focus are new functionalities as cdi1.1, weld 2, jsf 2.2, etc. I recommend WildFly if you start a new project. After a while when there is a beta or final version You can go directly to WildFly.

                                    I'm aware of WildFly being under development.  All of my newer projects are on AS 7 already, with CDI, JSF2, etc.   For our main app (which has been using Seam 2 succesfully for many years now), my target is AS 7.2.0 for various reasons.    I'm trying WildFly as well because I think it's a legitimate use case to port older (EE5/Seam2/JPA1) apps.

                                    1 2 Previous Next