Although what Scott suggests fixes your problem, here is the full picture about how it works.
In CDI 1.2, all applications are CDI enabled by default.
If there is an empty beans.xml or a beans.xml with the bean-discovery-mode="all", all classes are opted in for beans.
In the absence of the beans.xml or beans.xml with bean-discovery-mode="annotated", every class will be scanned for beans. Only the classes annotated with bean defining annotations (https://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bean_defining_annotations) are treated as beans.
In your first example, since you don't have beans.xml, the scanning for bean-defining annotations was performed. As no bean defining annotation was found, cdi was disabled. As a consequence, the injection failed.
To enable the injection, there are two solutions:1. Annotate the class HelloService with a bean defining annotations (e.g. any scopes: ApplicationScoped, RequestScoped, SessionScoped, ConversationScoped, Dependent etc). This will make HelloService a CDI bean and then Injection will succeed. 2. Add an empty beans.xml or beans.xml with beans-discovery-mode="all" under WEB-INF for .war files or META-INF for .jar files
For more information about bean archives, please refer to https://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bean_archive.