Friday April 03, 2009
TOTD # 77: Running Seam examples with GlassFish
![]() |
Seam is a full-stack solution to assemble complex web applications using simple annotated classes, a rich set of UI components, and very little XML. It integrates Ajax and Business Process Modeling with several Java EE technologies such as Java Server Faces (JSF), Java Persistence API (JPA), and Enterprise Java Beans (EJB 3.0). |
| ~/tools/jboss-seam-2.1.1.GA/examples/jpa >ant glassfish Buildfile: build.xml glassfish: initcopy: initpoms: [echo] Setting up dependencies [mkdir] Created dir: /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms [copy] Copying 1 file to /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms [artifact:install] [INFO] Installing /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms/root.pom to . . . . . . init.war: war: [copy] Copying 27 files to /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jpa/exploded-archives-glassfish/jboss-seam-jpa.war [copy] Copying 7 files to /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jpa/exploded-archives-glassfish/jboss-seam-jpa.war/WEB-INF/lib noejb.war: [copy] Copying 18 files to /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jpa/exploded-archives-glassfish/jboss-seam-jpa.war/WEB-INF/lib [copy] Copying 2 files to /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jpa/exploded-archives-glassfish/jboss-seam-jpa.war [copy] Copying 4 files to /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jpa/exploded-archives-glassfish/jboss-seam-jpa.war distributable.war: noejb.archive: [jar] Building jar: /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jpa/dist-glassfish/jboss-seam-jpa.war BUILD SUCCESSFUL Total time: 5 seconds |
| ~/tools/jboss-seam-2.1.1.GA/examples/jpa >~/tools/glassfish/v2.1/glassfish/bin/asadmin
deploy dist-glassfish/jboss-seam-jpa.war Command deploy executed successfully. |



