11 Replies Latest reply on Feb 1, 2011 5:50 AM by john.turner

    JBoss AS 6, Spring Webflow

    john.turner

      I have developing an application in Java, Spring, RichFaces, Spring Web Flow etc. and to date have been deploying the application successfully to Tomcat 6.

       

      I would like the final deployment to be to a JBoss AS 6 cluster and as a starting point am trying to deploy the application (war) to a single node.  When I copy the war to the deploy directory and start the server it deploys successfully.  I can then go into the admin console and see the application status etc.

       

      I cannot however delete the application through the console (this is not my main concern at the moment).

       

      My main concern is that if I try to deploy the application through the console, it fails with the following exception:

       

      {code}

      16:55:28,218 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/web]] Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.springframework.faces.webflow.FlowApplicationFactory

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:214) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:200) [:1.2_15-20100816-SNAPSHOT]

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3369) [:6.0.0.Final]

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3828) [:6.0.0.Final]

              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:294) [:6.0.0.Final]

              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146) [:6.0.0.Final]

              at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:477) [:6.0.0.Final]

              at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.Final]

              at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.Final]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]

              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]

              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]

              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]

              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]

              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]

              at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) [:2.2.0.GA]

              at $Proxy41.start(Unknown Source)       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53) [:2.2.0.GA]

              at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41) [:2.2.0.GA]

              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301) [:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]

              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]

              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]

              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]

              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]

              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]

              at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]

              at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

              at org.jboss.profileservice.plugins.deploy.actions.DeploymentStartAction.doPrepare(DeploymentStartAction.java:98) [:0.2.2]

              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:101) [:0.2.2]

              at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]

              at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]

              at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]

              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]

              at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.startDeployments(AbstractDeployHandler.java:168) [:0.2.2]

              at org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.startDeployments(DeployHandlerDelegate.java:74) [:6.0.0.Final]

              at org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(DeployHandler.java:156) [:6.0.0.Final]

              at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898) [:6.0.0.Final]

              at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106) [:6.0.0.Final]

              at org.jboss.remoting.Client.invoke(Client.java:1961) [:6.0.0.Final]

              at org.jboss.remoting.Client.invoke(Client.java:804) [:6.0.0.Final]

              at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.invoke(StreamingDeploymentTarget.java:312) [:6.0.0.Final]

              at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.start(StreamingDeploymentTarget.java:197) [:6.0.0.Final]

              at org.jboss.profileservice.management.client.upload.DeploymentProgressImpl.start(DeploymentProgressImpl.java:232) [:6.0.0.Final]

              at org.jboss.profileservice.management.client.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:89) [:6.0.0.Final]

              at org.rhq.plugins.jbossas5.util.DeploymentUtils.run(DeploymentUtils.java:155)

              at org.rhq.plugins.jbossas5.util.DeploymentUtils.deployArchive(DeploymentUtils.java:116)

              at org.rhq.plugins.jbossas5.deploy.AbstractDeployer.deploy(AbstractDeployer.java:119)

              at org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate.createContentBasedResource(CreateChildResourceFacetDelegate.java:124)

              at org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate.createResource(CreateChildResourceFacetDelegate.java:56)

              at org.rhq.plugins.jbossas5.ApplicationServerComponent.createResource(ApplicationServerComponent.java:304)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]

              at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)

              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_21]

              at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_21]

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

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

              at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]

      Caused by: java.lang.InstantiationException: org.springframework.faces.webflow.FlowApplicationFactory

              at java.lang.Class.newInstance0(Class.java:340) [:1.6.0_21]

              at java.lang.Class.newInstance(Class.java:308) [:1.6.0_21]

              at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:537) [:1.2_15-20100816-SNAPSHOT]

              at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:386) [:1.2_15-20100816-SNAPSHOT]

              at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135) [:1.2_15-20100816-SNAPSHOT]

              at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717) [:1.2_15-20100816-SNAPSHOT]

              at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:187) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:204) [:1.2_15-20100816-SNAPSHOT]

              ... 88 more

      {code}

       

      I have already addressed numerous problems with provided project dependencies, xml and  tld validation etc. but I can't figure this one out.

       

      Can anyone point me in the right direction?

        • 1. JBoss AS 6, Spring Webflow
          nickarls

          Do you have any extra JSF api or lib jars in your deployment archive? If so, take them out.

          • 2. JBoss AS 6, Spring Webflow
            john.turner

            I have tried both with the JSF jars and without, setting the org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL and org.jboss.jbossfaces.JSF_CONFIG_NAME as appropriate.

            • 3. JBoss AS 6, Spring Webflow
              nickarls

              Give us a full dump of the application assembly (structure, libs, implied claspaths, EE descriptors etc)

              • 4. Re: JBoss AS 6, Spring Webflow
                john.turner

                Hi Nicklas,

                  I have provided a sanitised version of our war.  I suspect the problem is in the classpath.  I am using the 6.0.0.final distribution and the standard configuration.

                 

                  I had to split the files due to the size restrictions.

                 

                Thanks

                • 5. Re: JBoss AS 6, Spring Webflow
                  nickarls

                  ouch. that's some pile of libraries.Tried taking out jsf-facelets.jar?

                  • 6. Re: JBoss AS 6, Spring Webflow
                    john.turner

                    I think I did but I will confirm when I am back in the office on Monday.  Thanks for getting back to me.

                    • 7. Re: JBoss AS 6, Spring Webflow
                      john.turner

                      Just checked and the same error occurs

                      • 8. Re: JBoss AS 6, Spring Webflow
                        nickarls

                        Can you grab the JSF 1.2_15 sources and place a breakpoint in ConfigManager.initialize and have a closer look at how the application factories are chained and from which JARs they come?

                        • 9. Re: JBoss AS 6, Spring Webflow
                          john.turner

                          Ok.  I debugged the source and I'll try to explain what I am seeing.

                           

                          The FactoryFinder attempts to create the org.springframework.faces.webflow.FlowApplicationFactory which does not have a default constructor and hence the InstantiationException.

                           

                          org.springframework.faces.webflow.FlowApplicationFactory has a constructor that accepts a javax.faces.application.ApplicationFactory and so I suspect that it should not have been the first factory loaded.

                          • 10. JBoss AS 6, Spring Webflow
                            nickarls

                            That theory appear to be consistent with the stack trace (and the parameter would be logical if JSF chains the appliation factories). That's why it would be interesting to find if there are any other candidates for javax.faces.application.ApplicationFactory that might interfere.

                             

                            What JSF version in the AS is handling the application? Isn't 2.0 the default but still the stack trace speaks of 1.2. Have you set it explicitly?

                            • 11. JBoss AS 6, Spring Webflow
                              john.turner

                              I am specifying 1.2 via the context parameter

                               

                                  <context-param>

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

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

                                  </context-param>

                               

                              Of the jars in the classpath, only Spring-Faces defines an ApplicationFactory.  My expectation would be that the Mojarra ApplicationFactory would be created first, then the Spring-Faces ApplicationFactory would decorate this?