9 Replies Latest reply on May 20, 2009 9:51 AM by Kamil Hadiyev

    java.lang.IllegalStateException after restarting Glassfish. Why?

    Kamil Hadiyev Newbie

      I use Glassfish like application server. I have web application with  more than 1 seam-war module in ear. In this case. At first I deploy my application. Second, I stop Glassfish. Third, I start it again. Forth, I lunch my application.
      Now, I have Exception:


      StandardWrapperValve(Utilis Faces Servlet): PWC1406: Servlet.service() for servlet Utilis Faces Servlet threw exception
      java.lang.IllegalStateException: No Manager could be created, make sure the Component exists in application scope
              at org.jboss.seam.core.Manager.instance(Manager.java:373)
              at org.jboss.seam.contexts.ServerConversationContext.getNamesForAllConversationsFromSession(ServerConversationContext.java:221)
              at org.jboss.seam.contexts.ServerConversationContext.unflush(ServerConversationContext.java:254)
              at org.jboss.seam.contexts.FacesLifecycle.beginExceptionRecovery(FacesLifecycle.java:118)
              at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:96)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:364)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:491)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
              at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
              at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
              at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)



      How to solve this problem, why my application do not invoke?

        • 1. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
          Arbi Sookazian Master
          No Manager could be created, make sure the Component exists in application scope at org.jboss.seam.core.Manager.instance



          Although I've never seen this exception, it sounds like a Seam config problem.


          check your components.xml to make sure it has something similar to this:


          <core:manager concurrent-request-timeout="3000" 
                           conversation-timeout="120000" 
                           conversation-id-parameter="cid"
                           parent-conversation-id-parameter="pid"/>



          and compare your entire components.xml with the one in booking app, for example, just to be sure everything else looks ok.

          • 2. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
            Kamil Hadiyev Newbie

            I have


            <core:manager conversation-timeout="1000000000" concurrent-request-timeout="10000"/>
            text in companents.xml.




            And Second thing, when I rebulid my application, it work.

            • 3. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
              Kamil Hadiyev Newbie

              When Glassfish started,
              I have Exeption with some models like this:


              WebModule[/home]PWC1275: Exception sending context initi 
              alized event to listener instance of class org.jboss.seam.servlet.SeamListener 
              java.lang.IllegalStateException: duplicate factory for: org.jboss.seam.web.webSe 
              ssion (duplicate is specified in components.xml) 
                      at org.jboss.seam.core.Init.checkDuplicateFactoryExpressions(Init.java:2 
              27) 
                      at org.jboss.seam.core.Init.checkDuplicateFactory(Init.java:220) 
                      at org.jboss.seam.core.Init.addFactoryValueExpression(Init.java:283) 
                      at org.jboss.seam.init.Initialization.installComponents(Initialization.j 
              ava:1128) 
                      at org.jboss.seam.init.Initialization.init(Initialization.java:728) 
                      at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.j 
              ava:35) 
                      at org.apache.catalina.core.StandardContext.listenerStart(StandardContex 
              t.java:4632) 
                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5 
              312) 
                      at com.sun.enterprise.web.WebModule.start(WebModule.java:353) 
                      at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:5 
              8) 
                      at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBas


              • 4. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
                Arbi Sookazian Master

                Do you have duplicates of this tag (or similar)?


                <!--  requestContextPath -->
                   <factory name="requestContextPath" value="#{facesContext.externalContext.requestContextPath}" />

                • 6. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
                  Kamil Hadiyev Newbie

                  This is companents.xml of main project


                  <components xmlns="http://jboss.com/products/seam/components"
                              xmlns:core="http://jboss.com/products/seam/core"
                              xmlns:tx="http://jboss.com/products/seam/transaction"
                              xmlns:framework="http://jboss.com/products/seam/framework"
                              xmlns:persistence="http://jboss.com/products/seam/persistence"
                              xmlns:web="http://jboss.com/products/seam/web"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                              xmlns:security="http://jboss.com/products/seam/security"
                              xmlns:international="http://jboss.com/products/seam/international"
                              xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                                   http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
                                   http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                                   http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.1.xsd
                                   http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                                   http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                                   http://jboss.com/products/seam/international http://jboss.com/products/seam/international-2.1.xsd
                                   http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd">
                  
                      <core:manager conversation-timeout="1000000000" concurrent-request-timeout="10000"/>
                      <core:init jndi-pattern="java:comp/env/#{ejbName}" transaction-management-enabled="false"/>
                  
                      <security:identity authenticate-method="#{loginBean.login}"/>
                  
                          <component class="rs.diving.ubcc.core.core.core.CoreFacadeFactoryBean" name="coreFacadeFactoryBean" scope="SESSION"
                                             auto-create="true"/>
                  
                      <!--<component class="rs.diving.ubcc.core.core.core.CoreSecurityFacadeBean" name="coreSecurityFacadeBean" scope="SESSION"-->
                                 <!--auto-create="true"/>-->
                  
                      <!--<component class="rs.diving.ubcc.core.core.core.CoreApplicationsFacadeBean" name="coreApplicationsFacadeBean"-->
                                 <!--scope="SESSION"-->
                                 <!--auto-create="true"/>-->
                  
                      <!--<component class="rs.diving.ubcc.core.ui.HomeBean"/>-->
                  
                      <!--<component class="rs.diving.ubcc.core.ui.MenuBean"/>-->
                  
                      <component class="rs.diving.ubcc.core.ui.LoginBean" installed="true"/>
                  
                      <component class="rs.diving.ubcc.core.ui.session.UtilisCoreSessionBean" installed="true"/>
                  
                  
                      <event type="org.jboss.seam.security.notLoggedIn">
                          <action execute="#{redirect.captureCurrentView}"/>
                      </event>
                  
                      <event type="org.jboss.seam.security.postAuthenticate">
                          <action execute="#{facesContext.application.navigationHandler.handleNavigation(facesContext, null,'/home.xhtml')}"/>
                      </event>
                  
                      <event type="org.jboss.seam.security.alreadyLoggedIn">
                          <action execute="#{facesContext.application.navigationHandler.handleNavigation(facesContext, null,'/home.xhtml')}"/>
                      </event>
                  
                      <event type="org.jboss.seam.utilis.core.logout">
                          <action execute="#{loginBean.logout}"/>
                      </event>
                  </components>




                  • 7. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
                    Kamil Hadiyev Newbie

                    This is components.xml of second module


                    <?xml version="1.0" encoding="UTF-8"?>
                    <components xmlns="http://jboss.com/products/seam/components"
                                xmlns:core="http://jboss.com/products/seam/core"
                                xmlns:framework="http://jboss.com/products/seam/framework"
                                xmlns:persistence="http://jboss.com/products/seam/persistence"
                                xmlns:web="http://jboss.com/products/seam/web"
                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xmlns:security="http://jboss.com/products/seam/security"
                                xmlns:tx="http://jboss.com/products/seam/transaction"
                                xmlns:international="http://jboss.com/products/seam/international"
                                xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                                     http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
                                     http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                                     http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.1.xsd
                                     http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                                     http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                                     http://jboss.com/products/seam/international http://jboss.com/products/seam/international-2.1.xsd
                                     http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd">
                    
                        <core:manager conversation-timeout="1000000000" concurrent-request-timeout="10000"/>
                        <core:init jndi-pattern="java:comp/env/#{ejbName}" transaction-management-enabled="false"/>
                    
                        <!--<core:init transaction-management-enabled="false"/>-->
                        <!--<tx:ejb-transaction/>-->
                    
                        <component class="rs.diving.ubcc.core.core.core.CoreFacadeFactoryBean"
                                   name="coreFacadeFactoryBean" scope="SESSION"
                                   auto-create="true"/>
                    
                        <!--<component class="rs.diving.ubcc.core.core.core.CoreSecurityFacadeBean" name="coreSecurityFacadeBean" scope="SESSION"-->
                                   <!--auto-create="true"/>-->
                    
                        <!--<component class="rs.diving.ubcc.core.core.core.CoreApplicationsFacadeBean" name="coreApplicationsFacadeBean"-->
                                   <!--scope="SESSION"-->
                                   <!--auto-create="true"/>-->
                    
                        <component class="rs.diving.ubcc.core.refbook.core.CoreRefBookFacadeBean" name="coreRefBookFacadeBean"
                                   scope="SESSION"
                                   auto-create="true"/>
                    
                        <security:identity authenticate-method="#{loginBean.login}"/>
                    
                        <component class="rs.diving.ubcc.core.refbook.ui.RefBookLoginBean" installed="true"/>
                    
                         <component class="rs.diving.ubcc.core.refbook.ui.session.RefBookSessionBean" installed="true"/>
                    
                        <!--<component class="rs.diving.ubcc.core.ui.MenuBean"/>-->
                    
                        <!--<component class="rs.diving.utilis.core.ui.session.UtilisCoreSessionBean"/>-->
                    
                    
                        <!--<component class="rs.diving.ubcc.core.rbuilder.ui.RBTemplatesTableBean"/>-->
                    
                        <!--<component class="rs.diving.ubcc.core.rbuilder.ui.session.RBTemplateEditSessionBean"/>-->
                    
                        <!--<component class="rs.diving.ubcc.core.rbuilder.ui.RBTemplateTreeBean"/>-->
                    
                        <!--<component class="rs.diving.ubcc.core.rbuilder.ui.RBTemplateDetailBean"/>-->
                    
                        <!--<component class="rs.diving.ubcc.core.rbuilder.ui.RBTemplateActionsBean"/>-->
                    
                        <!--<component class="rs.diving.ubcc.core.rbuilder.ui.session.RBTemplateDetailSessionBean"/>-->
                    
                         <!--This was missing-->
                         <!--<component class="rs.diving.ubcc.core.ui.HomeBean"/>-->
                    
                        <event type="org.jboss.seam.security.notLoggedIn">
                            <action execute="#{redirect.captureCurrentView}"/>
                        </event>
                    
                        <event type="org.jboss.seam.security.postAuthenticate">
                            <action execute="#{facesContext.application.navigationHandler.handleNavigation(facesContext, null,'/refbook.xhtml')}"/>
                        </event>
                    
                        <event type="org.jboss.seam.security.alreadyLoggedIn">
                            <action execute="#{facesContext.application.navigationHandler.handleNavigation(facesContext, null,'/refbook.xhtml')}"/>
                        </event>
                    
                        <event type="org.jboss.seam.utilis.core.logout">
                            <action execute="#{loginBean.logout}"/>
                        </event>
                    </components>


                                               

                    • 8. Re: java.lang.IllegalStateException after restarting Glassfish. Why?
                      Arbi Sookazian Master

                      With Seam apps, I have never deployed an EAR with two WARs in it.  I'm not sure if that's legal.  Someone else needs to chime in here...


                      What happens if you remove one of the WARs from the EAR and deploy?