4

I am trying to debug a Java program that contains a fair number of anonymous inner classes. Whenever I start the program in Eclipse's debug mode, I get the following messages:

Unable to install breakpoint in my.own.code.SomeClass1$$FastClassByGuice$$21bac442
Unable to install breakpoint in my.own.code.SomeClass2$$FastClassByGuice$$7880adb3
Unable to install breakpoint in my.own.code.SomeClass2$$FastClassByGuice$$7880adb3
Unable to install breakpoint in my.own.code.SomeClass3$$FastClassByGuice$$9ac6f2a1
Unable to install breakpoint in my.own.code.SomeClass4$$FastClassByGuice$$8ae07d4b
Unable to install breakpoint in my.own.code.SomeClass4$$FastClassByGuice$$9ac6f2a1
Unable to install breakpoint in my.own.code.SomeClass5$$FastClassByGuice$$2ef92190
Unable to install breakpoint in my.own.code.SomeClass6$$FastClassByGuice$$c98d2633

For each breakpoint in one of my anonymous inner classes I get a message like those above. How do I fix that? I need to debug my anonymous inner classes.

Some extra info: My program consists of 4 maven modules inside one large maven project. I compile them all in the same way using Oracle's jdk1.7. Just to be sure, I added the following to all my modules' pom.xmls, but without any luck:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.1</version>
      <configuration>
        <debug>true</debug>
      </configuration>
    </plugin>
  </plugins>
</build>

I have also looked at (1, 2, 3), but my eclipse settings are okay.

Community
  • 1
  • 1
derabbink
  • 2,419
  • 1
  • 22
  • 47
  • Sometimes its just plain class issue can you delete bin folder and see again – manocha_ak Dec 04 '13 at 13:05
  • I get this error but my breakpoints work anyway, so I just ignore them. Are you sure your breakpoints don't work? – rjsang Dec 04 '13 at 19:20
  • 1
    Yes, I'm sure my breakpoints *don't* work. This is the weird part, since the rest of the internet seems to report that the error messages don't affect the eventual debugging. – derabbink Dec 04 '13 at 20:22
  • I've hit a similar issue and judging by the error message, the issue is actually caused by Guice - which likely uses some bytecode manipulation library internally. As reported by others, my breakpoints are being hit nonetheless... – sxc731 Dec 30 '13 at 12:27

1 Answers1

2

Guice uses bytecode generation for AOP (Aspect Oriented Programming), faster reflection, and to proxy circular dependencies.

Since version 2.0 of Guice, AOP is optional. For example you can use 2.0-no_aop:

<dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>2.0-no_aop</version>
</dependency>
Jmini
  • 9,189
  • 2
  • 55
  • 77
  • I have no idea how you can use no AOP with version 3.0 – Jmini Sep 04 '14 at 07:49
  • Jmini, I think this answer might be helpful http://stackoverflow.com/questions/16352798/how-to-configure-the-maven-dependency-for-guice-3-0-for-use-without-aop – lOlive Oct 23 '15 at 08:52