Hi,
I am trying to develop an EJB3 application on JBOSS 4.0.3, using
Entity Beans and MySQL. The program is correct, runs, but data
created with Entities are not persisted on MySQL.
persistence.xml:
<entity-manager>
knowledgebaseEM
<jta-data-source>java:/knowledgebaseMySqlDS</jta-data-source>
jdbc:mysql://localhost:3306/knowledgebase
com.mysql.jdbc.Driver
org.hibernate.dialect.MySQLInnoDBDialect
true
When I try inject with:
@PersistenceContext (name="knowledgebaseEM")
protected EntityManager em;
The program works but don´t save the changes on mysql.
I guess that it does not get the correct EntityManager.
So, when I use:
@PersistenceContext (unitName="knowledgebaseEM")
protected EntityManager em;
I got the error:
18:02:23,625 ERROR [[ConceptServlet]] Servlet.service() for servlet ConceptServl
et threw exception
javax.ejb.EJBException: null; CausedByException is:
ConceptBean is not mapped. [from ConceptBean]
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.ja
va:46)
Can anyone tell me what is going wrong?
Thanks,
Bruno