Hello Patst,
I tried to go the way you described.I created two things.
First is a shared interface jar.
Which has an interface ITestBean with annotation @Local
and an Imports class which has the producess method:
public class Imports {
@Produces
@EJB(lookup = "java:global/Process-utils-ejb/TestBean")
private ITestBean testBean;
private Imports() {
}
}
And second is “Module” itself which contains the bean:
@Named(value = "TestBean")
@Singleton
public class TestBean implements ITestBean{
public void test(){
System.out.println("Test bean method");
}
}
But the problem is the produces annotaition throws following exception:
Can not set cz.klajmajk.process.utils.shared.interfaces.ITestBean
field cz.klajmajk.process.utils.shared.Imports.testBean
to cz.klajmajk.process.utils.shared.interfaces.ITestBean$$$view3