From 9dd07f05f39662a7c37dbaac26976b2481a63afd Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 25 Nov 2009 16:53:14 +0000 Subject: [PATCH] SPR-6447 + added basic files --- .classpath | 43 ++++++++++ .project | 36 +++++++++ petclinic.iml | 211 ++++++++++++++++++++++++++++++++++++++++++++++++++ readme.txt | 105 +++++++++++++++++++++++++ 4 files changed, 395 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 petclinic.iml create mode 100644 readme.txt diff --git a/.classpath b/.classpath new file mode 100644 index 000000000..b60cdffa6 --- /dev/null +++ b/.classpath @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 000000000..ee1dfb9be --- /dev/null +++ b/.project @@ -0,0 +1,36 @@ + + + petclinic-classic + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/petclinic.iml b/petclinic.iml new file mode 100644 index 000000000..134ccb632 --- /dev/null +++ b/petclinic.iml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jar://$IVY_CACHE$/org.apache.taglibs/com.springsource.org.apache.taglibs.standard/1.1.2/com.springsource.org.apache.taglibs.standard-1.1.2.jar!/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/readme.txt b/readme.txt new file mode 100644 index 000000000..aee19b7ff --- /dev/null +++ b/readme.txt @@ -0,0 +1,105 @@ +========================================================================== +=== Spring PetClinic Sample Application +========================================================================== + +@author Ken Krebs +@author Juergen Hoeller +@author Rob Harrop +@author Costin Leau +@author Sam Brannen +@author Scott Andrews + +========================================================================== +=== Data Access Strategies +========================================================================== + +PetClinic features alternative DAO implementations and application +configurations for JDBC, Hibernate, and JPA, with HSQLDB and MySQL as +target databases. The default PetClinic configuration is JDBC on HSQLDB. +See "src/main/resources/jdbc.properties" as well as web.xml and +applicationContext-*.xml in the "src/main/webapp/WEB-INF" folder for +details. A simple comment change in web.xml switches between the data +access strategies. + +The JDBC and Hibernate versions of PetClinic also demonstrate JMX support +via the use of for exporting MBeans. +SimpleJdbcClinic exposes the SimpleJdbcClinicMBean management interface +via JMX through the use of the @ManagedResource and @ManagedOperation +annotations; whereas, the HibernateStatistics service is exposed via JMX +through auto-detection of the service MBean. You can start up the JDK's +JConsole to manage the exported bean. + +All data access strategies can work with JTA for transaction management by +activating the JtaTransactionManager and a JndiObjectFactoryBean that +refers to a transactional container DataSource. The default for JDBC is +DataSourceTransactionManager; for Hibernate, HibernateTransactionManager; +for JPA, JpaTransactionManager. Those local strategies allow for working +with any locally defined DataSource. + +Note that the sample configurations for JDBC, Hibernate, and JPA configure +a BasicDataSource from the Apache Commons DBCP project for connection +pooling. + +========================================================================== +=== Build and Deployment +========================================================================== + +The Spring PetClinic sample application is built using Spring Build, which +is a custom build solution based on Ant and Ivy for dependency management. +For deployment, the web application needs to be built with Apache Ant 1.6 +or higher. When the project is first built, Spring Build will use Ivy to +automatically download all required dependencies. Thus the initial build +may take a few minutes depending on the speed of your Internet connection, +but subsequent builds will be much faster. + +Available build commands: + +- ant clean --> cleans the project +- ant clean test --> cleans the project and runs all tests +- ant clean jar --> cleans the project and builds the WAR + +After building the project with "ant clean jar", you will find the +resulting WAR file in the "target/artifacts" directory. By default, an +embedded HSQLDB instance in configured. No other steps are necessary to +get the data source up and running: you can simply deploy the built WAR +file directly to your Servlet container. + +For MySQL, you'll need to use the corresponding schema and SQL scripts in +the "db/mysql" subdirectory. Follow the steps outlined in +"db/mysql/petclinic_db_setup_mysql.txt" for explicit details. + +In you intend to use a local DataSource, the JDBC settings can be adapted +in "src/main/resources/jdbc.properties". To use a JTA DataSource, you need +to set up corresponding DataSources in your Java EE container. + +Notes on enabling Log4J: + - Log4J is disabled by default due to issues with JBoss. + - Uncomment the Log4J listener in "WEB-INF/web.xml" to enable logging. + +========================================================================== +=== JPA on Tomcat +========================================================================== + +This section provides tips on using the Java Persistence API (JPA) on +Apache Tomcat 4.x or higher with a persistence provider that requires +class instrumentation (such as TopLink Essentials). + +To use JPA class instrumentation, Tomcat has to be instructed to use a +custom class loader which supports instrumentation. See the JPA section of +the Spring reference manual for complete details. + +The basic steps are: + - Copy "org.springframework.instrument.tomcat-3.0.0.RELEASE.jar" from the + Spring distribution to "TOMCAT_HOME/server/lib". + - If you're running on Tomcat 5.x, modify "TOMCAT_HOME/conf/server.xml" + and add a new "" element for 'petclinic' (see below). You can + alternatively deploy the WAR including "META-INF/context.xml" from this + sample application's "src/main/webapp" directory, in which case you + will need to uncomment the Loader element in that file to enable the + use of the TomcatInstrumentableClassLoader. + + + + + ... +