Tutorial error
dougorr May 19, 2006 9:01 AMI have successfully run the Registration example from the Seam download but I wanted to build my own copy by following the tutorial in the documentation. I want to use my own build.xml so that I am sure I understand what is required to deploy a Seam app.
The code compiles and appears to deploy properly but the JSP displays three "Conversion error" messages when I press the submit button. The log displays the following errors:
2006-05-19 07:00:23,459 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager 2006-05-19 07:00:23,459 DEBUG [org.jboss.seam.core.Manager] No stored conversation 2006-05-19 07:00:23,459 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init 2006-05-19 07:00:23,459 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] After restore view, conversation context: ConversationContext(2) 2006-05-19 07:00:23,469 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user 2006-05-19 07:00:23,469 DEBUG [org.jboss.seam.Component] seam component not found: user 2006-05-19 07:00:23,469 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name 2006-05-19 07:00:23,499 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user 2006-05-19 07:00:23,499 DEBUG [org.jboss.seam.Component] seam component not found: user 2006-05-19 07:00:23,499 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name 2006-05-19 07:00:23,499 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user 2006-05-19 07:00:23,499 DEBUG [org.jboss.seam.Component] seam component not found: user 2006-05-19 07:00:23,499 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name 2006-05-19 07:00:23,509 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] Before saving state 2006-05-19 07:00:23,509 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 2 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing business process context 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.BusinessProcessContext] no process instance to persist business process state 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context 2006-05-19 07:00:23,519 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
Here are my build.properties:
genasys.home = C:/com.genasys.codecontrol/ jboss.home = C:/jboss-4.0.3SP1/ myant.home = C:/apache-ant-1.6.1/ ant.libs = ${myant.home}lib/ant.jar commons.logging.home = ${jboss.home}lib/ utility.libs = ${genasys.home}common/web/utilities/ seam.home = C:/jboss-seam-1.0beta2/ seam.libs = ${seam.home}jboss-seam.jar:${seam.home}jboss-seam-ui.jar ui.libs = ${seam.home}lib/myfaces-impl.jar:${seam.home}lib/myfaces-api.jar jboss.server = ${jboss.home}server/all/ bussvc.libs = ${jboss.server}lib/javax.servlet.jar:${jboss.server}deploy/ejb3.deployer/jboss-ejb3.jar:${jboss.server}deploy/ejb3.deployer/jboss-ejb3x.jar:${jboss.server}deploy/ejb3.deployer/jboss-annotations-ejb3.jar:${jboss.server}deploy/ejb3.deployer/ejb3-persistence.jar:${jboss.server}deploy/ejb3.deployer/hibernate-annotations.jar log4j.home = ${jboss.server}lib/ log4j.libs = ${log4j.home}log4j.jar:${commons.logging.home}commons-logging.jar:${commons.logging.home}commons-logging-api.jar build.classpath = ${seam.libs}:${ui.libs}:${ant.libs}:${log4j.libs}:${bussvc.libs}
Here is my build.xml:
<project name="SEAMRegistration" default="deploy"> <!-- Load user environment parameters --> <!-- This should define the property build.classpath --> <property file="build.properties" /> <!-- Define our class path --> <path id="build.class.path"> <pathelement path="${build.classpath}"/> </path> <!-- ============================================================= --> <!-- Directory settings --> <!-- ============================================================= --> <!-- Physical source directories --> <property name="src.config.dir" value="src/config" /> <property name="src.ejb.dir" value="src/ejb" /> <property name="src.web.dir" value="src/web" /> <property name="src.webpages.dir" value="${src.web.dir}/genasys/pages/seam/registration" /> <property name="src.webconfig.dir" value="${src.config.dir}/web" /> <property name="src.ejbconfig.dir" value="${src.config.dir}/ejb" /> <!-- Setup directory structure --> <target name="init" depends="check-environment"> <tstamp/> <mkdir dir="dist"/> <mkdir dir="build"/> <mkdir dir="build/earstage"/> <mkdir dir="build/ejbstage/META-INF"/> </target> <!-- Set filename for default persistence.xml file --> <target name="noschema"> <property name="persistence.filename" value="persistence_with_validate.xml" /> </target> <!-- Set filename for new schema in persistence.xml file --> <target name="newschema"> <property name="persistence.filename" value="persistence_with_create.xml" /> </target> <!-- Remove directory structure structure --> <target name="clean" description="Removes all generated files"> <delete includeEmptyDirs="true" quiet="true"> <fileset dir="dist"/> <fileset dir="build"/> </delete> </target> <!-- ============================================================= --> <!-- Highlevel user tasks --> <!-- ============================================================= --> <target name="build" depends="init,jars" description="Builds ejb.jar and web.war"/> <target name="deploy" depends="noschema,build" description="Deploys generated ear in JBoss"> <copy todir="${jboss.server}deploy" > <fileset dir="dist/" includes="*.ear" /> </copy> </target> <target name="deploy-new-schema" depends="newschema,build" description="Deploys generated ear in JBoss"> <copy todir="${jboss.server}deploy" > <fileset dir="dist/" includes="*.ear" /> </copy> </target> <target name="deploy-ds" depends="build" description="Deploys only the data source to JBoss"> <copy todir="${jboss.server}deploy" > <fileset dir="dist/" includes="mysql-seam-registration-ds.xml" /> </copy> </target> <!-- ============================================================= --> <!-- Internal subtasks --> <!-- ============================================================= --> <!-- Compile all files --> <target name="compile" depends="init"> <!-- Compile EJB classes --> <javac destdir="build/ejbstage" includes="**/*.java" includeAntRuntime="false"> <src path="${src.ejb.dir}" /> <classpath> <path refid="build.class.path" /> </classpath> </javac> </target> <!-- Create the archive structures on disk, first --> <target name="copystages" depends="init,compile"> <!-- Copy the web pages and message resource file --> <copy todir="build/webstage/"> <fileset dir="${src.webpages.dir}" includes="**/*.jsp"/> </copy> <!-- Copy the web configuration files --> <copy todir="build/webstage/WEB-INF/"> <fileset dir="${src.webconfig.dir}" includes="*.xml"/> </copy> <!-- Copy the ejb configuration files --> <copy file="${src.ejbconfig.dir}/${persistence.filename}" tofile="build/ejbstage/META-INF/persistence.xml" overwrite="true"/> </target> <!-- Create the EJB jar, the web WAR and the application EAR --> <target name="jars" depends="copystages"> <!-- Put everything in build/ejbstage into seam-registration.jar. --> <jar jarfile="build/earstage/seam-registration.jar"> <fileset dir="build/utilities/" includes="**/*"/> <fileset dir="build/ejbstage/" includes="**/*"/> <manifest> <attribute name="Class-Path" value="jboss-seam.jar"/> </manifest> </jar> <!-- Put everything in build/webstage into seam-registration.war. --> <jar jarfile="build/earstage/seam-registration.war"> <fileset dir="build/webstage/" includes="**/*"/> <manifest> <attribute name="Class-Path" value="jboss-seam.jar"/> </manifest> </jar> <!-- Put application deployment descriptor in META-INF --> <copy todir="build/earstage/META-INF/"> <fileset dir="${src.config.dir}" includes="application.xml"/> <fileset dir="${src.config.dir}" includes="jboss-app.xml"/> </copy> <!-- Put everything in build/earstage into seam-registration.ear. --> <jar jarfile="dist/seam-registration.ear"> <fileset dir="${seam.home}" includes="jboss-seam.jar"/> <fileset dir="build/earstage/" includes="**/*"/> </jar> <!-- Put MySQL DataSource Descriptor into distribution directory --> <copy todir="dist/"> <fileset dir="${src.config.dir}" includes="mysql-seam-registration-ds.xml"/> </copy> </target> <target name="check-environment"> <antcall target="check-buildclasspath"/> <available property="ant.present" classname="org.apache.tools.ant.types.EnumeratedAttribute" classpathref="build.class.path" /> <antcall target="wrong-ant"/> <available property="log4j.present" classname="org.apache.log4j.Category" classpathref="build.class.path" /> <antcall target="wrong-log4j"/> <available property="j2ee.present" classname="javax.persistence.Entity" classpathref="build.class.path" /> <antcall target="wrong-j2ee"/> </target> <target name="check-buildclasspath" unless="build.classpath"> <fail> Property "build.classpath" is not set. Please use the file "build.properties" in the directory ${basedir} to set this property. It must list all external jars required for the build to succeed. "build.properties.sample" provides an example on how to set it up. </fail> </target> <target name="wrong-ant" unless="ant.present"> <fail> Property "build.classpath" is set but it doesn't seem to contain the ant jar. </fail> </target> <target name="wrong-log4j" unless="log4j.present"> <fail> Property "build.classpath" is set but it doesn't seem to contain the log4j jar. </fail> </target> <target name="wrong-j2ee" unless="j2ee.present"> <fail> Property "build.classpath" is set but it doesn't seem to contain the J2EE jars. </fail> </target> </project>
The .jar, .war, and .ear filese seem to be identical to those created by the example build.
Any suggestions to account for the error would be appreciated.
Doug Orr