12 Replies Latest reply on Sep 5, 2012 10:47 AM by Tomaz Cerar

    WAR Problems with JBoss 7

    Markus Döring Newbie

      I'm using

      JBoss AS 7.0.0.Final "Lightning": Everything (NOT Java EE6 Certified) (will need stuff like JMS later).

       

      Now i try to get a "simple as possible" WAR to running.

      If i try the WAR standalong, the deployment seems to work:

       

      17:04:47,940 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) Starting deployment of "TestServer-WEB.war"

      17:04:47,981 INFO  [org.jboss.web] (MSC service thread 1-5) registering web context: /TestServer-WEB

      17:04:47,998 INFO  [org.jboss.as.server.controller] (HttpManagementService-threads - 8) Deployed "TestServer-WEB.war"

       

      but accessing http://localhost:8080/TestServer-WEB/faces/hello.xhtml gives me a 404 page not found.

       

      Also i tryied to put it into an "simple as possible EAR.

      Here the deployment failes:

       

      17:07:03,159 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "TestServer.ear"

      17:07:03,164 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "TestServer-WEB.war"

      17:07:03,191 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/TestServer]] (MSC service thread 1-2) StandardWrapper.Throwable: java.lang.IllegalStateException: Die Anwendung wurde bei Systemstart nicht einwandfrei initialisiert, Factory konnte nicht gefunden werden: javax.faces.context.FacesContextFactory

          at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

       

      17:07:03,195 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/TestServer]] (MSC service thread 1-2) Servlet /TestServer threw load() exception: java.lang.IllegalStateException: Die Anwendung wurde bei Systemstart nicht einwandfrei initialisiert, Factory konnte nicht gefunden werden: javax.faces.context.FacesContextFactory

          at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

       

      17:07:03,197 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: /TestServer

      17:07:03,225 INFO  [org.jboss.as.server.controller] (HttpManagementService-threads - 9) Deployed "TestServer.ear"

       

      but accessing http://localhost:8080/TestServer/faces/hello.xhtml partly works, it don't give back a 404 but a 500 with the same error message as above in the stack tree.

       

      I'be attached both: WAR and EAR file.

       

      please help.

       

      Regards

      Markus

       

      Added TestSimple.ear with packaged .war inside .ear

        • 1. Re: WAR Problems with JBoss 7
          Markus Döring Newbie

          Finally, i have set up a new WAR and get it working (dont know what was wrong with the first one).

          But as soon as it's packaged within an .ear, it failes again:

           

          09:31:00,828 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "TestSimple.ear"

          09:31:00,843 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Starting deployment of "TestSimple-WEB.war"

          09:31:00,890 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/TestSimple]] (MSC service thread 1-4) StandardWrapper.Throwable: java.lang.IllegalStateException: Die Anwendung wurde bei Systemstart nicht einwandfrei initialisiert, Factory konnte nicht gefunden werden: javax.faces.context.FacesContextFactory

              at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

           

          Any help?

          Cant be that hard to get a damn small ear working.

          • 2. Re: WAR Problems with JBoss 7
            Nicklas Karlsson Master

            Are you including Seam3?

             

            (nevermind, didn't see the attachment)

             

            I'll try them out.

             

            Message was edited by: Nicklas Karlsson

            • 3. Re: WAR Problems with JBoss 7
              Markus Döring Newbie

              No libs at all, just the following files:

               

              TestSimple.ear

              ---> META-INF

              ------> application.xml

              ------> MANIFEST.MF

              --->TestSimple-WEB.war

              ------> test.html

              ------> test.xhtml

              ------> META-INF

              ---------> MANIFEST.MF

              ------> WEB-INF

              ---------> web.xml

               

              that's why i say, smallest posible.

              Also tried some changes like removing manifest files, adding faces-config.xml, adding dependencies to manifest file, but nothing is working.

              • 4. Re: WAR Problems with JBoss 7
                Nicklas Karlsson Master

                Hmm, strange. I haven't done much EAR:s but tried the most obvious things: adding faces-config.xml to the WAR and dropping the Dependencies in the manifest but still no go, it looks like some JSF bootstrap strangeness. But if it would be completely broken one would think that someone would have noticed it by now!

                • 5. Re: WAR Problems with JBoss 7
                  wiktorowski maximilien Novice

                  hi,

                   

                  it's just because the war inside your ear is not a war archive but just a folder with a .war extension, if you make it a real war archive it should works

                   

                  Best regards,

                  Maximilien

                  • 6. Re: WAR Problems with JBoss 7
                    wiktorowski maximilien Novice

                    just to save you times, the next problem you should be facing with jsf in jboss 7 is related to https://issues.jboss.org/browse/AS7-1283 so don't forget to start the server with -Dorg.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false and all should be good ;-)

                     

                    I'm using a quite complex ear that is now running well on JBoss 7

                     

                    ++

                    Maximilien

                    • 7. Re: WAR Problems with JBoss 7
                      Markus Döring Newbie

                      Thanks so far for the help.

                       

                      I tried packaging the war inside of the ear.

                       

                      Now the deployment seems to be OK:

                       

                      14:32:06,223 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "TestSimple.ear"

                       

                      14:32:06,251 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Starting deployment of "TestSimple-WEB.war"

                       

                      14:32:06,390 INFO  [org.jboss.web] (MSC service thread 1-1) registering web context: /TestSimple

                       

                      14:32:06,403 INFO  [org.jboss.as.server.controller] (HttpManagementService-threads - 2) Deployed "TestSimple.ear"

                       

                      but now I'm back at the point where I only get 404 and nothing (

                      http://localhost:8080/TestSimple/faces/test.html

                      http://localhost:8080/TestSimple/faces/test.xhtml

                      http://localhost:8080/TestSimple/test.xhtml

                      http://localhost:8080/TestSimple/test.html

                      ) inside of the WAR can be found.

                       

                      I have attached the new ear (TestSimple.ear) with packaged war inside.

                       

                      issues.jboss.org is down atm so can't look into it for now.

                      I've added the parameter to jboss but (as i expected) nothing changed at all. This seems to be another problem I've not run into yet.

                       

                      I've a quite big ear running on JBoss 4.2.2 (EJB5) for a few years so I'm not totally new to this stuff, but hanging in the first step of the project for a few days is a bit frustrating.

                       

                      I'm sure jboss 7 can handle WAR in EAR, I just don't find out what could be wrong in 2 XML files without a single line of code at all.

                      • 8. Re: WAR Problems with JBoss 7
                        jaikiran pai Master

                        By the way, you might want to try this against latest AS7 nightly binary http://community.jboss.org/thread/167590

                        • 9. Re: WAR Problems with JBoss 7
                          wiktorowski maximilien Novice

                          your packaging is still bad, inside your war you have a folder TestSimple-WEB.war_ instead of your files directly

                          1 of 1 people found this helpful
                          • 10. Re: WAR Problems with JBoss 7
                            Markus Döring Newbie

                            Ok, that's it.

                            Looks like I've messed around some stuff while packaging the .war.

                             

                            So the solution was to put packaged .WAR in the .EAR and after this it works (if it's done correctly).

                             

                            Thank for help, i hope i will get a few steps further now.

                            • 11. Re: WAR Problems with JBoss 7
                              Madhu Y Newbie

                              Hi,

                               

                              I am facing the same problem while launching the application using jboss7.1

                              My war file is simple. But still I am not able to launch my application.

                              Getting the below error

                              HTTP Status 404 - /sample/


                              type Status report

                              message /sample/

                              description The requested resource (/sample/) is not available.

                               

                               

                              I am attaching war file and standalone file for reference.

                               

                              Can someone help me with the issue?

                               

                              Regards,

                              Madhu

                              • 12. Re: WAR Problems with JBoss 7
                                Tomaz Cerar Master

                                your jboss-web.xml says:

                                 

                                <jboss-web>

                                    <context-root>/</context-root>

                                    <virtual-host>Starting</virtual-host>

                                </jboss-web>

                                 

                                and your virutal host "Starting" is configured. but it is wrongly configured, you canot have two virutal hosts for "localhost"

                                plus your context is "/" that means it would listen to / and not to /sample

                                to make it work as you envisionend then remove jboss-web.xml all together.

                                 

                                or remove "localhost" from "default-host" configuration.

                                 

                                after that you will be able to get your application on http://localhost:8080/

                                 

                                 

                                --

                                tomaz