JBoss EAP 7 - erroneous trace on Injected Resources
<p>I have run into an issue that I thought I might see if anyone knows the answer to.  It's not too big a problem as the resources are actually being injected - however the console is showing and informational warning that the resources failed to resolve.</p>

<p>This problem doesn't occur in EAP 5.1.2.  I was just curious if anyone else has run into the problem and possibly I'm not doing things properly in EAP 7 and thus there's a workaround.</p>

<p>Background:</p>

<ol>
<li>EJB Web Service packaged in a EAR.  EAR has no application.xml or jboss-deployment-structure.xml</li>
</ol>

<p>Note:  though I did try adding a jboss-deployment-structure.xml just to see if it helped.</p>

<ol start="2">
<li>Stateless EJB is a webservice</li>
</ol>

<p><strong>Here's a snippet from the ejb-jar.xml file:</strong></p>

<pre><code>        &lt;env-entry&gt;
            &lt;description&gt;Variable to distinguish between prod, uat and qa environments&lt;/description&gt;
            &lt;env-entry-name&gt;net.mycompany.mypackage.mysubpackage.MyWSService.isUAT&lt;/env-entry-name&gt;
            &lt;env-entry-type&gt;java.lang.Boolean&lt;/env-entry-type&gt;
            &lt;env-entry-value&gt;false&lt;/env-entry-value&gt;
        &lt;/env-entry&gt;

        &lt;env-entry&gt;
            &lt;description&gt;Variable to distinguish between prod, uat and qa environments&lt;/description&gt;
            &lt;env-entry-name&gt;isQA&lt;/env-entry-name&gt;
            &lt;env-entry-type&gt;java.lang.Boolean&lt;/env-entry-type&gt;
            &lt;env-entry-value&gt;false&lt;/env-entry-value&gt;
        &lt;/env-entry&gt;
</code></pre>

<p>As you can see, I tried it both ways, e.g. with full package and class name in env-entry-name as well as just the plain old env entries name</p>

<p><strong>Here's the Web Service code snippet:</strong></p>

<pre><code>@SuppressWarnings("unused")
@Stateless
@Local(IMyWSService.class)
@WebService
public class MyWSService implements IMyWSService {

    @Resource(name = "isUAT")
    private boolean isUAT;
    @Resource
    private boolean isQA;

    @WebMethod
    @ResponseWrapper(localName="doSomethingResponse", className="Response", targetNamespace="http://model.mysubpackage.mypackage.net")
    public Response doSomething
    (@WebParam(name="param1", mode=Mode.IN) String param1
    , @WebParam(name="param2", mode=Mode.IN) String param2
    , @WebParam(name="param3", mode=Mode.IN) String param3) {

    //more and more code
    .
    .
    .
    //pertinent method
    initAndSetEnvEntrieVars();
    .
    .
    .
    //the method which actually utilizes the environment variables
    private void initAndSetEnvEntrieVars() {
    //setup env-entry related vars
            if(isUAT){
                System.out.println("We're in UAT");

            }else if(isQA){
                System.out.println("We're in QA");
            }
    }
</code></pre>

<p><strong>Note:</strong> and again, the values are actually being injected and theres about 15 that I removed from code for brevity.</p>

<p><strong>Heres the output in JBoss console</strong></p>

<pre><code>12:43:34,919 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) WFLYDS0004: Found MyUseful.ear in deployment directory. To trigger deployment create a file called MyUseful.ear.dodeploy
12:43:34,925 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "MyUseful.ear" (runtime-name: "MyUseful.ear")
12:43:34,968 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "MyUsefulService.jar")
12:43:35,017 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0003: Processing weld deployment MyUseful.ear
12:43:35,030 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0003: Processing weld deployment MyUsefulService.jar
12:43:35,032 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-3) WFLYEJB0473: JNDI bindings for session bean named 'MyWSService' in deployment unit 'subdeployment "MyUsefulService.jar" of deployment "MyUseful.ear"' are as follows:

java:global/MyUseful/MyUsefulService/MyWSService!net.mycompany.mypackage.mysubpackage.IMyWSService 
java:app/MyUsefulService/MyWSService!net.mycompany.mypackage.mysubpackage.IMyWSService 
java:module/MyWSService!net.mycompany.mypackage.mysubpackage.IMyWSService 

12:43:35,034 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0006: Starting Services for CDI deployment: MyUseful.ear
12:43:35,036 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) WFLYWELD0009: Starting weld service for deployment MyUseful.ear
12:43:35,056 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
12:43:35,057 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
12:43:35,057 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-7) JBWS024061: Adding service endpoint metadata: id=MyWSService
 address=http://localhost:8080/MyUsefulService/MyWSService
 implementor=net.mycompany.mypackage.mysubpackage.MyWSService
 serviceName={http://model.mysubpackage.mypackage.net/}MyWSServiceService
 portName={http://model.mysubpackage.mypackage.net/}MyWSServicePort
 annotationWsdlLocation=null
 wsdlLocationOverride=null
 mtomEnabled=false
12:43:35,058 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
12:43:35,058 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
12:43:35,068 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 71) WFLYCLINF0002: Started client-mappings cache from ejb container
12:43:35,080 INFO  [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-7) Creating Service {http://model.mysubpackage.mypackage.net/}MyWSServiceService from class net.mycompany.mypackage.mysubpackage..MyWSService
12:43:35,144 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-7) Setting the server's publish address to be http://localhost:8080/MyUsefulService/MyWSService
12:43:35,146 INFO  [org.apache.cxf.common.injection.ResourceInjector] (MSC service thread 1-7) failed to resolve resource isUAT
12:43:35,147 INFO  [org.apache.cxf.common.injection.ResourceInjector] (MSC service thread 1-7) failed to resolve resource isQA
12:43:35,183 INFO  [org.jboss.ws.cxf.deployment] (MSC service thread 1-7) JBWS024074: WSDL published to: file:/C:/jboss-eap-7.0/standalone/data/wsdl/MyUseful.ear/MyUsefulService.jar/MyWSServiceService.wsdl
12:43:35,198 INFO  [org.jboss.as.webservices] (MSC service thread 1-4) WFLYWS0003: Starting service jboss.ws.endpoint."MyUseful.ear"."MyUsefulService.jar".MyWSService
12:43:35,378 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 71) WFLYUT0021: Registered web context: /MyUsefulService
12:43:35,403 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0010: Deployed "MyUseful.ear" (runtime-name : "MyUseful.ear")
</code></pre>

<p><strong>Again</strong>, this is more of just a nuisance, but I felt I'd run it by all of you just in case someone else gets stuck researching it for hours.</p>

<p><strong>Update</strong>: sorry I didnt realize the difference between StackExchange and StackOverFlow - had always wondered why the different names... but too busy to find out why.</p>