[JBoss Seam] - Re: HowTo: When going to a page to enter data, pull from db
by petemuir
"CptnKirk" wrote : @Unwrap - Method called on a component that allows the component to manage the creation of a contextual variable. So Component ActivityManager might have an @Unwrap method that puts an Activity into scope referenceable by the EL #{activity}. This method will be called every time the #{activity} variable is referenced or injected into a bean. Because the @Unwrap annotation is on a method within a Seam Component, the component can take advantage of the entire Seam life cycle, including providing tear down logic.
@Unwrap is most useful for exposing a non-Seam service (e.g. a JavaMail Session) as a Seam component. Its unlikely you want to use it in your app (unless you are providing scafolding), @Factory is the one to use.
anonymous wrote : EntityHome - These are classes the provide generic DAO capabilities to objects. By using an EntityHome you can Create, Update, Delete a single entity via its primary key. In order to Update or Delete with an EntityHome you must pass the ID of the object to the EntityHome prior to calling update or remove.
Reading (quickly) the thread, I would suggest taking time to understand the Seam Application Framework as it sounds like you are trying to standard CRUD which it supports ootb. The seamdiscs example is a good example of an app built using the framework (if you can put up with the trinidad and richfaces visual components)
anonymous wrote : EJB3 Entity Beans - Seam components that are EJB3 Entity Beans are automatically registered as event scoped components. They have an implicit auto-create when used with JSF pages. So you could @Name("activity") your Activity EJB3 entity bean. And reference it in your JSF page as #{activity}. Seam will call the default constructor and you'll be able to use EL to set values and can inject @In("activity") into the controller that deals with the form action. Beans can have multiple names, and multiple scopes. Read more about the @Role/@Roles annotation for more information.
Not quite, they are only components if the have @Name (in which case they would be CONVERSATION scoped). The "preferred" way to do this is to use Home objects to manage an Entity, rather than expose it directly with @Name, and uses pages.xml for wiring. We could probably do with an example app built using Seam-gen that does a couple of simple CRUD operations
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039522#4039522
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039522
19 years
[JBoss Seam] - Building the correct WARs for Tomcat
by tim_perrett
Hey all
I have constucted an Ant script that *looks* to build the correct type of WAR file for deployment in tomcat. However, and im not sure if i think this is a tomcat issue or one related to seam but it doesnt actually deploy in tomcat. I have set it up so that it includes the correct JARs... here is my ant script (below)
Im using tomcat 6, and i recive the following error:
SEVERE: Error listenerStart
Apr 21, 2007 12:43:19 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/seam-hello] startup failed due to previous errors
The seam app i am trying to deploy only has one class, that is a simple hello world example!! lol I dont belive it cant be this difficult to deploy surly?
Any help would be appreciated guys
All the best
Tim
|
| <?xml version="1.0"?>
|
| <project name="SeamHello" default="deploy" basedir=".">
|
| <property file="build.properties" />
| <property name="name" value="seam-hello" />
| <property name="deploy.dir" value="${tomcat.home}/webapps" />
| <property name="deploy.file" value="${name}.war" />
| <property name="build.dir" value="./build" />
| <property name="classes.dir" value="${build.dir}/classes" />
| <property name="deploy.file.path" value="${build.dir}/${deploy.file}" />
| <property name="tomcat.conf" value="eejb.conf"/>
| <property name="eejb.conf.dir" value="../../Frameworks/jboss-seam/embedded-ejb/conf"/>
| <property name="lib.dir" value="./lib"/>
| <property name="docroot.dir" value="view"/>
| <property name="resources.dir" value="resources"/>
| <property name="webinf.lib.dir" value="${resources.dir}/WEB-INF/lib"/>
|
| <path id="project.path" />
|
| <path id="build.classpath">
| <path refid="project.path"/>
| <fileset refid="lib" />
| </path>
|
| <fileset id="local.jar" dir=".">
| <exclude name="**/*" />
| </fileset>
|
| <fileset id="lib" dir="${lib.dir}">
| <include name="*.jar" />
| <exclude name="jsf-facelets*.jar"/>
| <exclude name="jboss-*-jdk50.jar"/>
| <exclude name="jgroups*.jar"/>
| <exclude name="jbpm*.jar"/>
| <exclude name="servlet-api.jar"/>
| <exclude name="ant*.jar"/>
| <exclude name="javax.servlet.jsp.jar"/>
| <exclude name="testng-*.jar"/>
| </fileset>
|
| <fileset id="eejb.conf" dir="${eejb.conf.dir}">
| <include name="ejb3-interceptors-aop.xml"/>
| <include name="embedded-jboss-beans.xml"/>
| <include name="jboss-jms-beans.xml"/>
| <include name="security-beans.xml"/>
| <include name="login-config.xml"/>
| <include name="default.persistence.properties"/>
| <include name="log4j.xml"/>
| <include name="jndi.properties"/>
| </fileset>
|
| <fileset id="project.classes" dir="${classes.dir}">
| <include name="**/*.class"/>
| <include name="**/*.component.xml"/>
| <include name="**/components.xml"/>
| <exclude name="**/test/*.class"/>
| </fileset>
|
| <zipfileset id="seam.main.jar"
| dir="${lib.dir}"
| description="the main Seam jar">
| <include name="jboss-seam.jar"/>
| </zipfileset>
|
| <zipfileset id="tomcat.war.webinf"
| prefix="WEB-INF"
| dir="resources/WEB-INF" >
| <include name="**/*.*"/>
| </zipfileset>
|
| <fileset id="tomcat.resources"
| dir="resources">
| <include name="**/*.*"/>
| <exclude name="WEB-INF/**/*.*"/>
| </fileset>
|
| <zipfileset id="tomcat.lib"
| prefix="WEB-INF/lib"
| dir="${lib.dir}"
| description="run-time dependencies for tomcat deployment">
| <include name="*.jar"/>
| <exclude name="jsf-facelets*.jar"/>
| <exclude name="jboss-*-jdk50.jar"/>
| <exclude name="jgroups*.jar"/>
| <exclude name="jbpm*.jar"/>
| <exclude name="servlet-api.jar"/>
| <exclude name="ant*.jar"/>
| <exclude name="javax.servlet.jsp.jar"/>
| <exclude name="testng-*.jar"/>
| </zipfileset>
|
| <zipfileset id="tomcat.seam.jar" prefix="WEB-INF/lib" dir="${lib.dir}">
| <include name="${name}.jar"/>
| <include name="jboss-seam-debug.jar" />
| <include name="jboss-seam-ui.jar" />
| <include name="jboss-seam-pdf.jar" />
| <include name="jboss-seam-ioc.jar" />
| <include name="jboss-seam-remoting.jar" />
| </zipfileset>
|
| <zipfileset id="tomcat.drools.jar"
| prefix="WEB-INF/lib"
| dir="${lib.dir}">
| <include name="drools-compiler-3.0.5.jar" />
| <include name="drools-core-3.0.5.jar" />
| <!-- <include name="*.jar" /> -->
| </zipfileset>
|
| <zipfileset id="tomcat.extra.jar"
| prefix="WEB-INF/lib"
| dir="${lib.dir}">
| <include name="jsf-facelets.jar" />
| <include name="jboss-cache-jdk50.jar" />
| <include name="jboss-aop-jdk50.jar" />
| <include name="jgroups.jar" />
| <include name="jbpm*.jar" />
| <include name="spring*.jar" />
| </zipfileset>
|
| <zipfileset id="war.docroot"
| dir="${docroot.dir}">
| <include name="**/*"/>
| </zipfileset>
|
| <zipfileset id="war.webinf.lib"
| prefix="WEB-INF/lib"
| dir="${webinf.lib.dir}">
| <include name="*.jar"/>
| <exclude name="jsf-facelets*.jar"/>
| <exclude name="jboss-*-jdk50.jar"/>
| <exclude name="jgroups*.jar"/>
| <exclude name="jbpm*.jar"/>
| <exclude name="servlet-api.jar"/>
| <exclude name="ant*.jar"/>
| <exclude name="javax.servlet.jsp.jar"/>
| <exclude name="testng-*.jar"/>
| </zipfileset>
|
| <!-- <path id="compile.classpath"> -->
| <!-- <fileset dir="lib" includes="*.jar" /> -->
| <!-- <fileset dir="lib/seam" includes="jboss-seam.jar" /> -->
| <!-- </path> -->
|
| <target name="clean" description="Cleans up the build directory">
| <delete dir="${classes.dir}" failonerror="false" />
| <delete dir="${build.dir}" failonerror="false" />
| </target>
|
| <target name="init" depends="clean" description="Initialize the build">
| <echo message="Building ${ant.project.name}" />
| <mkdir dir="${classes.dir}" />
| <mkdir dir="${build.dir}" />
| </target>
|
| <target name="compile" depends="init" description="Compile the security Java source code">
| <javac destdir="${classes.dir}" classpathref="build.classpath" debug="false" deprecation="false" nowarn="on">
| <src path="src" />
| </javac>
| </target>
|
| <target name="war" depends="compile">
| <mkdir dir="${build.dir}/WEB-INF/lib"/>
|
| <jar jarfile="${build.dir}/${name}.jar">
| <fileset refid="project.classes"/>
| <fileset refid="tomcat.resources"/>
| </jar>
|
| <jar jarfile="${build.dir}/mc-conf.jar">
| <fileset refid="${tomcat.conf}"/>
| </jar>
|
| <copy todir="${build.dir}/resources/WEB-INF">
| <fileset refid="tomcat.war.webinf"/>
| <filterset>
| <filter token="jndiPattern" value="#{ejbName}/local"/>
| <filter token="embeddedEjb" value="true"/>
| <filter token="microcontainer" value="true"/>
| </filterset>
| </copy>
|
| <jar destfile="${build.dir}/${name}.war" duplicate="preserve">
| <zipfileset refid="tomcat.lib"/>
| <zipfileset refid="tomcat.seam.jar"/>
| <zipfileset refid="tomcat.drools.jar"/>
| <zipfileset refid="tomcat.extra.jar"/>
| <zipfileset refid="war.docroot"/>
| <zipfileset refid="war.webinf.lib"/>
| <zipfileset dir="${build.dir}/resources">
| <include name="WEB-INF/**/*.*"/>
| <exclude name="WEB-INF/lib/*.jar"/>
| </zipfileset>
| <zipfileset dir="${build.dir}" prefix="WEB-INF/lib">
| <include name="${name}.jar"/>
| <include name="mc-conf.jar"/>
| </zipfileset>
| </jar>
|
| </target>
|
| <target name="deploy" depends="war">
| <echo message="Deploying WAR to tomcat" level="info" />
| <copy file="${deploy.file.path}" todir="${deploy.dir}" />
| </target>
|
| <target name="undeploy">
| <echo message="undeploy ${deploy.file} from ${deploy.dir}" level="info" />
| <delete file="${deploy.dir}/${deploy.file}" />
| </target>
| </project>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039521#4039521
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039521
19 years