1
由於一些奇怪的原因,我收到以下異常。有狀態ejb上的類拋出異常
2011-02-08 09:53:30,667 ERROR [STDERR] (QuartzScheduler_Worker-9) java.lang.ClassCastException: org.javassist.tmp.java.lang.Object_$$_javassist_seam_7 cannot be cast to no.kommuneforlaget.fagsystem.saksapp.service.report.SystemlogListener
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at no.kommuneforlaget.fagsystem.saksapp.jobs.ESBLogListener.checkESBEvents(ESBLogListener.java:71)
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at no.kommuneforlaget.fagsystem.saksapp.jobs.ESBLogListener.scheduler(ESBLogListener.java:119)
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at sun.reflect.GeneratedMethodAccessor466.invoke(Unknown Source)
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2
我知道它不應該是類拋出異常,因爲它是正確的類。
的代碼是:
SystemlogListener systemlogListener = (SystemlogListener) Component.getInstance("systemlogListener", ScopeType.SESSION, true);
和類是
@Name("systemlogListener")
@Scope(ScopeType.SESSION)
@AutoCreate
@Stateful
@TransactionManagement(TransactionManagementType.CONTAINER) //default
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class SystemlogListener implements SystemlogListenerLocal, Serializable {
誰能發現我所做的錯誤呢?
當然可以。我必須一直使用該接口。我不能相信我忘了:) – 2011-02-08 10:22:35