我有businesskeys.properties
个文件,用于保存910000=terminalAliveCommand
等代码。
我的应用程序向pos设备发送消息并从pos设备接收消息。在xml中,我为此terminalAliveCommand
定义了bean:
<bean id="terminalAliveCommand" class="sinaps.domain.TerminalAliveCommand" scope="prototype">
<property name="sinapsDao" ref="sinapsDAO" />
</bean>
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '910000' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1068)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.config.ServiceLocatorFactoryBean$ServiceLocatorInvocationHandler.invokeServiceLocatorMethod(ServiceLocatorFactoryBean.java:368)
at org.springframework.beans.factory.config.ServiceLocatorFactoryBean$ServiceLocatorInvocationHandler.invoke(ServiceLocatorFactoryBean.java:357)
at $Proxy12.getBusinessCommand(Unknown Source)
at sinaps.dispatching.SpaceProcessor.run(SpaceProcessor.java:21)
at sinaps.dispatching.SpaceProcessor$$FastClassByCGLIB$$5b80d863.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at
sinaps.dispatching.SpaceProcessor$$EnhancerByCGLIB$$74ad957a.run(<generated>)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
我有spaceProcessor
类,它按业务代码处理请求流程:
import org.apache.commons.lang.exception.ExceptionUtils;
import org.jpos.iso.ISOException;
import org.jpos.util.LogEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sinaps.domain.exceptions.BusinessException;
import sinaps.util.StringUtil;
@SuppressWarnings("rawtypes")
public class SpaceProcessor extends ProcessorSupport {
private static final Logger LOGGER = LoggerFactory.getLogger(SpaceProcessor.class);
@SuppressWarnings("unchecked")
@Override
public void run() {
//LogEvent event = new LogEvent(this, "POSPROCESSEVENT");
try {
responseSpace.out(responseQueue, servicelocator.getBusinessCommand(msg.getString(3)).doCommand(msg));
} catch (BusinessException e) {
LOGGER.error(e.getMessage());
LOGGER.error(ExceptionUtils.getStackTrace(e));
try {
msg.setResponseMTI();
msg.set(39, (StringUtil.nullToEmpty(e.getResponseCode()).length() > 2 ? e.getResponseCode().substring(0, 2) : e.getResponseCode()));
} catch (ISOException e1) {
LOGGER.error(e1.getMessage());
e1.printStackTrace();
}
responseSpace.out(responseQueue, msg);
}
}
}
有人知道我为什么会收到此错误吗?