Thursday, 3 November 2011

Comparison of weblogic 9.x and 10.x



39.3.2. What's different with Weblogic 10.x

  • Between the the Weblogic 10.x and 9.2 examples there are several differences:
    • META-INF/persistence.xml — The 9.2 version is configured to use the PointBase database and a pre-installed datasource. The 10.x version uses the hsql database and a custom datasource.
    • WEB-INF/weblogic.xml — This file and its contents solve an issue with an older version of the ANTLR libraries that Weblogic 10.x uses internally. OC4J have the same issue as well. It also configures the application to use the shared JSF libraries that were installed above.


    • <?xml version="1.0" encoding="UTF-8"?>

    • <weblogic-web-app

    • xmlns="http://www.bea.com/ns/weblogic/90"

    • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    • xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 

    •                     http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">

    •    <library-ref>

    •       <library-name>jsf</library-name>

    •       <specification-version>1.2</specification-version>

    •       <implementation-version>1.2</implementation-version>

    •       <exact-match>false</exact-match>

    •    </library-ref>

    •    <container-descriptor>

    •       <prefer-web-inf-classes>true</prefer-web-inf-classes>

    •    </container-descriptor>

    • </weblogic-web-app>

This make Weblogic use classes and libraries in the web application before other libraries in the classpath. Without this change hibernate is required to use a older, slower query factory by setting the following property in the META-INF/persistence.xml file.



<property name="hibernate.query.factory_class" 

      value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>

                        

    • WEB-INF/components.xml — In the Weblogic 10.x version JPA entity transactions is enabled by adding:
    •  


    •  <transaction:entity-transaction entity-manager="#{em}"/>

    • WEB-INF/web.xml — Because the jsf-impl.jar is not in the WAR this listener need to be configured :
    •  


    •  <listener>

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

    •  </listener>

  • Between the Weblogic 10.x version and the JBoss version there are more changes. Here is the rundown:
    • META-INF/persistence.xml — Except for datasource name the Weblogic version sets:
    •  


    • <property name="hibernate.transaction.manager_lookup_class" 

    •    value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>

    •                            

    • WEB-INF/lib — The Weblogic version requires several library packages because they are not included as they are with JBoss AS. These are primarily for hibernate, and its dependencies.
      • To use Hibernate as your JPA provider you need the following jars:
        • hibernate.jar
        • hibernate-annotations.jar
        • hibernate-entitymanager.jar
        • hibernate-validator.jar
        • jboss-common-core.jar
        • commons-logging.jar
        • commons-collections.jar
        • jboss-common-core.jar
      • Various third party jars that Weblogic needs:
        • antlr.jar
        • cglib.jar
        • asm.jar
        • dom4j.jar
        • el-ri.jar
        • javassist.jar
        • concurrent.jar

No comments:

Post a Comment