How to configure spring source code for debugging in eclipse

I am trying to configure spring source code in an eclipse project so that I can execute it through a debugger.

Currently, the specific line of code I'm trying to log into is this:

ApplicationContext context=new ClassPathXmlApplicationContext("classpath:spring.xml"); 

ApplicationContext and ClassPa thanksmlApplicationContext are part of org.springframework.context:

 import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; 

In the section "Java Build Path" => "Libraries" I specified the path to the org.springframework.context-sources-3.1.3.RELEASE.jar file for org.springframework.context-3.1.3. RELEASE.jar.

enter image description here

I am using spring 3.1.3 with eclipse indigo 3.7.2.

Update:

I tried adding sources.jar files to the source tab in the Debug Configurations section, but eclipse still cannot find the source.

enter image description here

+6
source share
2 answers

Try the following:

 Menu Option Run -> Debug Configurations -> Java Application Provide required inputs in "main" tab Add source jar file in source tab 

Click OK and run this newly created parameter for debugging.

If you are using a remote control, select Remote Java Application in the left pane of the debug configuration.

+1
source

Working with support for a very old system, I found that for debugging it was necessary to download a special jar file with source codes. http://central.maven.org/maven2/org/springframework/batch/spring-batch-core/ndomrelease number} . And, as mentioned in the answer above, add this jar to the source tab for debugging configuration.

0
source

Source: https://habr.com/ru/post/1445383/


All Articles