[jboss-user] [JBoss Seam] - Re: Step-by-Step Seam Getting Started Guide
james.williams@jboss.com
do-not-reply at jboss.com
Tue Aug 15 09:06:07 EDT 2006
"aozoren" wrote : More findings..
|
| 1. seam.sh is missing one more parameter (shown below)
|
| if [ "${seamtask}" = new-wtp-project ]
| then
| ant new-wtp-project -Dproject.name=${projectname}
| fi
|
| 2. Using "new-wtp-project" parameter actually works and creates correct ejb-jar.xml like below..
|
| <ejb-jar>
| <assembly-descriptor>
| <interceptor-binding>
| <ejb-name>*</ejb-name>
| <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
| </interceptor-binding>
| </assembly-descriptor>
| </ejb-jar>
|
| Using "scaffold-wtp-project" does not work since it creates the ejb-jar.xml below..
|
| <?xml version="1.0" encoding="UTF-8"?>
| <ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
| <display-name>
| sampleEJB</display-name>
| </ejb-jar>
|
| That needs to be corrected I believe..
|
| 3. After fixing the problem #2, sample project successfully deployed but gave the error below..
|
| 02:23:01,632 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=sampleEJB.jar
| java.lang.RuntimeException: Interceptor class not found: org.jboss.seam.ejb.SeamInterceptor
|
| Checking the web.xml (of sample) revealed what is below..
|
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
| <display-name>
| sampleWeb</display-name>
| <welcome-file-list>
| <welcome-file>index.html</welcome-file>
| <welcome-file>index.htm</welcome-file>
| <welcome-file>index.jsp</welcome-file>
| <welcome-file>default.html</welcome-file>
| <welcome-file>default.htm</welcome-file>
| <welcome-file>default.jsp</welcome-file>
| </welcome-file-list>
| </web-app>
|
| However, the blank project had the correct web.xml shown below..
|
| <?xml version="1.0" ?>
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
|
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
|
|
|
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
|
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
|
|
| <filter-name>Seam Exception Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
|
|
|
| <filter-name>Seam Redirect Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
|
|
| <filter-mapping>
| <filter-name>Seam Exception Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <filter-mapping>
| <filter-name>Seam Redirect Filter</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
|
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
|
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
| </web-app>
|
| However correcting this problem got me the error below..
|
| 02:44:45,210 ERROR [[/sampleWeb]] Error configuring application listener of class org.jboss.seam.servlet.SeamListener
| java.lang.ClassNotFoundException: org.jboss.seam.servlet.SeamListener
|
| So I compared the classpath of both web apps (blank and sample)..
|
| blank had "JBOSS 4.0" library group, sample did not.
| blank had 5 jars under "Web App Libraries", sample none.
|
| It is no wonder sample project does not work at all..
|
| 4. I don't understand why in image http://wiki.jboss.org/wiki/attach?page=JBossSeamGettingStartedGuideStep4%2Ffigure-4.7.png, sampleEJB project does not show the error indicator (red cross). At this point it generated the incorrect ejb-jar.xml and it must show the error indicator.
|
| Later the error indicator is visible in image http://wiki.jboss.org/wiki/attach?page=JBossSeamGettingStartedGuideStep5%2Ffigure-5.5.png. So was there an error or not?
|
| Red cross magically disappears in image http://wiki.jboss.org/wiki/attach?page=JBossSeamGettingStartedGuideStep5%2Ffigure-5.7.png.
|
|
|
| I am baffled.. Why on earth this seam-gen thingy creates a perfect sample project for some people yet does not work for me..
|
| Maybe it is the late hour.. I need to check everything with fresh eyes in the morning.. :)
|
I think I figured out what's going on here. seam.sh did not have the correct call to ant for creating a new sample WTP project. I fixed seam-gen.zip and put it back out on the wiki. Please download and retry. I also added your suggested change to the template.ftl and page.ftl. Hopefully, your pain and sorrow will end here.
http://wiki.jboss.org/wiki/attach?page=JBossSEAMGen%2Fseam-gen.zip
James
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965249#3965249
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965249
More information about the jboss-user
mailing list