将EJB3与Spring集成
Bean.xml如下所示 -
<bean id="perilEjbReference" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<property name="jndiName" value="java:comp/env/perilEJB3/PerilStatelessSessionBean"/>
<property name="businessInterface" value="perilEJB3.PerilStatelessSessionBeanLocal"/>
</bean>
客户等级如下所示 -
PerilStatelessSessionBeanLocal perilEjbReference;
public PerilStatelessSessionBeanLocal getPerilStatelessSessionBeanLocal() {
return perilEjbReference;
}
public void setPerilStatelessSessionBeanLocal(PerilStatelessSessionBeanLocal perilEjbReference) {
this.perilEjbReference = perilEjbReference;
}
会话Bean如下所示 -
@Stateless(mappedName="PerilStatelessSessionBean")
@Local(PerilStatelessSessionBeanLocal.class)
public class PerilStatelessSessionBean implements PerilStatelessSessionBeanLocal {
我收到以下异常 -
CWWAM0003E:验证注释时发生异常:com.ibm.wsspi.amm.validate.ValidationException:对于方法,org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean [com.ibm.ws.amm .scan.util.info.impl.MethodInfoImpl @ 35039510(org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean)],指定了参数,但是null是预期的比较 com.ibm.wsspi.amm.validate.ValidationException:对于方法,org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean [com.ibm.ws.amm.scan.util.info.impl.MethodInfoImpl@35039510(org.springframework) .ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean)],指定了参数,但是null是预期的比较 在com.ibm.ws.amm.validate.common.lifecycle.BaseLifecycleValidator.validateCommon(BaseLifecycleValidator.java:114) 在com.ibm.ws.amm.validate.ejb.lifecycle.BaseEJBLifecycleValidator.validate(BaseEJBLifecycleValidator.java:151) 在com.ibm.ws.amm.validate.common.lifecycle.PostConstructValidator.validate(PostConstructValidator.java:54) 在com.ibm.wsspi.amm.merge.AbstractMergeAction.mergeMethodTargets(AbstractMergeAction.java:271) 在com.ibm.wsspi.amm.merge.AbstractMergeAction.merge(AbstractMergeAction.java:105) 在com.ibm.ws.amm.AnnotativeMetadataManagerImpl.performMergeOperations(AnnotativeMetadataManagerImpl.java:472) at com.ibm.ws.amm.AnnotativeMetadataManagerImpl.merge(AnnotativeMetadataManagerImpl.java:269) 在com.ibm.ws.amm.commonarchive.AnnotationsProcessorImpl.merge(AnnotationsProcessorImpl.java:132) 在com.ibm.ws.amm.commonarchive.AnnotationsProcessorImpl.merge(AnnotationsProcessorImpl.java:64) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.processEJBAnnotations(WARFileImpl.java:2523) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getEJBDeploymentDescriptor(WARFileImpl.java:2196) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getEJBDeploymentDescriptor(WARFileImpl.java:2021) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getEJBDeploymentDescriptor(WARFileImpl.java:2014) 在com.ibm.ws.amm.merge.ejb.manager.EJBData.getDescriptor(EJBData.java:170) 在com.ibm.ws.amm.merge.ejb.manager.EJBData.initEJBData(EJBData.java:104) at com.ibm.ws.amm.merge.ejb.manager.EJBDataManager.getEJBData(EJBDataManager.java:85) 在com.ibm.ws.amm.merge.ejb.TransactionAttributeMergeAction.merge(TransactionAttributeMergeAction.java:115) 在com.ibm.ws.amm.AnnotativeMetadataManagerImpl.performMergeOperations(AnnotativeMetadataManagerImpl.java:472) at com.ibm.ws.amm.AnnotativeMetadataManagerImpl.merge(AnnotativeMetadataManagerImpl.java:269) 在com.ibm.ws.amm.commonarchive.AnnotationsProcessorImpl.merge(AnnotationsProcessorImpl.java:132) 在com.ibm.ws.amm.commonarchive.AnnotationsProcessorImpl.merge(AnnotationsProcessorImpl.java:64) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.processAnnotations(WARFileImpl.java:867) 在com.ibm.ws.webfragmerger.WebFragMergerImpl.merge(WebFragMergerImpl.java:495) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.mergeAnnotationsAndFragments(WARFileImpl.java:813) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:641) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:360) 在org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:342) 在com.ibm.etools.commonarchive.impl.WARFileImpl.getBindings(WARFileImpl.java:876) 在com.ibm.etools.commonarchive.impl.WARFileImpl.getStandardBindings(WARFileImpl.java:945) 在com.ibm.etools.commonarchive.impl.EARFileImpl.getBindings(EARFileImpl.java:695) 在com.ibm.ws.odc.cell.TreeBuilder.processWebModule(TreeBuilder.java:2322) 在com.ibm.ws.odc.cell.TreeBuilder.readApplication(TreeBuilder.java:2007) 在com.ibm.ws.odc.cell.TreeBuilder.readApplication(TreeBuilder.java:1857) 在com.ibm.ws.odc.cell.TreeBuilder.doConfigChangePostProcessing(TreeBuilder.java:3243) 在com.ibm.ws.odc.cell.TreeBuilder.handleConfigChange(TreeBuilder.java:3096) 在com.ibm.ws.odc.cell.TreeBuilder.configChanged(TreeBuilder.java:3040) 在com.ibm.ws.odc.cell.TreeBuilder $ LocalEventListener.configChanged(TreeBuilder.java:5155) 在com.ibm.ws.management.component.ConfigChangeHandler $ ConfigChangeEventDispatcher.run(ConfigChangeHandler.java:365) 在com.ibm.ws.management.component.ConfigChangeHandler.alarm(ConfigChangeHandler.java:167) 在com.ibm.ejs.util.am._Alarm.run(_Alarm.java:127) 在com.ibm.ws.util.ThreadPool $ Worker.run(ThreadPool.java:1650)