Error Rendering View with JBoss AS 5.1, Seam 2.2 and JBoss Tools 3.1


May 23, 2010 by huionn

I was following Getting Started Guide for JBoss Tools ( to create CRUD web page from database with New > Seam Generate Entities. With Seam 2.2.0GA, JBoss AS 5.1GA and JBoss Tools 3.1GA, an exception was thrown when I accessed the generated page

SEVERE [viewhandler] Error Rendering View[/CustomerList.xhtml]
javax.el.ELException: /CustomerList.xhtml: Error reading ‘resultList’ on type org.domain.jbdswar220cr1v4.session.CustomerList_$$_javassist_seam_2
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Customer is not mapped [select customer from Customer customer]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(
Caused by: org.hibernate.hql.ast.QuerySyntaxException: Customer is not mapped [select customer from Customer customer]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(

I could not google a straightforward solution to this, but it lead me to

<!– If you are still using JBoss 4, uncomment this to have you PU started –>
<!– <persistence:entity-manager-factory name="entityManagerFactory"

<persistence:managed-persistence-context name="entityManager" auto-create="true"

So, the root cause is that JBoss 5 uses different mechanism (persistence-unit-jndi-name instead of entity-manager-factory) for managed-persistence-context. After understand it, it is easy to fix the problem. Open the components.xml, edit persistence:managed-persistence-context accordingly.


<persistence:managed-persistence-context name="entityManager" auto-create="true"


<persistence-unit name="workshop" transaction-type="JTA">
         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="" value="update"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <!– Only relevant if Seam is loading the persistence unit (Java SE bootstrap) –>
         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
         <property name="" value="java:/workshopEntityManagerFactory"/>

persistence-unit-jndi-name must be same as (add if it is not there)


JBoss Tools and Seam may be developed by different teams and both need to support multiple platform (application servers, web servers, different version of JBoss products), so it is understandable and pardonable to have this kind of problem in release (from the JIRA, it shows that the patch was committed just after GA release). However, at least it should be clearly documented in Getting Started Guide as it will be used by anybody who want to try out Seam. Otherwise I think many people will back off because losing confidence in Seam/JBoss Tools.


One thought on “Error Rendering View with JBoss AS 5.1, Seam 2.2 and JBoss Tools 3.1

  1. Denis says:

    huionn, thanks, your solution was very useful!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: