Help

Switch Workspace

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

  1. Download and install Tomcat 6.X
  2. Go into the jboss-seam/examples/jpa directory
  3. Copy the lib/hsqldb.jar into $TOMCAT_HOME/lib
  4. Run ant tomcat6 to build the application
  5. Deploy dist-tomcat6/jboss-seam-jpa.war
  6. Start Tomcat
  7. Access the app at http://localhost:8080/jboss-seam-jpa/

To run EJB based examples you'll need to follow the instructions on installing JBoss Embedded on Tomcat 6.0.

20 comments:
 
09. Mar 2008, 07:40 CET | Link
xflin

Using seam 2.0.1 with tomcat 6.0.16, I had to add asm.jar to the deployed war's WEB-INF/lib/ directory.

 
11. Mar 2008, 16:45 CET | Link
Zoli

which asm.jar have you used, with asm-3.1.jar I receive: java.lang.NoSuchMethodError

 
12. Mar 2008, 01:02 CET | Link
xflin

I simply copied the jar file bundled in the seam 2.0.1-GA download, which is located at jboss-seam-2.0.1.GA/lib/asm.jar.

 
12. Mar 2008, 10:21 CET | Link
Zoli

thanks,with that jar is working

 
13. Mar 2008, 13:26 CET | Link
Artur

First. there isn't lib//hsqldb.jar file in jboss-seam//examples//jpa directory. I found it on seam-gen//lib directory.

Second. I have following in tomcat log:

SEVERE: Error listenerStart 13.03.2008 15:13:48 org.apache.catalina.core.StandardContext start SEVERE: Context jboss-seam-jpa startup failed due to previous errors Example app not working for me. Tomcat6, Seam2, Java6

 
13. Mar 2008, 16:06 CET | Link
Jack

I am having issues deploying on Tomcat 6 as well. You should check your logs ... you will probably find NoClassDefFoundError. I've had to copy several of the war's jars into Tomcat/lib. So far, I've had to copy all of the jsf libs and commons-logging.jar. Particularly irking is the fact that the commons-collections.jar in the war has the wrong version ... the example apparently needs the collection that contains AbstractHashMap, so I had to find the jar containing AbstractHashMap.

My latest issue is an ajax4jsf class not found... i can't find any ajax4jsf jars anywhere in the war. I must be doing something wrong: this is way harder than it should be.

 
17. Mar 2008, 18:07 CET | Link
hugelsb

I replaced the commons-collections.jar in the generated war with commons-collections-3.2.jar and added the asm.jar as well, and it works now! Link to download : commons-collections-3.2.jar

 
01. Jul 2008, 22:40 CET | Link

I am also trying to make seam simply work on tomcat with facelets, jsf and richfaces but with no luck. The webapplication seems to be working, but with weird unresolved issues: 1) I get this exception: java.lang.RuntimeException: error while reading /WEB-INF/components.xml at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:154) at org.jboss.seam.init.Initialization.create(Initialization.java:104) at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.IllegalStateException: Two components with the same name and precedence - component name: org.jboss.seam.transaction.transaction, component classes: org.jboss.seam.transaction.EntityTransaction, org.jboss.seam.transaction.HibernateTransaction at org.jboss.seam.init.Initialization.addComponentDescriptor(Initialization.java:489) at org.jboss.seam.init.Initialization.installComponentFromXmlElement(Initialization.java:389) at org.jboss.seam.init.Initialization.installComponentsFromXmlElements(Initialization.java:280) at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:150) ... 26 more

2) I get this warning in the log file: The listener org.jboss.seam.servlet.SeamListener is already configured for this context. The duplicate definition has been ignored

3) This is the most annoying issue (since from the rest I could have ignored at this point in development): In a simple login example I am doing it seems like the action method is called twice in the server. I have a feeling this will happen in any other action and not just in this login example... Mybe it is related to the message I am getting at 2)...

 
10. Jul 2008, 22:38 CET | Link
Nohacks

Did you ever get this working.??

I am starting to add Seam to my JSF/RichFaces Project in Tomcat 6

Phil

 
21. Jul 2008, 11:05 CET | Link
Eugeniy N. | nikolaev.AT.mail.by
Does not work...


Can somebody make:

1) The project for import in Eclipse (compress its any popular archiver)

2) Contents "lib" in Tomcat 6 folder

3) War-file

 + info about Eclipse version + info about seam framework version.
 
