7 Replies Latest reply on Apr 16, 2008 3:44 AM by Sei Syvalta

    Unable to create a new instance of 'org.ajax4jsf.application

    Sei Syvalta Newbie

      After upgrading to 3.2.0 from 3.1.4 I get the exception listed below. I'm using JSF RI 1.2_08 with Facelets. The app server is Websphere 6.1.0.13, using parent-last classloading. I know it's not in the list of supported app servers, but 3.1.4 worked on in so it would be nice to be able to use the latest version. Any suggestions? Unfortunately the real exception causing this isn't included, just the InvocationException.

      Source Document: wsjar:file:/C:/Program%20Files/IBM/WebSphere/AppServer/profiles/AppSrv02/installedApps/foo-pcNode02Cell/
      foo-ear.ear/foo-ui-1.0-SNAPSHOT.war/WEB-INF/lib/richfaces-impl-3.2.0.GA.jar!/META-INF/faces-config.xml
      Cause: Unable to create a new instance of 'org.ajax4jsf.application.AjaxStateManager': java.lang.reflect.InvocationTargetException
      at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:234)
      at com.sun.faces.config.processor.ApplicationConfigProcessor.setStateManager(ApplicationConfigProcessor.java:357)
      at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:233)
      at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:94)
      at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:119)
      at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:94)
      at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:202)
      ... 94 more

        • 1. Re: Unable to create a new instance of 'org.ajax4jsf.applica
          Sei Syvalta Newbie

          Has anyone been successful at running RF 3.2 at Webshpehere 6.1?

          • 2. Re: Unable to create a new instance of 'org.ajax4jsf.applica
            Sei Syvalta Newbie

            Actually, I have the same error also in Tomcat 5.5.23. Downgrading to 3.1.4 solves the problem in both platforms. Hope to have some time to investigate more.

            • 3. Re: Unable to create a new instance of 'org.ajax4jsf.applica
              Sergey Smirnov Master

              We cannot reproduce this problem based on information you provided.

              • 4. Re: Unable to create a new instance of 'org.ajax4jsf.applica
                Ivan Elistratov Newbie

                I have the same problem on IBM WebSphere 6.1.0.13. This is my stack trace:

                [11.04.08 14:46:12:996 MSD] 00000021 WebApp E Exception caught while initializing context
                com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
                 Source Document: wsjar:file:/D:/WebSphere/AppServer/profiles/AppSrv01/installedApps/eppw506Node01Cell/sono-web.ear/sono-web-1.0-SNAPSHOT.war/WEB-INF/lib/richfaces-impl-3.2.0.GA.jar!/META-INF/faces-config.xml
                 Cause: Unable to create a new instance of 'org.ajax4jsf.application.AjaxStateManager': java.lang.reflect.InvocationTargetException
                 at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:212)
                 at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:174)
                 at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:906)
                 at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:298)
                 at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:334)
                 at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)
                 at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
                 at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)
                 at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)
                 at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)
                 at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)
                 at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1302)
                 at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)
                 at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)
                 at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)
                 at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:951)
                 at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1493)
                 at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4030)
                 at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4128)
                 at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
                 at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1498)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                 at java.lang.reflect.Method.invoke(Method.java:618)
                 at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:62)
                 at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                 at java.lang.reflect.Method.invoke(Method.java:618)
                 at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:265)
                 at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1089)
                 at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:971)
                 at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
                 at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
                 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
                 at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
                 at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1080)
                 at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
                 at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:973)
                 at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
                 at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:239)
                 at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:536)
                 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
                 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
                 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
                 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                 at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:990)
                 at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:931)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:768)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:676)
                 at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:499)
                 at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473)
                 at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
                 at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1070)
                 at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:273)
                 at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
                 at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:319)
                 at com.ibm.isclite.container.controller.InformationController.processForwardConfig(InformationController.java:206)
                 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
                 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
                 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                 at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:990)
                 at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:931)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
                 at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistence(WSCUrlFilter.java:792)
                 at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:363)
                 at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:229)
                 at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:768)
                 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:676)
                 at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:499)
                 at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473)
                 at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
                 at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
                 at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
                 at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
                 at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
                 at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
                 at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
                 at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
                 at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
                 at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
                 at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
                 at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
                 at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
                 at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
                 at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
                Caused by: com.sun.faces.config.ConfigurationException:
                 Source Document: wsjar:file:/D:/WebSphere/AppServer/profiles/AppSrv01/installedApps/eppw506Node01Cell/sono-web.ear/sono-web-1.0-SNAPSHOT.war/WEB-INF/lib/richfaces-impl-3.2.0.GA.jar!/META-INF/faces-config.xml
                 Cause: Unable to create a new instance of 'org.ajax4jsf.application.AjaxStateManager': java.lang.reflect.InvocationTargetException
                 at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:234)
                 at com.sun.faces.config.processor.ApplicationConfigProcessor.setStateManager(ApplicationConfigProcessor.java:357)
                 at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:233)
                 at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:94)
                 at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:119)
                 at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:94)
                 at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
                 at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:202)
                 ... 94 more


                • 5. Re: Unable to create a new instance of 'org.ajax4jsf.applica
                  Sei Syvalta Newbie

                  I submitted an issue against Mojarra for losing the stack trace information:
                  https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=731

                  • 6. Re: Unable to create a new instance of 'org.ajax4jsf.applica
                    Sei Syvalta Newbie

                    Ok, had some time to do some debugging. The cause is that Richfaces depends on commons-collections 3.2 (LazyMap), but due to some maven bug commons-collections 2.1.1 was included in my build.

                    Example of dependency:tree in my build:

                     +- org.richfaces.ui:richfaces-ui:jar:3.2.0.SR1:compile
                     | \- org.richfaces.framework:richfaces-impl:jar:3.2.0.SR1:compile
                     | +- commons-digester:commons-digester:jar:1.8:compile
                     | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
                     | \- org.richfaces.framework:richfaces-api:jar:3.2.0.SR1:compile

                    Same for simple test build:
                     \- org.richfaces.ui:richfaces-ui:jar:3.2.0.SR1:compile
                     \- org.richfaces.framework:richfaces-impl:jar:3.2.0.SR1:compile
                     +- commons-digester:commons-digester:jar:1.8:compile
                     | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
                     +- org.richfaces.framework:richfaces-api:jar:3.2.0.SR1:compile
                     | \- commons-collections:commons-collections:jar:3.2:compile
                     \- commons-logging:commons-logging:jar:1.0.4:compile
                    


                    I'm using Hibernate which has dependency to collections 2.1.1, and for some reason maven chooses to use that version.

                    So a workaround is to add implicit dependency to commons-collections 3.2.


                    • 7. Re: Unable to create a new instance of 'org.ajax4jsf.applica
                      Sei Syvalta Newbie

                      http://jira.codehaus.org/browse/MNG-612

                      org.richfaces.framework:richfaces-api:jar:3.2.0.SR1:compile (selected for compile)
                      commons-collections:commons-collections:jar:3.2:compile (removed - nearer found: 2.1.1)
                      


                      So maven chooses "nearest" match, which is wrong in this case.