<!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;">&#160;</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;">&#160;</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;">&#160;</p><p>I don't want to run <a class="jive-link-anchor-small">seam-gen</a> on my jboss-5.1.0.&#160; 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;">&#160;</p><p>Any help is appreciated.</p><p>Thank you</p><p>Mike</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160;</p><p><strong style="font-size: 10pt; font-family: courier new,courier;">&#160; @In(value=InjectableComponent.NAME, create = true, required = true)</strong></p><p><strong style="font-size: 10pt; font-family: courier new,courier;">&#160; private InjectableComponent injectableComponent;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160; public void service(HttpServletRequest request,</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; HttpServletResponse response) throws IOException, ServletException {</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; response.setContentType("text/html");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; PrintWriter out = response.getWriter();</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;html&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;head&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;title&gt;Hello World Seam Servlet!&lt;/title&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;/head&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;body&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; if (injectableComponent == null) {</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160; out.println("Injection not working.");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; } else {</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160;&#160;&#160; out.println(injectableComponent.getTitle());</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; }</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;/body&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160;&#160;&#160; out.println("&lt;/html&gt;");</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">&#160; }</span></p><p><span style="font-family: courier new,courier; font-size: 10pt;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">package com.example.bean;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160; public static final String NAME = "injectableComponent";</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&#160; public InjectableComponent() {</span></p><p><span style="font-family: courier new,courier;">&#160; }</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&#160; @Create</span></p><p><span style="font-family: courier new,courier;">&#160; public void init() {</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; System.out.println("Good Morning.");</span></p><p><span style="font-family: courier new,courier;">&#160; }</span></p><p><span style="font-family: courier new,courier;">&#160; public String getTitle() {</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; return "Hello World.";</span></p><p><span style="font-family: courier new,courier;">&#160; }</span></p><p><span style="font-family: courier new,courier;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;</span></p><p><span style="font-family: courier new,courier;">&lt;web-app version="2.5"</span></p><p><span style="font-family: courier new,courier;"><span>&#160;&#160;&#160; 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>&#160;&#160;&#160; 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>&#160;&#160;&#160; 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>"&gt;</span></span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;!-- Seam --&gt;</span></p><p><strong style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;listener&gt;</strong></p><p><strong style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;listener-class&gt;org.jboss.seam.servlet.SeamListener&lt;/listener-class&gt;</strong></p><p><strong style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;/listener&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;servlet&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;servlet-name&gt;InjectionServlet&lt;/servlet-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;servlet-class&gt;com.example.ui.InjectionServlet&lt;/servlet-class&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;/servlet&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;servlet-mapping&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;servlet-name&gt;InjectionServlet&lt;/servlet-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;url-pattern&gt;/ioc&lt;/url-pattern&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;/servlet-mapping&gt;</span></p><p><span style="font-family: courier new,courier;">&lt;/web-app&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;</span></p><p><span style="font-family: courier new,courier;">&lt;!DOCTYPE application PUBLIC</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"</span></p><p><span style="font-family: courier new,courier;"><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; "</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>"&gt;</span></span></p><p><span style="font-family: courier new,courier;">&lt;application&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;display-name&gt;EJB3&lt;/display-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;module&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ejb&gt;Simple-server.jar&lt;/ejb&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;/module&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;module&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;web&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;web-uri&gt;Simple-web.war&lt;/web-uri&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;context-root&gt;/seam&lt;/context-root&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/web&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;/module&gt;</span></p><p><span style="font-family: courier new,courier;">&lt;/application&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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>