在从JBos4.3迁移到5.1时,出现了以下问题:
第一个例外是在部署期间,没有执行EJB LocalObject:
Caused by: java.lang.IllegalStateException: EJB 3.0 Core Specification Violation (4.6.9): The session beanÔÇÖs local interface interface com.company.project.BeanLocal must extend the javax.ejb.EJBLocalO
bject interface.
at org.jboss.metadata.annotation.creator.ejb.jboss.LocalHomeProcessor.setLocal(LocalHomeProcessor.java:73)
at org.jboss.metadata.annotation.creator.ejb.jboss.LocalHomeProcessor.process(LocalHomeProcessor.java:66)
at org.jboss.metadata.annotation.creator.ejb.jboss.LocalHomeProcessor.process(LocalHomeProcessor.java:45)
at org.jboss.metadata.annotation.creator.AbstractProcessor.processClass(AbstractProcessor.java:215)
at org.jboss.metadata.annotation.creator.AbstractProcessor.processClass(AbstractProcessor.java:172)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.j
ava:119)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.j
ava:94)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.j
ava:52)
at org.jboss.metadata.annotation.creator.AbstractCreator.process(AbstractCreator.java:154)
at org.jboss.metadata.annotation.creator.AbstractCreator.processMetaData(AbstractCreator.java:87)
at org.jboss.metadata.annotation.creator.ejb.jboss.JBoss50Creator.create(JBoss50Creator.java:109)
at org.jboss.deployment.OptAnnotationMetaDataDeployer.processJBossMetaData(OptAnnotationMetaDataDeployer.java:134)
at org.jboss.deployment.OptAnnotationMetaDataDeployer.processMetaData(OptAnnotationMetaDataDeployer.java:84)
at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:177)
... 32 more
OK, then I implemented the interfaces, but JBoss isn t satisfied and is now complaining: the bean must not implement EJBLocalObject! Any Ideas?
Caused by: java.lang.IllegalStateException: EJB 3.0 Core Specification Violation (4.6.6): The session beanÔÇÖs business interface in
terface com.company.project.BeanLocal must not extend the javax.ejb.EJBLocalObject interface.
at org.jboss.metadata.annotation.creator.ejb.jboss.LocalProcessor.addBusinessInterface(LocalProcessor.java:57)
at org.jboss.metadata.annotation.creator.ejb.jboss.LocalProcessor.process(LocalProcessor.java:76)
at org.jboss.metadata.annotation.creator.ejb.jboss.LocalProcessor.process(LocalProcessor.java:45)
at org.jboss.metadata.annotation.creator.AbstractProcessor.processClass(AbstractProcessor.java:222)
at org.jboss.metadata.annotation.creator.AbstractProcessor.processClass(AbstractProcessor.java:172)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.j
ava:119)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.j
ava:94)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.j
ava:52)
at org.jboss.metadata.annotation.creator.AbstractCreator.process(AbstractCreator.java:154)
at org.jboss.metadata.annotation.creator.AbstractCreator.processMetaData(AbstractCreator.java:87)
at org.jboss.metadata.annotation.creator.ejb.jboss.JBoss50Creator.create(JBoss50Creator.java:109)
at org.jboss.deployment.OptAnnotationMetaDataDeployer.processJBossMetaData(OptAnnotationMetaDataDeployer.java:134)
at org.jboss.deployment.OptAnnotationMetaDataDeployer.processMetaData(OptAnnotationMetaDataDeployer.java:84)
at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:177)
... 32 more
EDIT:我应该提到,信使是EJB3.0,也提供了EJB 2.1客户的观点。
声明认为:
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@Stateless
@RemoteHome(R2PRegistrationHome.class)
@RemoteHomeBinding(jndiBinding = JNDINames.BEAN_FOR_EJB_2_1_EJBHOME)
@LocalHome(R2PRegistrationLocalHome.class)
@LocalHomeBinding(jndiBinding = JNDINames.BEAN_FOR_EJB_2_1_LOCALHOME)
public class Bean implements BeanLocal, BeanRemote {
}