Skip to main content
Blog

How to solve Eclipse error cannot install breakpoint due to missing line number attributes

By 20 mei 2014januari 30th, 2017No Comments

Momentarily I’m working on a project in which I had some problems with the debugger. Every time I tried to install a breakpoint I got the error message ‘cannot install breakpoint, due to missing line numbers’ from Eclipse.

Eclipse cannot install breakpoint error

Somehow the breakpoint was installed however, so I could debug as usual but the error message kept popping up. At first I had taken a look at the settings of Eclipse, the project and the JVM. All looked good.

At this point it might be good to know that the project I’m working on is quite a mess (doesn’t follow conventions, tight coupling and low cohesion to give some examples). The project was already a mess when we started working on it.

One of the classes is a Service with a Spring @Service annotation, but the Service didn’t have an Interface.

package nl.first8.blog.example;

import org.springframework.stereotype.Service;

@Service("SkillService")
public class TestServiceWithoutInterface {

   public void doSomething() {
      System.out.println("Hello TestServiceWithoutInterface");
   }

}

After a colleague told me that Spring was generating the missing interface without line numbers I’ve added an interface to the Service and that did indeed solve the problem.

package nl.first8.blog.example;

public interface TestService {

   void doSomething();

}
@Service("SkillService")
public class TestServiceImpl implements TestService {

   public void doSomething() {
      System.out.println("Hello TestServiceImpl");
   }

}