Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Cannot attach source code of an HttpServlet(Unable to attach source file that is not on my project 'src' directory)
Cannot attach source code of an HttpServlet [message #1835787] Sat, 12 December 2020 17:38
Jim Anderson is currently offline Jim AndersonFriend
Messages: 103
Registered: October 2014
Senior Member

Eclipse IDE for Enterprise Java Developers
Version: 2020-09 (4.17.0)

It was a struggle, but I have Eclipse IDE up and running. Happily, I have found a bug or two and fixed them already.

My current problem is that I have a null pointer in one of my HttpServlets. Most of my source code is in the directory:


Eclipse sees the source code in the 'src' directory.

The HttpServlets are in the directory:


where 'abc' is the name of the project.

When running the project in debug mode, Eclipse crashs in 'SearchHandler.class' which is in the 'abc' directory. It pops up a tab for the class. Note then when it knows where the source code is, it pops up a tab in the file editor and it displays the code. In the 'SearchHandler.class' tab, it says 'Class File Editor ---- Source not found'.

Just below that, on the same tab, it says, "The source attachment does not contain the source for the file SearchHandler.class. You can change the source attachment by clicking Change Attached Source below."

I click on the button, "Change Attached Source ..." and the "Source Attachment Configuration" window popups up. It has two options, and I have tried both with no success.

Option 1:
Click on the "Workspace location" button and then I have 2 sub-options:
Option 1A: enter the path by hand
Option 1B: browse.

I chose to browse and navigated to the source directory of the HttpServlets shown above.

I then hit the 'OK' button. No acknowledgement or feedback was given. At this point the debug sessions was still running, so I terminated the session and tried starting a new session, but the same error occured.

Option 2:
Click on the "External location' button.

I then navigated the full linux path to the source code directory (it would only accept the directory, not the path to the soruce file) and hit OK. Again, no acknowledgement or feedback. Again, I tried restarting, but no success.

I am at a loss to what else to try.

I must be missing something. Can someone help?

Jim A.

Previous Topic:use different GCs for eclipse and a project
Next Topic:Eclipse not finding jar file
Goto Forum:

Current Time: Thu Jan 27 08:49:36 GMT 2022

Powered by FUDForum. Page generated in 0.01840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top