1 2 Previous Next 19 Replies Latest reply on Aug 6, 2009 1:59 AM by titou09 Go to original post
      • 15. Re: SEAM and WAS 7.0.0.3 - no combination for productive use !?
        cacheup

        in the persistence.xml I switched to (according to chapter 39 in 2.1.2 CR2):


        <property name="hibernate.transaction.manager_lookup_class" 
        
                  value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>



        result:
        no CWWJP0015E or CWWJP0009E Error messages any more.


        But I don't know how what to specify for:



        <persistence:managed-persistence-context name="entityManager" auto-create="true" ....../>



        the followoing:


        ... <persistence-unit-jndi-name="java:/websphere_exampleEntityManagerFactory"/>



        is not correct. As there's still an exception stating that no  can be found. It's JBoss specific.




        Does anybody know what to state here for WAS?


        Regards
        Oliver


        • 16. Re: SEAM and WAS 7.0.0.3 - no combination for productive use !?
          titou09

          I think in component.xml you should have something like this:


          <core:init jndi-pattern="java:comp/env/#{ejbName}" debug="true"/>
          
          <persistence:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{<choose a name here>}"/>
          <persistence:entity-manager-factory name="<same name as above>" persistence-unit-name="<name of your persistent unit as in persistence.xml here>" />
          



          Also did you follow instructions as stated in the link I mentioned previously? You should review also this thread which is mentioned in the previous thread and explain things about JNDI name resolutions in WAS (additions to web.xml, usage of @JndiName annotation, seam-jndi.properties file etc...)

          • 17. Re: SEAM and WAS 7.0.0.3 - no combination for productive use !?
            cacheup

            @Denis: many thanks for your help. With the settings of your last posting everything seems to work fine - no errors anymore. Contrary to you I don't have a JPA project and we use log4j - no commons logging ontop. The final question was, where to place the log4j.xml. The EJB-module seems to be the right place.
            One other problem was that the hibernate-validation.jar needs to be 3.1.0 which wasn't the case on me. The older version caused exceptions.
            I'll have to check the application in detail next week but I'm very confident that I'll get it right.


            Regards
            Oliver



            • 18. Re: SEAM and WAS 7.0.0.3 - no combination for productive use !?
              samuelesanvito

              Same problem but with Hibernate.


              my persistence.xml:



              <?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="sptweb">
                    <provider>org.hibernate.ejb.HibernatePersistence</provider>
                    <jta-data-source>java:comp/env/jdbc/sptwebDatasource</jta-data-source>
                    <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
                    <!--
                    <jar-file>../../vehicles.jar</jar-file>
                    -->
                    <properties>
                          <!--property name="transaction.flush_before_completion" value="true"/-->
                         <property name="connection.release_mode" value="after_statement"/>
                         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
                         <property name="transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
                         <property name="connection.datasource" value="java:/bookingDatasource"/>
                       <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
                       <!--property name="hibernate.hbm2ddl.auto" value="update"/-->
                       <property name="hibernate.show_sql" value="true"/>
                       <property name="hibernate.format_sql" value="true"/>
                       <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
                    </properties>
                 </persistence-unit>
                  
              </persistence>



              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:persistence="http://jboss.com/products/seam/persistence"
                          xmlns:security="http://jboss.com/products/seam/security"
                          xmlns:transaction="http://jboss.com/products/seam/transaction"
                          xmlns:web="http://jboss.com/products/seam/web"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          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/security http://jboss.com/products/seam/security-2.1.xsd 
                               http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd 
                               http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd 
                               http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
                   
                   <core:init jndi-pattern="java:comp/env/sptweb/#{ejbName}" debug="true"/>
                   <core:manager concurrent-request-timeout="500" conversation-timeout="120000" conversation-id-parameter="cid" parent-conversation-id-parameter="pid"/>
                   
                   <persistence:hibernate-session-factory name="sptwebSessionFactory"/>
                   <persistence:managed-hibernate-session name="sptwebDatabase" auto-create="true" session-factory-jndi-name="java:/sptwebSessionFactory"/>
                   
                   <!--transaction:ejb-transaction/-->
                   
                   <security:identity jaas-config-name="other"/>   
              
              </components>



              What's wrong?

              • 19. Re: SEAM and WAS 7.0.0.3 - no combination for productive use !?
                titou09

                Samuele, You have the same problem as...what problem in fact?


                FYI, I have committed a few days ago, a rework of the WebSphere v7.0 configuration chapter in the documentation and I also committed changes in the jpa and jee5/booking sample in order to just buid then deploy these sample applications on WAS v7.0.0.3+


                In the reworked chapter, I explain how to configure the JNDI components name and their binding in WAS, how to configure SFSB timeout etc...


                After being reviewed, this should (will) be in seam 2.2.1.


                If You have access to SVN you can download the code from the branches/community/Seam_2_2 seam branch and build seam or, considering that Seam v2.2.1 snapshot is still not yet downloadable, I could send you the pdf and the samples apps in a zip file as a non-official preview

                1 2 Previous Next