<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Days of ... ("not found")</title><link>http://blog.yellowbluebus.com</link><description>Useful technology stuff</description><lastBuildDate>Wed, 03 Jul 2013 12:03:00 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>JBOSS Seam 2.1.1GA on JBOSS AS 5.0.1GA: Table is not mapped</title><link>http://blog.yellowbluebus.com/posts/wordpress20090507jboss-seam-211ga-on-jboss-as-501ga-table-is-not-mapped.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I created sample JBOSS Seam project in Eclipse and decided to generate entity code from  existing database. It worked fine, but when I try to run it, it shows me that Hibernade is not able to map entity beans to the corresponding tables. The error message is like this:&lt;/p&gt;  &lt;p&gt;&lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 13px arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="border-collapse: collapse; font-family: arial; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px" class="Apple-style-span"&gt;org.hibernate.hql.ast.QuerySyntaxException: &amp;lt;your table&amp;gt; is not mapped&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;I spent around three hours trying to read all available information on it, but most of it just useless – it looks like people don’t know whats happening, so they recommend bizarre tricks. Like, for example, having empry seam.settings file in each folder, meh.&lt;/p&gt;  &lt;p&gt;Finally, I found the solution in Seam Jira: &lt;a href="https://jira.jboss.org/jira/browse/JBSEAM-3821"&gt;&lt;u&gt;&lt;font color="#0066cc"&gt;https://jira.jboss.org/jira/browse/JBSEAM-3821&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;They rocemmend to to force Hibernate to use Seam’s EntityManager by changing two files:&lt;/p&gt;    &lt;p&gt;1. components.xml&lt;/p&gt; &lt;blockquote&gt;     &lt;br&gt;    &amp;lt;persistence:entity-manager-factory name="bookingDatabase" installed="false"/&amp;gt;      &lt;br&gt;    &amp;lt;!-- If Seam loads the persistence unit (JBoss 4.x), the EntityManagerFactory will be resolved from #{bookingDatabase}.      &lt;br&gt;         On JBoss AS 5, the EntityManagerFactory is retrieved from JNDI (the binding occurs during application deployment). --&amp;gt;      &lt;br&gt;    &amp;lt;persistence:managed-persistence-context name="em" auto-create="true"      &lt;br&gt;       entity-manager-factory="#{bookingDatabase}" persistence-unit-jndi-name="java:/bookingEntityManagerFactory"/&amp;gt; &lt;/blockquote&gt;    &lt;p&gt;2. persistence.xml&lt;/p&gt; &lt;blockquote&gt;     &lt;br&gt; &amp;lt;!-- Binds the EntityManagerFactory to JNDI where Seam can look it up.      &lt;br&gt;              This is only relevant when the container automatically loads the persistence unit, as is the case in JBoss AS 5. --&amp;gt;      &lt;br&gt;         &amp;lt;property name="jboss.entity.manager.factory.jndi.name" value="java:/bookingEntityManagerFactory"/&amp;gt; &lt;/blockquote&gt;    &lt;p&gt;Hope that Google will find that page and the proper solution would be much more easily found!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20090507jboss-seam-211ga-on-jboss-as-501ga-table-is-not-mapped.html</guid><pubDate>Thu, 07 May 2009 18:37:46 GMT</pubDate></item></channel></rss>