You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2007/05/23 22:29:21 UTC
svn commit: r541055 - in /myfaces/current/orchestra/core/src/site: site.xml
xdoc/alternative-configuration.xml
Author: werpu
Date: Wed May 23 13:29:20 2007
New Revision: 541055
URL: http://svn.apache.org/viewvc?view=rev&rev=541055
Log:
added a working and well tested tomcat configuration
Added:
myfaces/current/orchestra/core/src/site/xdoc/alternative-configuration.xml
Modified:
myfaces/current/orchestra/core/src/site/site.xml
Modified: myfaces/current/orchestra/core/src/site/site.xml
URL: http://svn.apache.org/viewvc/myfaces/current/orchestra/core/src/site/site.xml?view=diff&rev=541055&r1=541054&r2=541055
==============================================================================
--- myfaces/current/orchestra/core/src/site/site.xml (original)
+++ myfaces/current/orchestra/core/src/site/site.xml Wed May 23 13:29:20 2007
@@ -37,6 +37,7 @@
<menu name="MyFaces Orchestra">
<item name="About" href="about.html"/>
<item name="Installation" href="installation.html"/>
+ <item name="Alternative Configuration" href="alternative-configuration.html"/>
<item name="Management" href="conversationManagement.html"/>
<item name="Best Practice" href="bestPractice.html"/>
<item name="TODO" href="todo.html"/>
Added: myfaces/current/orchestra/core/src/site/xdoc/alternative-configuration.xml
URL: http://svn.apache.org/viewvc/myfaces/current/orchestra/core/src/site/xdoc/alternative-configuration.xml?view=auto&rev=541055
==============================================================================
--- myfaces/current/orchestra/core/src/site/xdoc/alternative-configuration.xml (added)
+++ myfaces/current/orchestra/core/src/site/xdoc/alternative-configuration.xml Wed May 23 13:29:20 2007
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//Apache Software Foundation//DTD XDOC 1.0//EN"
+ "http://www.apache.org/dtd/xdoc.dtd">
+<document>
+ <properties>
+ <title>Installation</title>
+ </properties>
+
+ <body>
+ <section name="Installation">
+ The following configuration provides a blueprint for
+ a single Tomcat installation using Spring 2.0, jpa ri
+ and runtime weaving.
+
+ <subsection name="Prerequisites">
+
+ <ul>
+ <li>Prerequisites - Knowledge: Basic Spring 2.0 configuration knowledge, knowledge about
+ the jpa ri, to the level that knowing what runtime weaving is can be assumed.
+ </li>
+ <li>Prerequisites - JDK Versions: JDK 5+ (on non Sun JDKs a working runtime weaving on 5
+ or a 6+ non Sun JDK)</li>
+ <li>Tomcat: 5.5+</li>
+ <li>Spring 2.x+</li>
+ </ul>
+ </subsection>
+ <subsection name="Spring configuration">
+ The following configuration uses runtime weaving, and
+ a connection pool. It should work on most Tomcat configurations.
+
+
+ <pre>
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:sa="https://spring-annotation.dev.java.net/context"
+
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
+ >
+
+ <tx:annotation-driven transaction-manager="transactionManager" />
+ <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+
+ <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
+ <property name="scopes">
+ <map>
+ <entry key="conversation">
+ <bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope">
+ <property name="advices">
+ <list>
+ <ref bean="persistentContextConversationInterceptor" />
+ </list>
+ </property>
+ </bean>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="thedataSource"
+ class="org.apache.commons.dbcp.BasicDataSource">
+
+ <property name="driverClassName" value="org.h2.Driver" />
+ <property name="url"
+ value="jdbc:h2:/DATA/dummydatabase;MODE=MYSQL" />
+
+ <property name="username" value="theusername" />
+ <property name="password" value="thepassword" />
+
+ <property name="initialSize">
+ <value>2</value>
+ </property>
+ <property name="maxActive">
+ <value>100</value>
+ </property>
+ <property name="maxIdle">
+ <value>2</value>
+ </property>
+ </bean>
+
+ <bean id="entityManagerFactory"
+ class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+
+ <property name="dataSource" ref="thedataSource" />
+ <property name="jpaDialect">
+ <bean class="org.springframework.orm.jpa.vendor.TopLinkJpaDialect" />
+ </property>
+ <property name="jpaVendorAdapter">
+ <bean
+ class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
+ <property name="showSql" value="false" />
+ <property name="generateDdl" value="true" />
+ <property name="databasePlatform" value="oracle.toplink.essentials.platform.database.MySQL4Platform" />
+ </bean>
+ </property>
+
+ <property name="jpaProperties">
+
+ <props>
+ <prop key="toplink.logging.level">INFO</prop>
+ <prop key="toplink.target-database">oracle.toplink.essentials.platform.database.MySQL4Platform</prop>
+ <prop key="toplink.ddl-generation">create-tables</prop>
+ <prop key="toplink.cache.type.default">HardWeak</prop>
+ <prop key="toplink.cache.size.default">5000</prop>
+ </props>
+ </property>
+ <property name="loadTimeWeaver">
+ <bean
+ class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
+ </property>
+ </bean>
+
+ <bean id="transactionManager"
+ class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory"
+ ref="entityManagerFactory" />
+
+ </bean>
+
+ <bean id="jpaPersistentContextFactory" class="org.apache.myfaces.orchestra.conversation.persistenceContexts.JpaPersistenceContextFactory">
+ <property name="entityManagerFactory" ref="entityManagerFactory" />
+ </bean>
+ <bean id="persistentContextConversationInterceptor" class="org.apache.myfaces.orchestra.conversation.spring.PersistenceContextConversationInterceptor">
+ <property name="persistenceContextFactory" ref="jpaPersistentContextFactory" />
+ </bean>
+
+</beans>
+ </pre>
+
+ This configuration enables load time weaving of the orm classes and thus allows
+ lazy instantiation of classes. The main issue with this configuration is, that
+ Tomcat still needs a javaagent passed down as parameter. If this is not done
+ the loadtime weaving ultimately will fail.
+ the required javaagent is:
+ <pre>
+-javaagent:<path to the spring weavers>/weavers/spring-agent.jar
+ </pre>
+ There are weaverless configurations as well, in spring 2.0.2 it was not yet possible to enable
+ them for jpa and Tomcat. This situation might change soon, please refer to the Spring documentation
+ for additional information on how to enable the loadtime weaving of jpa classes.
+
+ </subsection>
+ <subsection name="Key differences to the original configuration">
+ Following key differences can be found:
+ <ul>
+ <li> Load time weaving enabled via: <property name="loadTimeWeaver"> </li>
+ <li> A connection pool was used instead of a plain jdbc connection </li>
+ <li> Tomcat has to be started with an appropriate javaagent statement </li>
+ </ul>
+ </subsection>
+
+ </section>
+ </body>
+</document>
\ No newline at end of file