Hi!

   I'm building a proof of concept app using Tapestry + Spring Roo and am
having a little trouble trying to inject the JPA EntityManager (or
EntityManagerFactory) into one of my contribute (AppModule) methods.

   The method signature is
contributeValueEncoderSource(MappedConfiguration(Class,
ValueEncoderFactory), EntityManager, TypeCoercer, LoggerSource). The Spring
app context declares the following beans:

   - dataSource (org.apache.commons.dbcp.BasicDataSource)
   - transactionManager (org.springframework.orm.jpa.JpaTransactionManager)
   - entityManagerFactory
   (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

   I tried to change the contribute method signature to use
EntityManagerFactory instead of EntityManager but to no avail. The error
message is *No service implements the interface
javax.persistence.EntityManager*. My next try would be inject the whole
Spring app context and get the EntityManager from there but I don't think
this is the best way to resolve this dependency. What is the best way to do
it?

   Thanks,

Matheus Eduardo Machado Moreira
matheus....@gmail.com

*Good cooking takes time. If you are made to wait, it is to serve you
better, and to please you.*
Menu do Restaurant Antoine, New Orleans

Reply via email to