【发布时间】:2020-04-10 02:02:55
【问题描述】:
我有一个界面:
public interface LogBookService extends EntityService<LogBookEntity, Long> {
void writelogNewTransaction(LogBookEntity log);
}
及其实现:
@Stateless
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class LogBookServiceImpl implements LogBookService {
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void writelogNewTransaction(logBookEntity logbook) {
final List<String> params = new ArrayList<String>();
new getRepository().merge(entity);
}
}
第三个服务:
@Stateless
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class GalaxyServiceImpl implements GalaxyService {
@Resource
private SessionContext sessionContext ;
public void test() {
for (LogBookEntity log : LogBookEntities) {
sessionContext.getBusinessObject(LogBookService.class).writelogNewTransaction(log);
}
}
}
例如,当我通过 Web 服务调用 GalaxyServiceImpl 时,我收到此错误:
SystemErr R java.lang.IllegalStateException: Requested business interface not found : LogBookService
SystemErr R at com.ibm.ejs.container.SessionBeanO.getBusinessObject(SessionBeanO.java:677)
你能告诉我为什么吗?
【问题讨论】:
标签: transactions websphere commit ejb-3.0 ejb-3.1