Help

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.

24 comments:
 
09. Mar 2008, 07:40 America/New_York | 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 America/New_York | Link
Zoli

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

 
12. Mar 2008, 01:02 America/New_York | 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 America/New_York | Link
Zoli

thanks,with that jar is working

 
13. Mar 2008, 13:26 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | 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 America/New_York | Link

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

 
21. Sep 2009, 09:09 America/New_York | 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 America/New_York | 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 America/New_York | 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..

 
29. Jul 2010, 09:04 America/New_York | Link

I had to add the following libs in apache-tomcat-6.0.20/lib

jsf-api.jar
dom4j.jar
log4j-boot.jar
 
01. Oct 2010, 05:55 America/New_York | Link
Something strange with this jboss-seam-jpa project...

1) Following the instructions given at the top of this page, copying the jboss-seam-jpa.war in [tomcat folder]/webapps/ and the project is running correctly.

Removing the war.

2) But if I import the war in Eclipse and use these project properties for Tomcat :
- "Is a Tomcat Projet" => selected
- "Context name" => /jboss-seam-jpa

Then right-clic on the project, update context.
Then start Tomcat.

localhost:8080 shows Apache Tomcat page.
Entering Tomcat Manager shows /jboss-seam-jpa started.
Clicking on it => Error # 404 !
No error appear in Tomcat console in Eclipse.

3) Right-clic on the project / Properties / Tomcat
- Redirect logs of this context in Eclipse console => now selected => OK
New message in console :
"1 oct. 2010 11:31:55 org.apache.catalina.startup.HostConfig checkResources
INFO: Repli (undeploy) de l'application web ayant pour chemin de contexte /jboss-seam-jpa"
(Sorry, it's partially in french because I'm french)

Reloading the project in Tomcat Manager => OK
Trying to access to localhost:8080/jboss-seam-jpa => Error #404 and no message in Eclipse console !

Stop Tomcat.

4) Right-clic on project / Run as... / Run on server => Welcome page of the project appears in Eclipse Browser ! And in Firefox too at localhost:8080/jboss-seam-jpa !

It seems that the Sysdeo Tomcat plugin of Eclipse and the server configured in the Seam Perspective are in conflict.

Are we unable to use Sysdeo Tomcat plugin to manage Seam projects with Tomcat ?
 
21. Dec 2010, 22:09 America/New_York | Link

tem certeza que esse negócio roda mesmo no tomcat? Eu não consigo rodar de jeito nenhum! Será que não é melhor dizer logo que não roda?

rwolosker@gmail.com

 
24. May 2011, 01:30 America/New_York | Link

Frankly speaking, it is not easy to deploy a seam application in Tomcat. In the websites of seam, they always talk big, they advertise in such a way that it seems like a plug-n-play type deployment; but real story is different.

Yes it is possible to deploy in Tomcat but it comes with a price of painful tasks. First of all, you will get some ClassNotFoundException, you resolve those one by one; then you will get a conflict class file versions; you resolve those and then you will get project facets issue.. and this goes on ... simply put, it is not a easily deployable in Tomcat. So is true for Weblogic and WebSphere. The only painless deployment that is possible is with JBoss AS.