При переходе с JBoss 4.3 на 5.1 возникла следующая проблема:
Первое исключение возникает во время развертывания без реализации EJBLocalObject:
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
Хорошо, тогда я реализовал интерфейсы, но JBoss не удовлетворен и теперь жалуется: бин не должен реализовывать EJBLocalObject!
Есть идеи?
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
РЕДАКТИРОВАТЬ: я должен упомянуть, что bean-компонент 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 {
}