문제

I am having a problem with weld-wicket. When @Inject-ing an EJB that inherits from an abstract class, if I attempt to call a method from the abstract class I get an ejb-ref error. However if I call a method from the concrete class it works perfectly. I can override methods and call them, and I can delegate an overridden method to the abstract class (having the overridden method call super.method()) and that works. Is there some sort of configuration I have to do to the abstract class?

Thanks.

도움이 되었습니까?

해결책

This is a guess based on my experience with Seam. Weld injects a proxy that wraps your bean. The proxy only intercepts public methods and delegates those to the underlying bean (EJB in your case). When you call a protected method on the proxy or a package-private method from a class in the same package that method is not intercepted and is invoked directly on the proxy which causes your error. To make the story short, only call public methods or back all your dependencies by an interface and inject that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top