java一个定时任务运行报错

java.lang.RuntimeException: javax.transaction.SystemException: no context in this thread, please use proxy
at com.gd.magic.ejb3.EjbService.currentXAResource(EjbService.java:177)
at com.gd.magic.ejb3.EjbService.createQuery(EjbService.java:149)
at com.gd.magic.ejb3.EjbService.internalLoadByField(EjbService.java:497)
at com.gd.magic.ejb3.EjbService.loadByField(EjbService.java:551)
at com.gd.magic.ejb3.EjbService.loadByFields(EjbService.java:596)
at com.gd.magic.groovy.EntityMetaClass.internalInvoke(EntityMetaClass.java:105)
at com.gd.magic.groovy.ServiceMetaClass.invokeStaticMethod(ServiceMetaClass.java:123)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:50)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at com.gd.portal.pay.FusionPaymentService.rongHeQuery(FusionPaymentService.groovy:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
at com.gd.magic.groovy.ServiceMetaClass.invokeMethod(ServiceMetaClass.java:117)
at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
at com.gd.magic.groovy.ServiceMetaClass.invokeMethod(ServiceMetaClass.java:117)
at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
at com.gd.magic.groovy.ServiceMetaClass.invokeMethod(ServiceMetaClass.java:117)
at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
at com.gd.magic.groovy.ServiceMetaClass.invokeMethod(ServiceMetaClass.java:117)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at com.gd.portal.pay.TimerService.run(TimerService.groovy:29)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: javax.transaction.SystemException: no context in this thread, please use proxy
at com.gd.magic.transaction.MagicTransactionManager.getTransaction(MagicTransactionManager.java:79)
at com.gd.magic.ejb3.EjbService.currentXAResource(EjbService.java:175)
... 34 more

问题源于:
TradeRecord tradeRecord=TradeRecord.loadByMerOutTradeNo(merOutTradeNo); 这一行查询了数据库

请问怎么解决

1个回答

光看错误,看不出来具体哪里有问题,建议加上一个断点进行单步调试一下看看,具体走到哪里出的问题,

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!