| ~/tools/jboss-seam-2.1.1.GA/examples/hibernate
>ant glassfish Buildfile: build.xml glassfish: initcopy: initpoms: [echo] Setting up dependencies [copy] Copying 1 file to /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms [artifact:install] [INFO] Installing /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms/root.pom to /Users/arungupta/.m2/repository/org/jboss/seam/root/2.1.1.GA/root-2.1.1.GA.pom . . . distributable.war: noejb.archive: [jar] Building jar: /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/hibernate/dist-glassfish/jboss-seam-hibernate.war BUILD SUCCESSFUL Total time: 6 seconds |
| ~/tools/jboss-seam-2.1.1.GA/examples/hibernate
>~/tools/glassfish/v2.1/glassfish/bin/asadmin
deploy dist-glassfish/jboss-seam-hibernate.war Command deploy executed successfully. |
| ~/tools/jboss-seam-2.1.1.GA/examples/jee5/booking
>ant Buildfile: build.xml initcopy: initpoms: [echo] Setting up dependencies [copy] Copying 1 file to /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms [artifact:install] [INFO] Installing /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms/root.pom to /Users/arungupta/.m2/repository/org/jboss/seam/root/2.1.1.GA/root-2.1.1.GA.pom [copy] Copying 1 file to /Users/arungupta/tools/jboss-seam-2.1.1.GA/classes/poms . . . archive: [jar] Building jar: /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jee5/booking/dist/jboss-seam-jee5-booking.jar [jar] Building jar: /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jee5/booking/dist/jboss-seam-jee5-booking.war [jar] Building jar: /Users/arungupta/tools/jboss-seam-2.1.1.GA/examples/jee5/booking/dist/jboss-seam-jee5-booking.ear BUILD SUCCESSFUL Total time: 5 seconds ~/tools/jboss-seam-2.1.1.GA/examples/jee5/booking >~/tools/glassfish/v2.1/glassfish/bin/asadmin deploy dist/jboss-seam-jee5-booking.ear Command deploy executed successfully. |
Posted by Arun Gupta in Finance | Comments[13]
|
|
|
|
|
Today's Page Hits: 1745
Total # blog entries: 1002
Sun's just been bought out by IBM and the general consensus is that NetBeans is probably going to be dropped like a stone...as you're arguably one of the experts on GlassFish, how is the merger going to affect this project as well? I cannot in any confidence recommend any Sun technology in the workplace with the company in limbo.
Posted by eru on April 03, 2009 at 04:47 PM PDT #
eru, Our company policy is to not comment on rumors.
Posted by Arun Gupta on April 03, 2009 at 08:20 PM PDT #
Do you happen to have a maven version of this? We wanted to move our Seam application from JBoss to Glassfish but had too many problems with dependencies and classpaths. Also the great embedded maven glassfish plugin really helps people getting started. It'd be nice to try this out simply by unzipping and typing "mvn glassfish:run."
Posted by Steven B on April 10, 2009 at 09:47 AM PDT #
Steven, good thought! I'm traveling next week so will try a maven version after I come back.
Posted by Arun Gupta on April 10, 2009 at 09:55 AM PDT #
thank you
Posted by neon on April 26, 2009 at 02:16 PM PDT #
thank you
Posted by neon tabela on April 26, 2009 at 02:16 PM PDT #
This example does not work on GlassFish :(
Posted by Jason on October 04, 2009 at 04:18 PM PDT #
Jason,
Which GlassFish version ?
Can you post more details to users@glassfish.dev.java.net ?
Posted by Arun Gupta on October 04, 2009 at 05:27 PM PDT #
Hi Arun,
thanks for reply. the email with more details subject: "Seam example does not work on GlassFish" was sent to users@glassfish.dev.java.net
Posted by Jason on October 06, 2009 at 04:53 AM PDT #
Hi again!
The email did sent, but I has received SPAM with offer:
"To subscribe to the list, send a blank message to:
users-subscribe@glassfish.dev.java.net"
I did not want get spams!
So more details I post here:
I did try install Seam example (jboss-seam/examples/jee5/booking/) as
at: http://blogs.sun.com/arungupta/entry/totd_77_running_seam_examples.
But Seam example does not work on GlassFish.
Crash while deploy:
[#|2009-10-06T15:35:53.079+0400|SEVERE|glassfish|null|_ThreadID=33;_ThreadName=Thread-3;|log4j:WARN
No appenders could be found for logger
(javax.servlet.ServletContextListener).|#]
[#|2009-10-06T15:35:53.080+0400|SEVERE|glassfish|null|_ThreadID=33;_ThreadName=Thread-3;|log4j:WARN
Please initialize the log4j system properly.|#]
[#|2009-10-06T15:35:53.716+0400|INFO|glassfish|javax.enterprise.system.core.classloading.com.sun.enterprise.loader|_ThreadID=33;_ThreadName=Thread-3;|org.jboss.seam.example.booking.User
actually got transformed|#]
[#|2009-10-06T15:35:56.561+0400|SEVERE|glassfish|org.apache.catalina.core.StandardContext|_ThreadID=33;_ThreadName=Thread-3;|PWC1306:
Startup of context /seam-jee5-booking failed due to previous errors|#]
...
..
Exception while loading the app : java.lang.Exception:
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.LinkageError: loader
constraint violation: loader (instance of
org/apache/felix/framework/ModuleImpl$ModuleClassLoader) previously
initiated loading for a different type with name
"javassist/bytecode/ClassFile"
Posted by Jason on October 06, 2009 at 05:02 AM PDT #
My Info:
glassfish-v3-preview-b66
jboss-seam-2.2.0.GA
Posted by Jason on October 06, 2009 at 05:05 AM PDT #
Jason, I tried with GlassFish v2.1, haven't tried with v3 yet. Can you post your question to users@glassfish.dev.java.net ?
Posted by Arun Gupta on October 08, 2009 at 10:56 AM PDT #
Jason, I'll try with v3 in 2 weeks otherwise you can also post your question to the forum at:
http://forums.java.net/jive/forum.jspa?forumID=56&start=0
and stay away from clogging your inbox.
Posted by Arun Gupta on October 08, 2009 at 10:58 AM PDT #