converting EAR to WAR and achieving incremental hot deploy for POJOs
asookazian Jul 17, 2009 11:26 PMConverted all SLSB/SFSB classes to JavaBeans. made changes to persistence.xml and components.xml. App deploys fine now as a WAR.
Am I supposed to see activity in the console when I run 'ant explode' for my newly converted WAR which was an EAR? Apparently, the app is being undeployed then re-deployed by JBoss when I run explode target.
I just cleared the console and ran 'ant explode' and I see this:
14:19:20,393 INFO [TomcatDeployer] undeploy, ctxPath=/ERS, warUrl=.../deploy/ERS.war/ 14:19:20,393 INFO [SessionFactoryImpl] closing 14:19:20,393 INFO [SessionFactoryImpl] closing 14:19:20,596 INFO [StaleObjectLogConfigurer] stale object exceptions will be hidden from logging 14:19:20,612 INFO [TomcatDeployer] deploy, ctxPath=/ERS, warUrl=.../deploy/ERS.war/ 14:19:23,392 INFO [ServletContextListener] Welcome to Seam 2.0.2-FP ... 14:19:34,218 INFO [SeamFilter] Initializing filter: org.jboss.seam.web.redirectFilter 14:19:34,218 INFO [SeamFilter] Initializing filter: org.jboss.seam.web.exceptionFilter 14:19:34,218 INFO [SeamFilter] Initializing filter: org.jboss.seam.web.multipartFilter 14:19:34,218 INFO [SeamFilter] Initializing filter: org.jboss.seam.debug.hotDeployFilter
Is this correct or should the incremental hot deploy behave the same as it did for facelets in my EAR project?
Here is my customized build.xml:
<target name="explode" depends="war,datasource,appconfig" description="Deploy the exploded archive"> <fail unless="jboss.home">jboss.home not set</fail> <echo message="war.action.dir = ${war.action.dir}"/> <mkdir dir="${war.deploy.dir}"/> <copy todir="${war.deploy.dir}"> <fileset dir="${war.dir}"/> </copy> </target>
<target name="war" depends="compilemodel,compileutil,compilews-client,compiledao,compileactions,copyclasses" description="Build the distribution .war file"> <copy todir="${war.dir}/WEB-INF/classes"> <fileset dir="${basedir}/resources"> <include name="seam.properties" /> <include name="*.drl" /> </fileset> </copy> <!-- using example from section 12.4.1 of Manning Ant book to copy and filter for param-value in web.xml: facelets.DEVELOPMENT=[true/false] --> <copy todir="${war.dir}/WEB-INF" file="${basedir}/resources/WEB-INF/web.xml" overwrite="yes"> <!-- filter token replace @facelets-debug@ in web.xml --> <filterset> <filter token="facelets-debug" value="${debug}"/> </filterset> </copy> <echo message="in debug/jndiPattern filterset: debug = ${debug}"/> <!-- asookazi: renaming persistence-${profile}-war.xml to persistence-${profile}.xml --> <copy tofile="${war.dir}/WEB-INF/classes/META-INF/persistence.xml" file="${basedir}/resources/META-INF/persistence-${profile}.xml" overwrite="true"/> <!-- <copy tofile="${war.dir}/WEB-INF/classes/import.sql" file="${basedir}/resources/import-${profile}.sql" overwrite="true"/> --> <copy todir="${war.dir}"> <fileset dir="${basedir}/view" /> </copy> <copy todir="${war.dir}/WEB-INF"> <fileset dir="${basedir}/resources/WEB-INF"> <include name="*.*"/> <include name="classes/**/*.*"/> <exclude name="classes/**/*.class"/> <exclude name="classes/**/*.groovy"/> </fileset> <filterset> <filter token="debug" value="${debug}" /> <filter token="jndiPattern" value="${project.name}/#{ejbName}/local"/> </filterset> </copy> <copy todir="${war.dir}/WEB-INF"> <fileset dir="${basedir}/resources/WEB-INF"> <include name="lib/*.*"/> <include name="classes/**/*.class"/> </fileset> </copy> <copy todir="${war.dir}/WEB-INF/lib"> <fileset dir="${lib.dir}"> <includesfile name="deployed-jars.list"/> <exclude name="jboss-seam-gen.jar"/> <include name="groovy-*.jar" if="groovy.present"/> </fileset> </copy> <copy todir="${war.dir}/WEB-INF/classes"> <fileset dir="${basedir}/resources"> <include name="messages*.properties"/> </fileset> </copy> <copy todir="${war.dir}/WEB-INF/classes"> <fileset dir="${basedir}/resources"> <include name="*jpdl.xml" /> <include name="*hibernate.cfg.xml" /> <include name="jbpm.cfg.xml" /> </fileset> </copy> </target>
<!-- customized --> <target name="compilews-client" depends="init" description="Compile the Java source code for ws-client" unless="eclipse.running"> <javac classpathref="build.classpath" destdir="${classes.model.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on"> <src path="${src.ws-client.dir}" /> </javac> </target> <!-- customized --> <target name="compileutil" depends="init" description="Compile the Java source code for utility classes" unless="eclipse.running"> <javac classpathref="build.classpath" destdir="${classes.model.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on"> <src path="${src.util.dir}" /> </javac> </target> <!-- customized --> <target name="compiledao" depends="init" description="Compile the Java source code for DAO classes" unless="eclipse.running"> <javac classpathref="build.classpath" destdir="${classes.model.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on"> <src path="${src.dao.dir}" /> </javac> </target> <target name="compilemodel" depends="init,groovy.compilemodel" description="Compile the Java source code" unless="eclipse.running"> <javac classpathref="build.classpath" destdir="${classes.model.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on"> <src path="${src.model.dir}" /> </javac> </target> <target name="groovy.compilemodel" if="groovy.present"> <!-- model is always compiled --> <groovyc classpathref="build.classpath" destdir="${classes.model.dir}" srcdir="${src.model.dir}" > </groovyc> </target> <target name="compileactions" depends="init,groovy.compileactions,groovy.copyactions" description="Compile the Java source code" unless="eclipse.running"> <echo message="src.action.dir = ${src.action.dir}"/> <echo message="classes.model.dir = ${classes.model.dir}"/> <javac classpathref="build.classpath" destdir="${classes.action.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on"> <classpath path="${classes.model.dir}"/> <src path="${src.action.dir}" /> </javac> </target>
I know that the restart target forces JBoss to undeploy/deploy the WAR/EAR but I am running explode target in this case, not restart.
Anybody know what I can do to fix this?