Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top