This content has been marked as final.
Show 1 reply
-
1. Re: EJB3StandaloneDeployer does not find annotated beans
fzuppa Oct 2, 2007 10:29 AM (in response to fzuppa)Now I realized that the problem is with the EntityManager that is injected into the SessionBean. I made a SessionBean that does not use an EntityManager and it finds it. But when I add an instance variable to be injected with the EntityManager, the session bean is not bound anymore
embedded-jboss-beans.xml<bean name="DefaultDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource"> <property name="driverClass">org.postgresql.Driver</property> <property name="connectionURL">jdbc:postgresql://localhost:5432/corptx_development</property> <property name="userName">lala</property> <property name="password">lala</property> <property name="jndiName">java:/txDS</property> <property name="minSize">1</property> <property name="maxSize">10</property> <property name="blockingTimeout">1000</property> <property name="idleTimeout">100000</property> <property name="transactionManager"><inject bean="TransactionManager"/></property> <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property> <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property> </bean> <bean name="txDS" class="java.lang.Object"> <constructor factoryMethod="getDatasource"> <factory bean="DefaultDSBootstrap"/> </constructor> </bean>
persistence.xml<persistence> <persistence-unit name="manager1"> <jta-data-source>java:/txDS</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> <!-- DESCOMENTAR PARA VER LAS QUERIES QUE SE TIRAN A LA BASE--> <!--property name="hibernate.show_sql" value="true"/--> </properties> </persistence-unit> </persistence>
and I inject my entity manger like this@PersistenceContext(unitName = "manager1") private EntityManager em;
Can it be that because there is a problem with the EntityManager, the session bean is not bound at all?