<!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;">
    Simple Seam app configured for Tomcat
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/cinephil">Philippe Leménager</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/message/564739#564739">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello Seamians ! <span> :) </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I've been trying to config a simple seam test project for Tomcat 6 using JBoss Tools but it still doesn't work after reading many things about it on the Internet and trying the solutions proposed. <span> :( </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1) New Seam Web Project</p><p>1.a) Seam web project window</p><p>Project name : projettest</p><p>Target runtime : Apache Tomcat v6.0</p><p>Dynamic web module version : 2.5 (default choice)</p><p>Target Server : Tomcat v6.0 Server at localhost</p><p>Configuration : Dynamic Web Project with Seam 2.2 (default choice)</p><p>NEXT</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1.b) Java</p><p>NEXT</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1.c) Web Module</p><p>NEXT</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1.d) JSF Capabilities</p><p>After some unsuccessfull tries, I've created a user-library with jsf-api.jar and jsf-impl.jar taken in jboss-seam-2.2.0.GA/lib directory and selected this new library + "Include libraries with this application". I lived the other things by default.</p><p>NEXT</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1.d) Seam Facet</p><p>Seam Runtime : jboss-seam-2.2.0.GA</p><p>Deploy as : WAR</p><p>Database type : MySQL5 (InnoDB)</p><p>Connection profile MysQL Test (configured and tested)</p><p>Database Schema Name : Test</p><p>Database Catalog Name : Test</p><p>DB Tables already exists in database : selected (the database contains only one simple table called users (usr_id, username, name, password) with two lines inside).</p><p>I leaved the other options as default.</p><p>FINISH</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>=&gt; The project has been created without errors.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2) Changing some things, after reading issues about this operation.</p><p>2.a) projettest/WebContent/META-INF/context.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><span></span><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2.b) projettest/WebContent/WEB-INF/classes/META-INF/persistence.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><span></span><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2.c) projettest/WebContent/WEB-INF/components.xml</p><p>I've deleted all params in tag &lt;core:init /&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2.d) projettest/WebContent/WEB-INF/pages.xml</p><p>I've commented the last tag &lt;exception&gt;, this one :</p><p>&lt;!-- &lt;exception&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;redirect view-id="/error.xhtml"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;message severity="error"&gt;Unexpected error, please try again&lt;/message&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/redirect&gt;<br/>&#160;&#160;&#160; &lt;/exception&gt; --&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2.e) Added jars</p><p>I copied from jboss-seam-2.2.0.GA/lib those jars :</p><p>- commons-collections.jar</p><p>- commons-lang.jar</p><p>- commons-logging.jar</p><p>- concurrent.jar</p><p>- dom4j.jar</p><p>- hibernate-annotations.jar</p><p>- hibernate-common-annotations.jar</p><p>- hibernate-core.jar</p><p>- hibernate-entitymanager.jar</p><p>- hibernate-search.jar</p><p>- hibernate-validator.jar</p><p>- javassist.jar</p><p>- jboss-common-core.jar</p><p>- jta.jar</p><p>- log4j.jar</p><p>- lucene-core.jar</p><p>- persistence-api.jar</p><p>- slf4j-api.jar</p><p>- slf4j-log4j12.jar</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2.f) log4j.xml</p><p>I've copied the file log4j.xml from jboss-seam-jpa example project to projettest/WebContent/WEB-INF/classes.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>3) Starting Tomcat and trying to access to the project</p><p>There is no error when I start Tomcat, just this info message :</p><p>org.apache.catalina.core.StandardContext addApplicationListener<br/>INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I also have this WARN :</p><p>WARN&#160; [PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>When I type </span><a class="jive-link-external-small" href="http://localhost:8080/projettest" target="_blank">http://localhost:8080/projettest</a><span> in Firefox, I already have the "Welcome to Seam!" page with the url </span><a class="jive-link-external-small" href="http://localhost:8080/projettest/home.seam" target="_blank">http://localhost:8080/projettest/home.seam</a><span> but some errors appears in Tomcat console :</span></p><p>12:22:09,217 ERROR [SeamPhaseListener] swallowing exception<br/>java.lang.RuntimeException: exception invoking: getTransaction<br/>&#160;&#160;&#160; at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)</p><p>...</p><p>Caused by: javax.naming.NamingException: Cannot create resource instance<br/>&#160;&#160;&#160; at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)</p><p>...</p><p>12:22:09,310 WARN&#160; [SeamPhaseListener] uncaught exception, passing to exception handler<br/>java.lang.IllegalStateException: Could not commit transaction<br/>&#160;&#160;&#160; at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:625)</p><p>...</p><p>Caused by: java.lang.RuntimeException: exception invoking: getTransaction<br/>&#160;&#160;&#160; at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)</p><p>...</p><p>Caused by: javax.naming.NamingException: Cannot create resource instance<br/>&#160;&#160;&#160; at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)</p><p>...</p><p>Many times the same errors.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>4) Generate entities</p><p>4.1) New Seam Generate Entities</p><p>Reverse engineer from database is selected</p><p>NEXT</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>4.2) Select Tables</p><p>I had to click on the Refresh button because no database had appeared. Then I selected Test database and clicked on the Include button.</p><p>FINISH</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>=&gt; Some more files have been generated successfully.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>5) Trying to browse data</p><p>After reloading the home page, a "Browse Data / Users List" menu appears. When I click on it, I already have the UsersList.seam page with some more ERROR [SeamPhaseListener] swallowing exception in Tomcat Console.</p><p>If I click on the Search button, with ou without something in the fields of the page, the application crashes with these errors :</p><p>org.apache.catalina.core.StandardWrapperValve invoke<br/>GRAVE: "Servlet.service()" pour la servlet Faces Servlet a g&eacute;n&eacute;r&eacute; une exception<br/>javax.el.PropertyNotFoundException: /UsersList.xhtml @19,81 value="#{usersList.users.username}": Target Unreachable, identifier 'usersList' resolved to null<br/>&#160;&#160;&#160; at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)</p><p>...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I've searched on the Internet but didn't find clear explanation and solution.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Someone here can help me ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks in advance.</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/564739#564739">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Tools at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>