[jboss-cvs] jboss-seam/examples/jee5 ...
Peter Muir
peter at bleepbleep.org.uk
Sat Jun 23 14:33:59 EDT 2007
User: pmuir
Date: 07/06/23 14:33:59
Added: examples/jee5 readme-oc4j.txt build.xml
readme-glassfish.txt
Log:
JBSEAM-1449 - rename glassfish to jee5 and add support for OC4J (thanks to Richard Hoffman for this!)
Revision Changes Path
1.1 date: 2007/06/23 18:33:59; author: pmuir; state: Exp;jboss-seam/examples/jee5/readme-oc4j.txt
Index: readme-oc4j.txt
===================================================================
0. Build the demo app: ant clean; ant oc4j - the build target is "build/jboss-seam-oc4j.ear"
1. Download OC4J 11g Technology Preview from here
http://www.oracle.com/technology/tech/java/oc4j/11/index.html
2. Unzip the downloaded file
3. Make sure you have $JAVA_HOME and $ORACLE_HOME set as environment variables ($ORACLE_HOME is the
directory to which you unzip OC4J)
For further information on installing OC4J, consult the Readme.txt distributed with OC4J
4. Edit the OC4J datasource $ORACLE_HOME/j2ee/home/config/data-sources.xml and, inside <data-sources>,
add
<managed-data-source
connection-pool-name="jee5-connection-pool"
jndi-name="jdbc/__default"
name="jee5-managed-data-source"
/>
<connection-pool name="jee5-connection-pool">
<connection-factory
factory-class="org.hsqldb.jdbcDriver"
user="sa"
password="" url="jdbc:hsqldb:."
/>
</connection-pool>
5. Edit $ORACLE_HOME/j2ee/home/config/server.xml and, inside <application-server>, add
<application
name="jboss-seam-jee5"
path="../../home/applications/jboss-seam-jee5.ear"
parent="default"
start="true"
/>
6. Edit $ORACLE_HOME/j2ee/home/config/default-web-site.xml, and, inside <web-site>, add
<web-app
application="jboss-seam-jee5"
name="jboss-seam-jee5"
load-on-startup="true"
root="/seam-jee5"
/>
7. Copy hsqldb.jar to OC4J: cp ../../seam-gen/lib/hsqldb.jar $ORACLE_HOME/j2ee/home/applib/
8. Copy the application to OC4J: cp build/jboss-seam-jee5.ear $ORACLE_HOME/j2ee/home/applications/
9. Start OC4J: $ORACLE_HOME/bin/oc4j -start
a. You will be asked to set the admin password if this is the first time you've started OC4J
b. You may get an ClassNotFoundException relating to org.jboss.logging.util.OnlyOnceErrorHandler,
this doesn't impact on the running of the app. We are working to get rid of this error!
10. Checout the app at: http://localhost:8888/seam-jee5
11. You can stop the server by pressing CTRL-c in the console on which the server is running.
Workarounds
------------
* Set hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory in
persistence.xml - OC4J uses an incompatible (old) version of antlr in toplink which causes
hibernate to throw an exception (discussed here for Weblogic, but the same applies to OC4J -
http://hibernate.org/250.html#A23). You can also work around this by putting the hibernate
jars in $ORACLE_HOME/j2ee/home/applib/
1.1 date: 2007/06/23 18:33:59; author: pmuir; state: Exp;jboss-seam/examples/jee5/build.xml
Index: build.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="JEE5 Booking" basedir=".">
<description>JEE5 Booking</description>
<property name="projname" value="jboss-seam-jee5" />
<property name="seam.home" value="../../" />
<property file="../../build.properties" />
<property name="lib" location="../../lib" />
<property name="seamlib" location="../../" />
<property name="hibernatelib" location="../../hibernate/lib" />
<path id="lib.classpath">
<fileset dir="${lib}" includes="*.jar" />
<fileset dir="${seamlib}" includes="*.jar" />
</path>
<property name="resources" location="resources" />
<property name="src" location="src" />
<property name="view" location="view" />
<property name="build.classes" location="build/classes" />
<property name="build.jars" location="build/" />
<target name="clean" description="Clean up the build files">
<delete dir="build" />
</target>
<target name="glassfish" depends="ejb3-glassfish,war-glassfish,ear" description="Build the ear for glassfish" />
<target name="oc4j" depends="ejb3-oc4j,war-oc4j,ear-oc4j" description="Build the ear for OC4J" />
<target name="glassfish-toplink" depends="ejb3-toplink,war-glassfish,ear" description="Build the ear for glassfish, using TopLink as the JPA provider" />
<target name="compile">
<mkdir dir="${build.classes}" />
<javac destdir="${build.classes}" classpathref="lib.classpath" debug="true">
<src path="${src}" />
</javac>
</target>
<target name="ejb3-glassfish" depends="compile">
<mkdir dir="${build.jars}" />
<jar destfile="${build.jars}/${projname}.jar">
<fileset dir="${build.classes}">
<include name="**/*.class" />
</fileset>
<fileset dir="${resources}">
<include name="seam.properties" />
<include name="log4j.xml" />
<include name="import.sql" />
</fileset>
<metainf dir="${resources}/META-INF/">
<include name="ejb-jar.xml" />
</metainf>
<metainf dir="${resources}/glassfish">
<include name="persistence.xml" />
</metainf>
</jar>
</target>
<target name="ejb3-oc4j" depends="compile">
<mkdir dir="${build.jars}" />
<jar destfile="${build.jars}/${projname}.jar">
<fileset dir="${build.classes}">
<include name="**/*.class" />
</fileset>
<fileset dir="${resources}">
<include name="seam.properties" />
<include name="log4j.xml" />
<include name="import.sql" />
</fileset>
<metainf dir="${resources}/META-INF/">
<include name="ejb-jar.xml" />
</metainf>
<metainf dir="${resources}/oc4j">
<include name="persistence.xml" />
</metainf>
</jar>
</target>
<target name="ejb3-toplink" depends="compile">
<mkdir dir="${build.jars}" />
<jar destfile="${build.jars}/${projname}.jar">
<fileset dir="${build.classes}">
<include name="**/*.class" />
</fileset>
<fileset dir="${resources}">
<include name="seam.properties" />
<include name="import.sql" />
</fileset>
<metainf dir="${resources}/META-INF/">
<include name="ejb-jar.xml" />
</metainf>
<metainf dir="${resources}/toplink/">
<include name="persistence.xml" />
</metainf>
</jar>
</target>
<target name="war-glassfish" depends="compile">
<mkdir dir="${build.jars}" />
<war destfile="${build.jars}/${projname}.war" webxml="${resources}/WEB-INF/web.xml">
<webinf dir="${resources}/WEB-INF/">
<include name="faces-config.xml" />
<include name="pages.xml" />
<include name="components.xml" />
</webinf>
<lib dir="${lib}">
<include name="jsf-facelets.jar" />
<include name="ajax4jsf*.jar" />
<include name="oscache*.jar" />
</lib>
<lib dir="${seamlib}">
<include name="jboss-seam-ui.jar" />
<include name="jboss-seam-debug.jar" />
</lib>
<fileset dir="${view}" />
</war>
</target>
<target name="war-oc4j" depends="compile">
<mkdir dir="${build.jars}" />
<war destfile="${build.jars}/${projname}.war" webxml="${resources}/oc4j/web.xml">
<webinf dir="${resources}/WEB-INF/">
<include name="faces-config.xml" />
<include name="pages.xml" />
<include name="components.xml" />
</webinf>
<lib dir="${lib}">
<include name="jsf-facelets.jar" />
<include name="ajax4jsf*.jar" />
<include name="oscache*.jar" />
</lib>
<lib dir="${seamlib}">
<include name="jboss-seam-ui.jar" />
<include name="jboss-seam-debug.jar" />
</lib>
<fileset dir="${view}" />
</war>
</target>
<target name="ear">
<mkdir dir="${build.jars}" />
<mkdir dir="${build.jars}/lib" />
<copy todir="${build.jars}/lib">
<fileset dir="${lib}">
<include name="thirdparty-all.jar" />
<include name="commons-digester-*.jar" />
<include name="commons-beanutils-*.jar" />
<include name="jboss-el.jar" />
</fileset>
<fileset dir="${hibernatelib}">
<include name="hibernate*.jar" />
<include name="jboss-common.jar" />
</fileset>
</copy>
<ear destfile="${build.jars}/${projname}.ear" appxml="${resources}/META-INF/application.xml">
<fileset dir="${seamlib}">
<include name="jboss-seam.jar" />
</fileset>
<fileset dir="${build.jars}">
<include name="${projname}.jar" />
<include name="${projname}.war" />
<include name="lib/*.jar" />
</fileset>
</ear>
</target>
<target name="ear-oc4j">
<mkdir dir="${build.jars}" />
<mkdir dir="${build.jars}/lib" />
<copy todir="${build.jars}/lib">
<fileset dir="${lib}">
<include name="thirdparty-all.jar" />
<include name="commons-digester-*.jar" />
<include name="commons-beanutils-*.jar" />
<include name="jboss-el.jar" />
<include name="antlr-*.jar"/>
<include name="jbpm-*.jar"/>
</fileset>
<fileset dir="${hibernatelib}">
<include name="hibernate*.jar" />
<include name="jboss-common.jar" />
</fileset>
</copy>
<ear destfile="${build.jars}/${projname}.ear" appxml="${resources}/META-INF/application.xml">
<fileset dir="${build.jars}">
<include name="${projname}.jar" />
<include name="${projname}.war" />
<include name="lib/*.jar" />
</fileset>
<fileset dir="${seamlib}">
<include name="jboss-seam.jar" />
</fileset>
<metainf dir="${resources}/oc4j">
<!--<include name="orion-application.xml"/>-->
</metainf>
</ear>
</target>
</project>
1.1 date: 2007/06/23 18:33:59; author: pmuir; state: Exp;jboss-seam/examples/jee5/readme-glassfish.txt
Index: readme-glassfish.txt
===================================================================
0. Build the demo app: ant clean; ant glassfish
0a. The build target is "build/jboss-seam-jee5.ear"
0b. The "ant glassfish-toplink" target builds the EAR file using TopLink as the JPA provider.
You will need to manually load the database. Not recommended.
1. Download Glassfish v2 -b52 or above (b52 is one of the promoted builds which have based basic QA)
2. Install it: java -Xmx256m -jar glassfish-installer-xxx.jar
3. Setup glassfish: cd glassfish; ant -f setup.xml;
4. Start the Glassfish server: bin/asadmin start-domain domain1
5. Start the embedded JavaDB: bin/asadmin start-database
6. Load the admin console: http://localhost:4848/
7. Login using username/password: admin / adminadmin
8. Deploy the "enterprise application" in the admin console:
The app is located at SEAM_HOME/examples/jee5/build/jboss-seam-jee5.ear
9. Checkout the app at: http://localhost:8080/seam-jee5/
10. Stop the server and database: bin/asadmin stop-domain domain1; bin/asadmin stop-database
More information about the jboss-cvs-commits
mailing list