How do we get the stacktrace for a successfully executed line in Java? It's needed to debug an issue.
I dont want a normal stacktrace, I want to know what a particular line is doing behind the scenes.
BeanFactory factory = new XmlBeanFactory(new FileSystemResource("/opt/data/ws_server.xml"));
serviceHelper = (ServiceHelper)factory.getBean("serviceHelper");
//Assuming no exceptions, print/view stack trace of above line (factory.getBean).
I want to see the stacktrace for factory.getBean - like below, to understand what factory.getBean is doing.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:757)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:721)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
- locked <0xffffffff58100608> (a java.util.concurrent.ConcurrentHashMap)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)