Jodd proxy Unable to install breakpoint due to missing line number attributes

204 views Asked by At

I have a jodd project that uses Proxetta and JTX for creating transactions over services classes. The issue is that when I try to debug a service class I receive :

Unable to install breakpoint due to missing line number attributes

I suspect that there has something to do with they way Proxetta generates my proxies classes as it seems that in Spring if you have no interface for a class the same happens.

I use Eclispe and here how Proxetta is initialized:

public void initProxetta() {

    ProxyAspect txServiceProxy = new ProxyAspect(AnnotationTxAdvice.class,
        new MethodAnnotationPointcut(Transaction.class) {
            @Override
            public boolean apply(MethodInfo mi) {
                return isPublic(mi) &&
                        isTopLevelMethod(mi) &&
                        matchClassName(mi, "*ServiceImpl") &&
                        super.apply(mi);
            }
        });

    proxetta = ProxyProxetta.withAspects(txServiceProxy);
    proxetta.setClassLoader(this.getClass().getClassLoader());
}
1

There are 1 answers

1
igr On

Would you please try the following quickstart webapp1 example?

Its gradle project, so you can quickly import it in any IDE. In this example, we create proxy almost exactly like you above, but on actions (which should not make a difference). Now try to put a breakpoint into the IndexAction - this one gets proxified, for example. I am able to put break point there in IntelliJ IDEA.

Moreover, I dunno why Eclipse complains about the breakpoint in the service implementation class, since Proxetta as you used above creates a proxy subclass, and does not change the target class in any way. So when you put breakpoint in the service implementation code, it is in your class, not proxy class.

Finally, did you put BP on the method, or inside the code? If it is the first (on the method), then please try to put the BP inside the code of your service: eg on first line of the method body.