在MDB中收到消息时,我收到null messageId:
String sMessageID = message.getJMSMessageID();
我的MDB部署在weblogic服务器中,当我调用message.getJMSMessageID()
时,我得到以下异常:
11:30:39.761错误c.c.s.l.t.m.l.AbstractMessageListener - 处理消息java.lang.NumberFormatException时发生异常:[JMSClientExceptions:055100]无法将null转换为long。 在weblogic.jms.common.TypeConverter.toLong(TypeConverter.java:162) 在weblogic.jms.common.MessageImpl.getLongProperty(MessageImpl.java:1104) 在com.demo.transition.mdb.listener.AbstractMessageListener.onMessage(AbstractMessageListener.java:67) at sun.reflect.GeneratedMethodAccessor415.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 在com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) 在com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) 在com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103) 在com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:117) 在com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) 在com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) 在com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 在com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(未知来源) 在com.sun.proxy。$ Proxy284.onMessage(未知来源) 在weblogic.ejb.container.internal.MDListener.execute(MDListener.java:575) 在weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477) 在weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:375) 在weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4855) 在weblogic.jms.client.JMSSession.execute(JMSSession.java:4529) 在weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3976) 在weblogic.jms.client.JMSSession.access $ 000(JMSSession.java:120) 在weblogic.jms.client.JMSSession $ UseForRunnable.run(JMSSession.java:5375) at weblogic.work.SelfTuningWorkManagerImpl $ WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:553) 在weblogic.work.ExecuteThread.execute(ExecuteThread.java:312) 在weblogic.work.ExecuteThread.run(ExecuteThread.java:264)