This content has been marked as final.
Show 3 replies
-
1. Re: Seam component not being injected
cosmo Sep 28, 2011 10:59 PM (in response to bankai)@In does not create the component by default, it just inject what is in a specific context. If you need to create the component at injection time you can do it either by specifying create=true in the @In, or annotating the injected component with @Autocreate
-
2. Re: Seam component not being injected
bankai Sep 28, 2011 11:50 PM (in response to bankai)The component is in context, I can see it in JBoss debug and if it weren't the following call would fail, wouldn't it?
contact = (Contact) Component.getInstance("contact");
As for the create=true option, I don't want seam to create a new Contact component if it can't find one in context, in this case.
-
3. Re: Seam component not being injected
bankai Oct 6, 2011 6:54 AM (in response to bankai)Seems I was missing the ejb-jar.xml file
"<?xml version="1.0" encoding="UTF-8"?> <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0"> <interceptors> <interceptor> <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> </interceptor> </interceptors> <assembly-descriptor> <interceptor-binding> <ejb-name>*</ejb-name> <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> </interceptor-binding> </assembly-descriptor> </ejb-jar>"