[seam-commits] Seam SVN: r9692 - in trunk/examples: spring and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Dec 1 20:00:41 EST 2008


Author: dan.j.allen
Date: 2008-12-01 20:00:41 -0500 (Mon, 01 Dec 2008)
New Revision: 9692

Added:
   trunk/examples/spring/resources/META-INF/persistence-spring.xml
Removed:
   trunk/examples/spring/resources/META-INF/persistence.xml
Modified:
   trunk/examples/build.xml
   trunk/examples/spring/build-jbosswar.xml
   trunk/examples/spring/build.xml
   trunk/examples/spring/resources/WEB-INF/applicationContext.xml
Log:
preliminary work for JBSEAM-3587

Modified: trunk/examples/build.xml
===================================================================
--- trunk/examples/build.xml	2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/build.xml	2008-12-02 01:00:41 UTC (rev 9692)
@@ -303,6 +303,12 @@
 		<include name="drools-compiler.jar" if="drools.lib" />
 	</fileset>
 
+	<!-- Dependencies for using Spring with Cglib -->
+	<fileset id="cglib.jar" dir="${lib.dir}">
+		<include name="asm.jar" if="cglib.lib"/>
+		<include name="cglib.jar" if="cglib.lib"/>
+	</fileset>
+
 	<!-- Dependencies for using Seam with JCaptcha -->
 	<fileset id="jcaptcha.jar" dir="${lib.dir}">
 		<include name="jcaptcha-all*.jar" if="jcaptcha.lib" />
@@ -665,6 +671,7 @@
 			<fileset refid="richfaces-api.jar" />
 			<fileset refid="ear.lib.extras" />
 			<fileset refid="jboss-el.jar" />
+			<fileset refid="cglib.jar" />
 			<fileset refid="drools.jar" />
 			<fileset refid="jbpm.jar" />
 			<fileset refid="cache.jar" />
@@ -816,6 +823,7 @@
 		<copy todir="${war.dir}/WEB-INF/lib">
 			<fileset refid="seam.jar" />
 			<fileset refid="tomcat.war.extras" />
+			<fileset refid="cglib.jar" />
 			<fileset refid="drools.jar" />
 			<fileset refid="cache.jar" />
 			<fileset refid="jbpm.jar" />
@@ -881,6 +889,7 @@
 		<copy todir="${war.dir}/WEB-INF/lib">
 			<fileset refid="seam.jar" />
 			<fileset refid="noejb.war.lib.extras" />
+			<fileset refid="cglib.jar" />
 			<fileset refid="drools.jar" />
 			<fileset refid="cache.jar" />
 			<fileset refid="jbpm.jar" />

Modified: trunk/examples/spring/build-jbosswar.xml
===================================================================
--- trunk/examples/spring/build-jbosswar.xml	2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/build-jbosswar.xml	2008-12-02 01:00:41 UTC (rev 9692)
@@ -20,7 +20,13 @@
 	<!-- needed because jboss must include hibernate search -->
 	<property name="search.lib"   value="true"/>
 	<property name="richfaces.lib" value="true"/>
+	<property name="cglib.lib" value="true"/>
 
     <import file="../build.xml"/>
+
+	<fileset id="noejb.jar.extras" dir="${resources.dir}">
+		<include name="META-INF/persistence-spring.xml"/>
+	</fileset>
+
 </project>
 

Modified: trunk/examples/spring/build.xml
===================================================================
--- trunk/examples/spring/build.xml	2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/build.xml	2008-12-02 01:00:41 UTC (rev 9692)
@@ -10,6 +10,8 @@
      	<ant antfile="build-jbosswar.xml" target="jbosswar.undeploy"/>
    </target>
 
+   <target name="jbosswar.redeploy" description="Rebuild and redeploy the Spring example from JBoss AS" depends="jbosswar.undeploy,clean,jbosswar"/>
+
    <target name="clean" description="Clean up the example">
      	<ant antfile="build-jbosswar.xml" target="clean" />
    </target>

Copied: trunk/examples/spring/resources/META-INF/persistence-spring.xml (from rev 9688, trunk/examples/spring/resources/META-INF/persistence.xml)
===================================================================
--- trunk/examples/spring/resources/META-INF/persistence-spring.xml	                        (rev 0)
+++ trunk/examples/spring/resources/META-INF/persistence-spring.xml	2008-12-02 01:00:41 UTC (rev 9692)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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="bookingDatabase" transaction-type="RESOURCE_LOCAL">
+        <provider>org.hibernate.ejb.HibernatePersistence</provider>
+        <properties>
+            <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+            <property name="hibernate.show_sql" value="true"/>
+            <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+            
+            <!-- Use these vendor-specific properties to setup JDBC connection instead of using Spring configuration -->
+            <!--
+            <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+            <property name="hibernate.connection.username" value="sa"/>
+            <property name="hibernate.connection.password" value=""/>
+            <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:defaultDB"/>
+            -->
+            </properties>
+    </persistence-unit>
+</persistence>


Property changes on: trunk/examples/spring/resources/META-INF/persistence-spring.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Deleted: trunk/examples/spring/resources/META-INF/persistence.xml
===================================================================
--- trunk/examples/spring/resources/META-INF/persistence.xml	2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/resources/META-INF/persistence.xml	2008-12-02 01:00:41 UTC (rev 9692)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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="bookingDatabase" transaction-type="RESOURCE_LOCAL">
-        <provider>org.hibernate.ejb.HibernatePersistence</provider>
-        <properties>
-            <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
-            <property name="hibernate.show_sql" value="true"/>
-            <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
-            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
-            
-            <!-- Enable these vendor-specific properties to setup JDBC connection here rather than in Spring configuration -->
-            <!--
-            <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
-            <property name="hibernate.connection.username" value="sa"/>
-            <property name="hibernate.connection.password" value=""/>
-            <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:defaultDB"/>
-            -->
-            </properties>
-    </persistence-unit>
-</persistence>

Modified: trunk/examples/spring/resources/WEB-INF/applicationContext.xml
===================================================================
--- trunk/examples/spring/resources/WEB-INF/applicationContext.xml	2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/resources/WEB-INF/applicationContext.xml	2008-12-02 01:00:41 UTC (rev 9692)
@@ -25,6 +25,8 @@
 	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
 		<property name="dataSource" ref="dataSource"/>
 		<property name="persistenceUnitName" value="bookingDatabase"/>
+		<!-- Use alternate location to prevent JBoss AS from automatically loading persistence units (in-container) -->
+		<property name="persistenceXmlLocation" value="classpath:META-INF/persistence-spring.xml"/>
 	</bean>
 
 	<!-- This example uses resource local JpaTransactionManager.  You could just as easily use a JtaTransactionManager -->




More information about the seam-commits mailing list