-
1. Re: Why may `@In(create = true)` not create the object?
valatharv Sep 29, 2009 5:49 PM (in response to hosamaly)What is @Name of OutletHome, post the code from where you are calling
-
2. Re: Why may `@In(create = true)` not create the object?
asookazian Sep 29, 2009 5:57 PM (in response to hosamaly)In Seam there are rules for successful injection. The names and casing of the type and instance variable matter.
It depends on if you're injecting a EJB or POJO component.
POJO:
@Name("foo") public class Foo { ... }
then use:
@In(create = true) Foo foo;
SFSB:
@Name("bar") public class Bar implements BarLocal { ... } @Local public interface BarLocal { ... }
then use:
@In(create = true) BarLocal bar;
note that in both cases, the instance name is the Seam component name.
Also note that if you use @AutoCreate at the class level, then you don't need to use create=true when you inject the component.
-
3. Re: Why may `@In(create = true)` not create the object?
asookazian Sep 29, 2009 5:58 PM (in response to hosamaly)sorry, I missed an annotation in one code snippet:
SFSB:
@Name("bar") @Stateful public class Bar implements BarLocal { ... } @Local public interface BarLocal { ... }
-
4. Re: Why may `@In(create = true)` not create the object?
cash1981 Sep 29, 2009 8:46 PM (in response to hosamaly)You dont have to have the same name on the attribute as the name of the seam component. You can also put it in value.
@In(create = true, value="outletHome") OutletHome deactivationOutletHome;
-
5. Re: Why may `@In(create = true)` not create the object?
hosamaly Sep 30, 2009 12:29 PM (in response to hosamaly)Shervin Asgari, this was exactly my problem. If the variable name does not match the component name, then it must be written in the value property of the @In annotation. Thank you.
Arbi Sookazian, this is useful information too. Thank you.