I am new to EJB3 and working on an exisitng code.
We are using weblogic10.3 and the below code works fine
@Stateless(mappedName="ProcessIssacIncomingMessage")
@TransactionManagement(value=TransactionManagementType.CONTAINER)
@TransactionAttribute(value=TransactionAttributeType.REQUIRED)
@EjbRef(name="Database" jnod-name="Database")
public class IncomingMessageBean implements IncomingMessageRemote, IncomingMessageLocal {
...
@Ejb
private Database<Object> databaseBean;
in 10.3 weblogic.jar has the package weblogic.ejbgen.EjbRef
We now switching over to weblogic10.3.1 and weblogic.jar no longer comes with weblogic.ejbgen package.
So, I changed the code to this (not yet tested in 10.3.1)
@Stateless(mappedName="ProcessIssacIncomingMessage")
@TransactionManagement(value=TransactionManagementType.CONTAINER)
@TransactionAttribute(value=TransactionAttributeType.REQUIRED)
@EjbRef(name="Database" jnod-name="Database") --- removed this line
public class IncomingMessageBean implements IncomingMessageRemote, IncomingMessageLocal {
...
@Ejb(mappedName="Database") -- added the mapped name here.
private Database<Object> databaseBean;
For backward compatibility. After running the code in wl10.3 I get the error
Error is -
javax.ejb.EJBTransactionRolledbackException
: EJB Exception: :com.bea.core.repackaged.springframework.beans.factory.BeanCreationException
: Dependency injection failure: can't find the bean definition about class interfacejavax.persistence.EntityManager
; nested exception iscom.bea.core.repackaged.springframework.beans.factory.NoSuchBeanDefinitionException
: No unique bean of type [javax.persistence.EntityManager
] is defined: No beans of typejavax.persistence.EntityManager
; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationContext
: display name
Could anyone help, what / how I should refactor the code. OR what is missing here? Such that my code is compatible with both 10.3 and 10.3.1 without using @EjbRef