如何知道一个bug生成的一个bug生成的bean? [英] How to know the line of a bug in a spring generated bean?

查看:158
本文介绍了如何知道一个bug生成的一个bug生成的bean?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Spring和jpa(由hibernate)构建的网站。我有一个错误,我不知道如何识别错误出现的行。



我无法调试它,因为它是一个现实版本(全部在本地运行)。



我有日志说:
o

  rg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)#012#011 

在org.springframework.aop.framework.Cglib2AopProxy $ DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)#012#011

at com.mycompany.server.rpc.UserService $$ EnhancerByCGLIB $$ 64ed2d4f.createAccount(< generate>)#012# 011

at com.mycompany.server.rpc.ServiceRPCImpl.createAccount(ServiceRPCImpl.java:309)

我的问题是第三行。由于UserService对象由Spring处理,它成为一个代理,我无法知道该错误的一行。



你知道如何解决问题吗? / p>

谢谢

解决方案

是否可以将您从cglib更改为jdk代理? ( Spring AOP代理参考



基本上:如果您将bean作为接口访问,可以使用jdk代理(弹簧默认机制),从而使底层对象保持原样,并获得访问堆栈跟踪中的行号。


I've got a website build with Spring and jpa (by hibernate). I've got a bug and I don't know how to identify the line where the bug appears.

I can't debug it on my ide because it's a live version (all runs fine in local).

I've got log which says: o

rg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)#012#011

at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)#012#011

at com.mycompany.server.rpc.UserService$$EnhancerByCGLIB$$64ed2d4f.createAccount(<generated>)#012#011

at com.mycompany.server.rpc.ServiceRPCImpl.createAccount(ServiceRPCImpl.java:309)

My problem is the third line. As the UserService object is handled by Spring, it becomes a proxy and I can't know the line of the bug.

Do you know how to solve the problem ?

Thanks

解决方案

Is it possible for you to change from cglib to jdk proxy? (Spring AOP proxy reference)

Basically: if you access your beans as interfaces, you can use jdk proxies (spring default mechanism), thereby leaving the underlying object intact and gaining access to line numbers in stack traces.

这篇关于如何知道一个bug生成的一个bug生成的bean?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