exception - In Spring, why are line numbers lost for CGLib on a POJO? -


spring mvc web app:

i have stack trace w/o line numbers (shown @ bottom).

i presume due cglib running on controller. odd me, actual exception occurs in serverbatchremoterequestacceptor, pojo not injected, not controller. created in controller object.

example:

@controller class mycontroller {     mypojo pojo = new mypojo();      @requestmapping("myaction")     public void domyaction(){         pojo.methodtocausenullpointerexception()     } } 

java.lang.nullpointerexception @ mycommons.services.batchremoteprocessor.serverbatchremoterequestacceptor.acceptrequest(unknown source) @ com.proxyandvpn.web.controllers.restservicescontroller.handlegenericclientrequest(unknown source) @ com.proxyandvpn.web.controllers.restservicescontroller$$fastclassbycglib$$dff24f0f.invoke(<generated>) @ net.sf.cglib.proxy.methodproxy.invoke(methodproxy.java:191) @ org.springframework.aop.framework.cglib2aopproxy$cglibmethodinvocation.invokejoinpoint(cglib2aopproxy.java:688) 

can explain behavior me? every call under controllers without line numbers due cglib?

should write controllers interface proxies used? normal? services, have done controllers simple pojos.

spring uses cglib generate proxy objects sit in front of of components/controllers. calls components pass through cglib proxies. these proxies generated runtime, no source code, have no line numbers.

you can pretty ignore stack trace lines mention cglib, though - pretend they're not there, should transparent.

in stack trace, call restservicescontroller.handlegenericclientrequest has been proxied, call still getting there. npe occurring within serverbatchremoterequestacceptor, being invoked restservicescontroller.handlegenericclientrequest.

however, source code posted has no relation stack trace, it's hard comment why happened.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -