Newbie Headache For First SEAM Implementation
ohughes Nov 26, 2008 12:27 PMHi All,
Thanks for taking some time to read this post.
I am new to JSF, Seam, Icefaces, etc., and I want to build a very simple HelloWorld application but I keep on getting an error in the log file saying that my component cannot be found: seam component not found
.
I was initially trying to create a complex project, but I thought I'd better get the basics in first.
Below is my code and configuration, and any help as to why it is not displaying 'Hello World' would be greatfully appreciated.
JBoss-4.2.3.GA
Java 1.5 (have also tested with 1.6)
SEAM 2.1.0.SP1
Icefaces 1.7.2
HelloWorld
package test; import javax.ejb.Local; /** * @author hugheos * */ @Local public interface HelloWorld { public String getMessage(); }
HelloWorldImpl
package test; import javax.ejb.Stateless; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; /** * @author hugheos * */ @Stateless @Name("helloWorldTest") @Scope(ScopeType.PAGE) public class HelloWorldImpl implements HelloWorld { /** * */ public HelloWorldImpl() { // TODO Auto-generated constructor stub } public String getMessage() { return "Hello World!"; } }
Components.xml
<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://jboss.com/products/seam/components" xmlns:core="http://jboss.com/products/seam/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <core:init jndi-pattern="test/#{ejbName}/local"/> </components>
faces-config.xml
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config> <application> <view-handler>com.icesoft.faces.facelets.D2DSeamFaceletViewHandler</view-handler> </application> </faces-config>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- Seam --> <listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <!-- JSF --> <listener> <!-- <listener-class>com.sun.faces.config.ConfigureListener</listener-class> --> <listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class> </listener> <!-- Begin IceFaces Config --> <context-param> <param-name>com.icesoft.faces.actionURLSuffix</param-name> <param-value>.seam</param-value> </context-param> <context-param> <param-name>com.icesoft.faces.synchronousUpdate</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.icesoft.faces.doJSFStateManagement</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.icesoft.examples.serverClock</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.icesoft.faces.standardRequestScope</param-name> <param-value>true</param-value> </context-param> <servlet> <servlet-name>Persistent Faces Servlet</servlet-name> <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class> <load-on-startup> 1 </load-on-startup> </servlet> <servlet> <servlet-name>Blocking Servlet</servlet-name> <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class> <load-on-startup> 1 </load-on-startup> </servlet> <servlet-mapping> <servlet-name>Persistent Faces Servlet</servlet-name> <url-pattern>*.seam</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Persistent Faces Servlet</servlet-name> <url-pattern>/xmlhttp/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Blocking Servlet</servlet-name> <url-pattern>/block/*</url-pattern> </servlet-mapping> <!-- End IceFaces Config --> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jspx</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.seam</url-pattern> </servlet-mapping> --> <session-config> <session-timeout>10</session-timeout> </session-config> </web-app>
And finally the jspx page to actually display the output of Hello World! from the bean:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:ice="http://www.icesoft.com/icefaces/component"> <head> <title>Hello World Test</title> </head> <body> <f:view> <ice:outputText value="#{helloWorldTest.message}"/> <ice:outputText>Testing 123</ice:outputText> </f:view> </body> </html>
This has been causing me a headache for a few days now, and I know it must be something very simple, but I cant for the life of me figure it out.
Many thanks in advance,
Osian