<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
setting up JBoss with SEAM
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/sanfran0201">Mike Quin</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/599941#599941">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have a very simple SEAM example (shown below) that is not working. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>I'm very new to JBoss and hibernate and SEAM and all that stuff. I have been reading </span><a class="jive-link-external-small" href="http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/" target="_blank">http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/</a><span> </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I don't want to run <a class="jive-link-anchor-small">seam-gen</a> on my jboss-5.1.0.  I just need a simple and straightforward instructions on how to setup jboss 5.1 with SEAM and to run this extremely simple helloworld example. However if seam-gen is absolutely required (which sounds irrational), then please confirm and I'll use it.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Any help is appreciated.</p><p>Thank you</p><p>Mike</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm deploying org.jboss.seam-jboss-seam-2.1.0.SP1.jar inside my ear.</p><p>I have also attached the server.log file if that would help.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 10pt;">public class InjectionServlet extends HttpServlet {</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong style="font-size: 10pt; font-family: courier new,courier;">  @In(value=InjectableComponent.NAME, create = true, required = true)</strong></p><p><strong style="font-size: 10pt; font-family: courier new,courier;">  private InjectableComponent injectableComponent;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 10pt;">  public void service(HttpServletRequest request,</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">                      HttpServletResponse response) throws IOException, ServletException {</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    response.setContentType("text/html");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    PrintWriter out = response.getWriter();</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("<html>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("<head>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("<title>Hello World Seam Servlet!</title>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("</head>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("<body>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    if (injectableComponent == null) {</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">      out.println("Injection not working.");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    } else {</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">      out.println(injectableComponent.getTitle());</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    }</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("</body>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">    out.println("</html>");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">  }</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">package com.example.bean;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">import org.jboss.seam.ScopeType;</span></p><p><span style="font-family: courier new,courier;">import org.jboss.seam.annotations.Create;</span></p><p><span style="font-family: courier new,courier;">import org.jboss.seam.annotations.Name;</span></p><p><span style="font-family: courier new,courier;">import org.jboss.seam.annotations.Scope;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong style="font-family: courier new,courier;">@Name("injectableComponent")</strong></p><p><strong style="font-family: courier new,courier;">@Scope(ScopeType.EVENT)</strong></p><p><span style="font-family: courier new,courier;">public class InjectableComponent {</span></p><p><span style="font-family: courier new,courier;">  public static final String NAME = "injectableComponent";</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">  public InjectableComponent() {</span></p><p><span style="font-family: courier new,courier;">  }</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">  @Create</span></p><p><span style="font-family: courier new,courier;">  public void init() {</span></p><p><span style="font-family: courier new,courier;">    System.out.println("Good Morning.");</span></p><p><span style="font-family: courier new,courier;">  }</span></p><p><span style="font-family: courier new,courier;">  public String getTitle() {</span></p><p><span style="font-family: courier new,courier;">    return "Hello World.";</span></p><p><span style="font-family: courier new,courier;">  }</span></p><p><span style="font-family: courier new,courier;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;"><?xml version="1.0" encoding="ISO-8859-1"?></span></p><p><span style="font-family: courier new,courier;"><web-app version="2.5"</span></p><p><span style="font-family: courier new,courier;"><span>    xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><span>"</span></span></p><p><span style="font-family: courier new,courier;"><span>    xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></span></p><p><span style="font-family: courier new,courier;"><span>    xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><span> </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" target="_blank">http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd</a><span>"></span></span></p><p><span style="font-family: courier new,courier;">    <!-- Seam --></span></p><p><strong style="font-family: courier new,courier;">    <listener></strong></p><p><strong style="font-family: courier new,courier;">        <listener-class>org.jboss.seam.servlet.SeamListener</listener-class></strong></p><p><strong style="font-family: courier new,courier;">    </listener></strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">    <servlet></span></p><p><span style="font-family: courier new,courier;">        <servlet-name>InjectionServlet</servlet-name></span></p><p><span style="font-family: courier new,courier;">        <servlet-class>com.example.ui.InjectionServlet</servlet-class></span></p><p><span style="font-family: courier new,courier;">    </servlet></span></p><p><span style="font-family: courier new,courier;">    <servlet-mapping></span></p><p><span style="font-family: courier new,courier;">        <servlet-name>InjectionServlet</servlet-name></span></p><p><span style="font-family: courier new,courier;">        <url-pattern>/ioc</url-pattern></span></p><p><span style="font-family: courier new,courier;">    </servlet-mapping></span></p><p><span style="font-family: courier new,courier;"></web-app></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;"><?xml version="1.0" encoding="ISO-8859-1"?></span></p><p><span style="font-family: courier new,courier;"><!DOCTYPE application PUBLIC</span></p><p><span style="font-family: courier new,courier;">        "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"</span></p><p><span style="font-family: courier new,courier;"><span>        "</span><a class="jive-link-external-small" href="http://java.sun.com/dtd/application_1_3.dtd" target="_blank">http://java.sun.com/dtd/application_1_3.dtd</a><span>"></span></span></p><p><span style="font-family: courier new,courier;"><application></span></p><p><span style="font-family: courier new,courier;">    <display-name>EJB3</display-name></span></p><p><span style="font-family: courier new,courier;">    <module></span></p><p><span style="font-family: courier new,courier;">        <ejb>Simple-server.jar</ejb></span></p><p><span style="font-family: courier new,courier;">    </module></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;">    <module></span></p><p><span style="font-family: courier new,courier;">        <web></span></p><p><span style="font-family: courier new,courier;">            <web-uri>Simple-web.war</web-uri></span></p><p><span style="font-family: courier new,courier;">            <context-root>/seam</context-root></span></p><p><span style="font-family: courier new,courier;">        </web></span></p><p><span style="font-family: courier new,courier;">    </module></span></p><p><span style="font-family: courier new,courier;"></application></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 10pt;"><br/></span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/599941#599941">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>