22. Jul 2008, 10:17 CET | Link
itsnavigator

i could run without any problem. i've just followed the instruction except ant tomcat55 instead of ant tomcat6 and that it, its working now.

 
22. Jul 2008, 15:15 CET | Link

Ant? We are need for IDE c support Seam. And problems are present!

But...

See my forum, questions and answers, for this problem.

 
30. Sep 2008, 21:45 CET | Link
WPW
|Command line deployment worked fine for me with:

Tomcat 6.0.16
Seam 2.0.3.CR1

I copied Seam's hsqldb.jar to Tomcat's lib/, then
ant tomcat6
then copied jboss-seam-jpa.war to tomcat's webapps/ 
 
25. Jan 2009, 17:17 CET | Link
zahid shaikh | ncst100.AT.hotmail.com

I had no issue in running seam jpa example with tomcat 6(using ant tomcat6).

I would suggest that most people should stick with JPA (instead of embedded ejb)- as JPA is just a simple wrapper over hibernate methods.

You could seem my blog at : http://www.jroller.com/seam on how to setup seam-gen with tomcat 6.(which is ultimately what most people would need -after they tried running the examples)

 
07. Aug 2009, 10:05 CET | Link
I think some of the confusion also has to do with the order of the steps in the tutorial above.

On Mac OS X (10.5.8), this is what worked for me:

Download and install Tomcat 6.x
-------------------------------
(http://tomcat.apache.org/download-60.cgi)

I downloaded the tar.gz file and executed the following steps in Terminal (assuming we start in the folder containing the downloaded file):

mkdir /Library/Tomcat
gunzip apache-tomcat-6.0.20.tar.gz
tar -xvf apache-tomcat-6.0.20.tar /Library/Tomcat
cd /Library/Tomcat
ln -sfhv apache-tomcat-6.0.20 Home

In .bash_profile, add the following:
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/Library/Tomcat/Home

Download and install Seam
-------------------------
(http://seamframework.org/Download)

Execute the following commands in Terminal (again, assuming we start in the folder containing the downloaded file):

gunzip jboss-seam-2.1.1.GA.tar.gz
tar -xvf jboss-seam-2.1.1GA.tar
cd jboss-seam-2.1.1GA/
cp lib/hsqldb.jar $CATALINA_HOME/lib/
cd examples/jpa
ant tomcat6

Deploy jboss-seam-jpa
---------------------
cp dist-tomcat6/jboss-seam-jpa.war /Library/Tomcat/Home/webapps/

Start Tomcat
------------
cd /Library/Tomcat/Home/bin/
./startup.sh

Access the app
--------------
http://localhost:8080/jboss-seam-jpa/
 
16. Sep 2009, 12:52 CET | Link

In second step (Go into the boss-seam/examples/jpa directory) did i want to build or just copy this to tomcat what i need to do???? Where i can download this war file... dist-tomcat6/jboss-seam-jpa.war

 
16. Sep 2009, 18:41 CET | Link

please wats wrong with my project..... FAIL - Application at context path /jboss-seam-jpa could not be started

 
21. Sep 2009, 09:09 CET | Link
Alan Pappachan wrote on Aug 07, 2009 10:05:
.
.
.
Download and install Tomcat 6.x
-------------------------------
(http://tomcat.apache.org/download-60.cgi)
.
.
.
mkdir /Library/Tomcat
gunzip apache-tomcat-6.0.20.tar.gz

tar -xvf apache-tomcat-6.0.20.tar /Library/Tomcat

the above line is wrong, replace with:

cd /Library/Tomcat
tar -xvf path-to-downloaded-file/apache-tomcat-6.0.20.tar

.
.
.

The rest of it remains the same. Sorry about that. path-to-downloaded-file should be replaced with the actual path to where you downloaded the file.

 
19. Dec 2009, 18:20 CET | Link
sivakumar
# Run ant tomcat6 to build the application
# Deploy dist-tomcat6/jboss-seam-jpa.war

Please tell me more on this. I didn't installed ant i have tomcat 6 with maven 2 how to do it
 
20. Dec 2009, 08:42 CET | Link
seamuser

org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart Dec 20, 2009 12:24:56 PM org.apache.catalina.core.StandardContext start

Everything i deployed in tomcat server while run this http://localhost:8080/jboss-seam-registration/ showing the above error.. Please reply..

Post Comment