ERROR: <table name> is not mapped
umeshgeeta Aug 9, 2005 3:04 PMHi,
I am using JBoss 4.0.3RC1 release with 'default' configuration. My database is MySQL 4.1. version and JDBC driver is "mysql-connector-java-3.1.10". My application is able to use the specified data source.
The error I get is:
javax.ejb.EJBException: null; CausedByException is:
lab_master is not mapped. [from lab_master]
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.ja
va:46)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
:134)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:88)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
erceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:88)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles
sInstanceInterceptor.java:39)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:88)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
ationInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:88)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
usInterceptor.java:93)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:88)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessCont
ainer.java:148)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalPro
xy.java:65)
at $Proxy116.getLabs(Unknown Source)
I have a table created "lab_master" in the "labuse" database or catalog of MySql. My entity bean class is BrcdLab annotated as @Entity and @Table(name="lab_master"). Auto generated integer Id is the key.
BrcdLabManager is the business interface implemented by a stateless session bean BrcdLanManagerBean where a call to "getLabs()" is implemented. The call simply returns a collection:
return em.createQuery("from lab_master").getResultList();
Reference "em" is to a @PersistentContext EntityManager as defined in persistence.xml.
The questions are:
- Why do I get "table not mapped" error?
- Error message is not revealing nor tells what could be done to solve the issue. How do we get more information about what is happening?
I searched the forum, but could not find any thread discussing "table not mapped" error issue. After loosing more than 2 days of worth, still trying to correct myself. Lack of information is frustrating. Ejb3Trailblazer runs for me and my tiny entity mapping is modelled on that example except the change of using MySQL instead of HYSQL as used in the example.
Any hints are welcome.
Thanks,
Umesh.