雖然從JBoss的4.3遷移到5.1以下問題發生:在部署時沒有實現EJBLocalObject的發生是否必須擴展javax.ejb.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
OK,然後我實現了接口,但JBoss的ISN」不滿意,現在抱怨:bean不能實現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 {
}
感謝您的答覆,本地和遠程是分開的,我更新了我的問題 – stacker 2011-01-14 13:29:27