我正在调试一个包含大量匿名内部类的Java程序。每当我在Eclipse的调试模式下启动程序时,我都会收到以下消息:
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
对于我的一个匿名内部类中的每个断点,我都会得到一条类似上面的消息。如何修复?我需要调试我的匿名内部类
一些额外信息:我的程序由一个大型maven项目中的4个maven模块组成。我使用Oracle的jdk1.7以相同的方式编译它们。可以肯定的是,我在所有模块的pom.xml
中添加了以下内容,但没有任何运气:
<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>
我也看过(1,2,3),但我的eclipse设置还可以。
Guice使用字节码生成AOP(面向方面编程)、更快的反射和代理循环依赖关系。
自从Guice的2.0版本以来,AOP是可选的。例如,您可以使用2.0-no_aop
:
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>2.0-no_aop</version>
</dependency>