0 Replies Latest reply on Nov 12, 2008 9:56 PM by Diana Gomez

    Seam on OC4J 10.1.3.4.0

    Diana Gomez Newbie

      Im trying to run Seam on OC4J 10.1.3.4.0

      In the browser appears the following message:

      500 Internal Server Error
      Servlet error: An exception occurred.
      The current application deployment descriptors do not allow for including it in this response.
      Please consult the application log for details.

      In the file aplication.log appears the following exception.


      08/11/12 09:38:39.234 oc4j_recursoshsh: Servlet error
      java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory:

      javax.faces.context.FacesContextFactory
              at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:263)
              at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpApplication.loadServlet(HttpApplication.java:2379)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpApplication.findServlet(HttpApplication.java:4830)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpApplication.findServlet(HttpApplication.java:4754)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)

      ].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2978)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)

      ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:738)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)

      ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)

      ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
              at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
              at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)

      ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
              at java.lang.Thread.run(Thread.java:595)



      My configuration is:

      The version of SEAM is 2.1.0Beta1
      I have the following libraries on the oc4j's directory j2ee/home/applib
      jbpm
      .jar
      jboss-el.jar
      drools-.jar
      janino
      .jar
      antlr-.jar
      mvel
      .jar
      richfaces-api.jar
      hibernate.jar
      hibernate-annotations.jar
      hibernate-commons-annotations.jar
      hibernate-entitymanager.jar
      hibernate-search.jar
      hibernate-validator.jar
      commons-logging.jar
      commons-collections.jar
      jboss-common-core.jar
      core.jar
      javassist.jar
      quartz.jar
      dbunit.jar
      jboss-embedded-api.jar
      dom4j.jar
      lucene-core.jar
      cglib.jar
      asm.jar
      commons-beanutils.jar
      commons-digester.jar
      commons-logging.jar
      commons-beanutils.jar
      concurrent.jar
      antlr.jar
      jsf-ri.jar
      jsf-impl.jar
      jsf-facelets.jar
      jsf-api.jar
      jboss-seam-ui.jar
      jboss-seam-debug.jar
      jboss-seam.jar
      jboss-el.jar
      jaxws-api.jar
      jaxrs-api.jar
      el-api.jar
      drools-compiler.jar
      classes12.zip
      adminclient.jar



      In the file build.xml: target ear


      <target name="ear" description="Build the EAR">
                      <copy todir="${ear.dir}">
                              <fileset dir="${basedir}/resources">
                                      <include name="*jpdl.xml" />
                                      <include name="*hibernate.cfg.xml" />
                                      <include name="jbpm.cfg.xml" />
                                              <include name="*.drl" />
                              </fileset>
                                      <fileset dir="${lib.dir}">
                                                      <include name="jboss-seam.jar" />
                                      </fileset>
                             
                                      <fileset dir="${basedir}">
                                              <include name="lib/jbpm*.jar" />
                                              <include name="lib/jboss-el.jar" />
                                              <include name="lib/drools-*.jar"/>
                                              <include name="lib/janino*.jar"/>
                                              <include name="lib/antlr-*.jar"/>
                                              <include name="lib/mvel*.jar"/>
                                              <include name="lib/richfaces-api.jar"/>
                                              <include name="lib/hibernate.jar"/>
                                              <include name="lib/hibernate-annotations.jar"/>
                                              <include name="lib/hibernate-commons-annotations.jar"/>
                                              <include name="lib/hibernate-entitymanager.jar"/>
                                              <include name="lib/hibernate-search.jar"/>
                                              <include name="lib/hibernate-validator.jar"/>
                                              <include name="lib/commons-logging.jar"/>
                                              <include name="lib/commons-collections.jar"/>
                                              <include name="lib/jboss-common-core.jar"/>
                                              <include name="lib/core.jar"/>
                                              <include name="lib/javassist.jar"/>
                                              <include name="lib/quartz.jar"/>
                                              <include name="lib/dbunit.jar"/>
                                              <include name="lib/jboss-embedded-api.jar"/>
                                              <include name="lib/dom4j.jar"/>
                                              <include name="lib/lucene-core.jar"/>
                                              <include name="lib/cglib.jar"/>
                                              <include name="lib/asm.jar"/>
                                              <include name="lib/commons-beanutils.jar"/>
                                              <include name="lib/commons-digester.jar"/>
                                              <include name="lib/concurrent.jar"/>
                                              <include name="lib/antlr.jar"/>
                                             
                                </fileset>
                       </copy>
                       <copy todir="${ear.dir}/lib">
                              <fileset dir="${lib.dir}">
                                      <includesfile name="deployed-jars-ear.list" />
                              </fileset>
                      </copy>
                              <copy todir="${ear.dir}/META-INF">
                                      <fileset dir="${basedir}/resources/META-INF">
                                              <include name="application.xml" />
                                              <include name="orion-application.xml"/>
                                              <include name="jboss-app.xml" />
                                      </fileset>                       
                                     
                              </copy>
              </target>


      In the file  resources/WEB-INF/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:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">


         <core:init debug="true" jndi-pattern="java:comp/env/oc4j_recursoshsh/#\{ejbName\}/local"/>
          
         <core:manager concurrent-request-timeout="500"
                       conversation-timeout="120000"
                       conversation-id-parameter="cid"
                       parent-conversation-id-parameter="pid"/>
        
         <transaction:ejb-transaction/>
                      
        
         <persistence:entity-manager-factory
                auto-create="true"
                name="oc4jEntityManagerFactory"
                persistence-unit-name="oc4j_recursoshsh" />      
               
                   
         
      <persistence:managed-persistence-context
                           name="entityManager"
                           auto-create="true"
                           entity-manager-factory="# {oc4jEntityManagerFactory}"/>                         

         <drools:rule-base name="securityRules">
            <drools:rule-files>
               <value>/security.drl</value>
            </drools:rule-files>
         </drools:rule-base>

         <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
        
         <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
        
         <event type="org.jboss.seam.security.notLoggedIn">
            <action execute="#{redirect.captureCurrentView}"/>
         </event>
         <event type="org.jboss.seam.security.loginSuccessful">
            <action execute="#{redirect.returnToCapturedView}"/>
         </event>
        
         <mail:mail-session host="localhost" port="2525" username="test" password="test" />
           
      </components>



      In the file  resources/WEB-INF/web.xml


      DisponibilidadBean is a Stateful EJB. Is owner


      <ejb-local-ref>
           <ejb-ref-name>
                oc4j_recursoshsh/DisponibilidadBean/local
           </ejb-ref-name>
           <ejb-ref-type>Session</ejb-ref-type>
           <local>
             com.heinsohn.recursoshsh.oc4j.Disponibilidad
           </local>
           <ejb-link>DisponibilidadBean</ejb-link>
        </ejb-local-ref> 
       
        <ejb-local-ref>
          <ejb-ref-name>oc4j_recursoshsh/EjbSynchronizations/local</ejb-ref-name> 
          <ejb-ref-type>Session</ejb-ref-type>
          <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
          <ejb-link>EjbSynchronizations</ejb-link>
        </ejb-local-ref>



      orion-aplication.xml



      <orion-application
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/
        orion-application-10_0.xsd"
        schema-major-version="10"
        schema-minor-version="0"
        component-classification="internal">
        <imported-shared-libraries>
          <remove-inherited name="oracle.xml"/>
        </imported-shared-libraries>
      </orion-application>


      persistence.xml


      The datasource have the ORACLE´s configuration


      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Persistence deployment descriptor for dev profile -->
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                   version="1.0">
                  
         <persistence-unit name="oc4j_recursoshsh">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>jdbc/oc4j_recursoshshDatasource</jta-data-source>
            <properties>
               <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
               <property name="hibernate.hbm2ddl.auto" value="update"/>
               <property name="hibernate.show_sql" value="true"/>
               <property name="hibernate.format_sql" value="true"/>
               <property name="hibernate.default_schema" value="recursoshsh"/>  
               <property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory" />
               <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.OrionTransactionManagerLookup" />
               <property name="hibernate.transaction.flush_before_completion" value="true"/>
               <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>     
              
            </properties>
         </persistence-unit>
         
      </persistence>




      orion-web.xml


       
      <orion-web-app>
          <web-app-class-loader search-local-classes-first="true"/>
        <web-app />
      </orion-web-app>