我的OEP应用程序需要帮助。我正在尝试使用自己的转换器bean转换jms入站消息。但是在部署时我遇到了以下异常。
线程“SpringOsgiExtenderThread-171”中的异常 org.springframework.beans.FatalBeanException:上下文错误 生命周期初始化;嵌套异常是 java.lang.IllegalArgumentException:converter-bean MessageConverter 没有实现InboundMessageConverter com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:146) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) 在 org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324) 在 org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:929) 在 org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235) 在 org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext $ 4.run(AbstractDelegatedExecutionApplicationContext.java:358) 在 org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) 在 org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) 在 org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor $ CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136) 在java.lang.Thread.run(Thread.java:745)引起: java.lang.IllegalArgumentException:converter-bean MessageConverter 没有实现InboundMessageConverter com.bea.wlevs.adapters.jms.InboundJmsAdapter.initialize(InboundJmsAdapter.java:122) 在 com.bea.wlevs.adapters.jms.InboundJmsAdapter.beforeResume(InboundJmsAdapter.java:228) 在 com.bea.wlevs.adapters.jms.InboundJmsAdapter $$ FastClassByCGLIB $$ fc18e7ee.invoke() 在net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)at org.springframework.aop.framework.Cglib2AopProxy $ CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) 在 com.bea.wlevs.ede.impl.EventManagerAccessorProxy.invoke(EventManagerAccessorProxy.java:30) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 在 com.bea.wlevs.ede.impl.EventBeanProxy.invoke(EventBeanProxy.java:38) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 在 org.springframework.aop.framework.Cglib2AopProxy $ DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) 在 com.bea.wlevs.adapters.jms.InboundJmsAdapter $$ EnhancerByCGLIB $$ fbc02af8.beforeResume() 在 com.bea.wlevs.spring.ActivationBeanPostProcessor.preProcessBeforeContextResume(ActivationBeanPostProcessor.java:27) 在 com.bea.wlevs.spring.DeferredBeanPostProcessor.beforeResume(DeferredBeanPostProcessor.java:33) 在 com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:120) ... 9更多
我的课程如下......
import com.bea.wlevs.adapters.jms.api.InboundMessageConverter; import com.bea.wlevs.adapters.jms.api.MessageConverterException; import com.bea.wlevs.adapters.jms.api.OutboundMessageConverter; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Session; import javax.jms.TextMessage; import java.util.ArrayList; import java.util.List;
public class MessageConverter implements InboundMessageConverter, OutboundMessageConverter{
public List<TestEvent> convert(Message message) throws MessageConverterException, JMSException {
TestEvent event = new TestEvent();
TextMessage textMessage = (TextMessage) message;
event.setString_1(textMessage.getText());
List<TestEvent> events = new ArrayList<TestEvent>(1);
events.add(event);
return events;
}
public List<Message> convert(Session session, Object inputEvent) throws MessageConverterException, JMSException {
TestEvent event = (TestEvent) inputEvent;
TextMessage message = session.createTextMessage("Text message: " + event.getString_1());
List<Message> messages = new ArrayList<Message>();
messages.add(message);
return messages;
} }
答案 0 :(得分:0)
你添加了&#34; com.bea.wlevs.adapters.jms.api&#34;在&#34; Import-Package&#34; MANIFEST.MF文件的一部分?
HTH