5 Replies Latest reply on Feb 4, 2011 12:45 PM by monkeyden

    Seam 2.2.1 Final - Could not instantiate Seam component: org.jboss.seam.navigation.pages

    naveenm
      Hello,

      I'm using Seam 2.2.1 Final version along with richfaces.

      I'm getting the below exception:

      <Feb 4, 2011 9:41:12 AM EST> <Warning> <HTTP> <BEA-101162> <User defined listener org.jboss.seam.servlet.SeamListener failed: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.navigation.pages.
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.navigation.pages
           at org.jboss.seam.Component.newInstance(Component.java:2170)
           at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
           at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
           at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143)
           at org.jboss.seam.init.Initialization.init(Initialization.java:744)
           Truncated. see log file for complete stacktrace
      java.lang.RuntimeException: org.dom4j.DocumentException: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80' Nested exception: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80'
           at org.jboss.seam.navigation.Pages.getDocumentRoot(Pages.java:1092)
           at org.jboss.seam.navigation.Pages.parse(Pages.java:1014)
           at org.jboss.seam.navigation.Pages.initialize(Pages.java:141)
           at org.jboss.seam.navigation.Pages.create(Pages.java:111)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           Truncated. see log file for complete stacktrace
      org.dom4j.DocumentException: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80' Nested exception: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80'
           at org.dom4j.io.SAXReader.read(SAXReader.java:484)
           at org.dom4j.io.SAXReader.read(SAXReader.java:343)
           at org.jboss.seam.util.XML.getRootElement(XML.java:24)
           at org.jboss.seam.navigation.Pages.getDocumentRoot(Pages.java:1088)
           at org.jboss.seam.navigation.Pages.parse(Pages.java:1014)
           Truncated. see log file for complete stacktrace
      >
      <Feb 4, 2011 9:41:12 AM EST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application '_appsdir_OmgWebEAR_dir'.
      weblogic.application.ModuleException:
           at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:975)
           at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
           at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
           at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
           Truncated. see log file for complete stacktrace
      org.dom4j.DocumentException: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80' Nested exception: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80'
           at org.dom4j.io.SAXReader.read(SAXReader.java:484)
           at org.dom4j.io.SAXReader.read(SAXReader.java:343)
           at org.jboss.seam.util.XML.getRootElement(XML.java:24)
           at org.jboss.seam.navigation.Pages.getDocumentRoot(Pages.java:1088)
           at org.jboss.seam.navigation.Pages.parse(Pages.java:1014)
           Truncated. see log file for complete stacktrace
      >


      Here is my web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5"
                         xmlns="http://java.sun.com/xml/ns/javaee"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

           <context-param>
                <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                <param-value>com.sun.facelets.FaceletViewHandler</param-value>
           </context-param>

           <listener>
              <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
           </listener>

           <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
           </context-param>
            
           <context-param>
              <param-name>org.richfaces.SKIN</param-name>
              <param-value>blueSky</param-value>
           </context-param>
           
           <context-param>
                 <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                 <param-value>enable</param-value>
           </context-param>
           
           <filter>
              <display-name>RichFaces Filter</display-name>
              <filter-name>richfaces</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>
           </filter>
           
           <filter-mapping>
              <filter-name>richfaces</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>FORWARD</dispatcher>
              <dispatcher>INCLUDE</dispatcher>
           </filter-mapping>

           <!-- Seam -->

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

           <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>

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

           <filter-mapping>
                <filter-name>Seam Filter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>


           <!-- JSF -->

           <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</param-value>
           </context-param>

           <context-param>
                <param-name>facelets.DEVELOPMENT</param-name>
                <param-value>true</param-value>
           </context-param>

           <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>
           </servlet-mapping>
          
           <login-config>
                 <auth-method>BASIC</auth-method>
            </login-config>
          
      </web-app>


      Here is my components.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
           xmlns:core="http://jboss.com/products/seam/core"
           xmlns:drools="http://jboss.com/products/seam/drools"
           xmlns:web="http://jboss.com/products/seam/web"
           xmlns:security="http://jboss.com/products/seam/security"
           xmlns:framework="http://jboss.com/products/seam/framework"
           xmlns:mail="http://jboss.com/products/seam/mail"
           xmlns:pdf="http://jboss.com/products/seam/pdf"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
                      
                       
                  <web:exception-filter url-pattern="*.xhtml,*.seam"/>
       
                <component  class="com.MySeamWeb.Model.TestBean" name="testBean"/>


      </components>           

      Here is my faces-config.xml
      <?xml version="1.0" encoding="UTF-8"?>

      <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
          version="1.2">

      <!-- Defining Resource bundle -->
           <application>
                <message-bundle>messages</message-bundle>
                
                <locale-config>
                  <default-locale>en</default-locale>
                  <supported-locale>en-US</supported-locale>
                </locale-config>
           </application>
           
           <!-- Seam transaction management
           <lifecycle>
                <phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener</phase-listener>
           </lifecycle>     
           -->
           
           <!-- No Seam transaction management
           <lifecycle>
               <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
           </lifecycle>
           -->

      </faces-config>


      Here is my classpath:
           <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-beanutils.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-codec.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-collections.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-digester.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-httpclient.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-io.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-lang.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-logging.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/javassist.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-el.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-debug.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-excel.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-flex.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-ioc.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-jul.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-mail.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-pdf.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-remoting.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-resteasy.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-rss.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-ui.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-wicket-ant.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam-wicket.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-seam.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-vfs.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsf-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsf-facelets.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsf-impl.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsp-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/log4j.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/mail.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/richfaces-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/richfaces-impl.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/richfaces-ui.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/servlet-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/slf4j-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/slf4j-log4j12.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/dom4j.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/hibernate-validator.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/resteasy-jaxrs.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxrs-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/httpclient.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/httpcore.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/antlr-runtime.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/ant-antlr.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/antlr.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/activation.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/htmlparser.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jboss-system.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jcl-over-slf4j.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jcommon.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jms.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsr181-api.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jta.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jxl.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/lucene-core.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/resteasy-atom-provider.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/resteasy-jaxb-provider.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/resteasy-jettison-provider.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/cglib-nodep.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/concurrent.jar"/>
           <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/core.jar"/>


      Kindly help me!



                

        • 1. Re: Seam 2.2.1 Final - Could not instantiate Seam component: org.jboss.seam.navigation.pages
          monkeyden

          Looks like you have no pages.xml file.  Do you have one in:


          /WEB-INF/pages.xml
          


          in your deployment?

          • 2. Re: Seam 2.2.1 Final - Could not instantiate Seam component: org.jboss.seam.navigation.pages
            naveenm
            I do have pages.xml, here are the contents:

            pages.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE pages PUBLIC
                      "-//JBoss/Seam Pages Configuration DTD 2.2//EN"
                      "http://jboss.com/products/seam/pages-2.2.dtd">
                     
            <header name="Cache-Control">no-cache, no-store, max-age=0, must-revalidate</header>
                     
            <pages no-conversation-view-id="/pages/my_seam_test_page.xhtml">



                    <exception class="org.jboss.seam.framework.EntityNotFoundException">
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="warn">Record not found</message>
                            </redirect>
                    </exception>

                    <exception class="javax.persistence.EntityNotFoundException">
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="warn">Record not found</message>
                            </redirect>
                    </exception>

                    <exception class="javax.persistence.EntityExistsException">
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="warn">Duplicate record</message>
                            </redirect>
                    </exception>

                    <exception class="javax.persistence.OptimisticLockException">
                            <end-conversation />
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="warn">Another user changed the same data, please
                                            try again</message>
                            </redirect>
                    </exception>

                    <exception class="org.jboss.seam.security.AuthorizationException">
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="ERROR">You don't have permission to access this
                                            resource</message>
                            </redirect>
                    </exception>

                    <exception class="org.jboss.seam.security.NotLoggedInException">
                            <redirect view-id="/pages/login.xhtml">
                                    <message severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
                            </redirect>
                    </exception>

                    <exception class="javax.faces.application.ViewExpiredException">
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="warn">Your session has timed out, please try
                                            again</message>
                            </redirect>
                    </exception>

                    <exception class="org.jboss.seam.framework.EntityNotFoundException" log="false">
                    <http-error error-code="404"/>
                </exception>
                   
                    <exception class="org.jboss.seam.framework.EntityNotFoundException" log="false">
                    <http-error error-code="500"/>
                </exception>
               
                    <exception class="org.jboss.seam.ConcurrentRequestTimeoutException" log-level="trace">
                            <http-error error-code="503" />
                    </exception>

                    <exception>
                            <redirect view-id="/pages/Error.xhtml">
                                    <message severity="ERROR">Unexpected error, please try again</message>
                            </redirect>
                    </exception>
            </pages>
            • 3. Re: Seam 2.2.1 Final - Could not instantiate Seam component: org.jboss.seam.navigation.pages
              monkeyden

              FWIW, it looks like the Pages component isn't your only problem.  It doesn't appear to be able to validate by XML schema:


              java.lang.RuntimeException: org.dom4j.DocumentException: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80' Nested exception: Tried all: '1' addresses, but could not connect over HTTP to server: 'jboss.com', port: '80'
               at org.jboss.seam.navigation.Pages.getDocumentRoot(Pages.java:1092)
              



              Can you see this from your network:


              http://jboss.com/products/seam/pages-2.2.dtd
              



              If so, the problem could be a Weblogic setting.

              • 4. Re: Seam 2.2.1 Final - Could not instantiate Seam component: org.jboss.seam.navigation.pages
                naveenm

                Hello Kyle,


                You are right, that was the issue, I accidentally put dtd instead of xsd in the below url in the pages.xml which was causing this issue, I'm able to deploy the application fine now.
                http://jboss.com/products/seam/pages-2.2.xsd


                Thanks so much for your help and time.


                -Naveen

                • 5. Re: Seam 2.2.1 Final - Could not instantiate Seam component: org.jboss.seam.navigation.pages
                  monkeyden

                  As you can see from my post, I didn't notice the dtd either.   :) 


                  Happy it worked out for you.