I think I may have a misconception of some of the intricacies of outjection and Seam component instantiation. I have a Seam component that is created by Seam via the @In(create=true) annotation. Unfortunately, I cannot seem to inject another Seam component into this component. Here's what I'm doing:
Seam component 1
@Name("comp1") @Stateful public class MySample1Bean implements MySample1 { ... @Out Connection connection = null; ... public void myMethod() { ... connection = ...; ... } }
@Name("comp2") @Stateful public class MySample2Bean implements MySample2 { ... @In(create=true) // I've also tried @In(create=true, required=false) MySample3 comp3 = null; @In Connection connection = null; ... }
@Name("comp3") @Stateful public class MySample3Bean implements MySample3 { ... @In // I've put @In(required=false) here, too just so component gets created Connection connection = null; ... }
This doesn't really look like a standard seam pattern. You would probably find it easier to use a component ma nager pattern for Connection - e.g. a @Factory, @Unwrap, or inject comp1 and do comp1.getConnection()