Hello you all!
We have a problem which we've been sitting with for a couple of hours. The problem is that we have an ejb-jar.xml with env-entry for the beans. We have jboss.xml that defines the JNDI names of the beans.
Code uses @Resource to get the string values from the env-entry.
We're running JBoss 4.2.1
When Jboss.xml is not present we get @Resource injection to work but the default JNDI binding.
When JBoss.xml i present we get the intended JNDI name but ResourceHandler log complains:
"14:36:16,125 WARN [ResourceHandler] Not injecting nodeID, no matching enc injec tor env/nodeID found"
jboss.xml <?xml version="1.0" encoding="utf-8" ?> <jboss> <enterprise-beans> <service> <ejb-name>WitnessServiceBean</ejb-name> <jndi-name>NotaryA/witness1/WitnessServiceBean/remote</jndi-name> </service> </enterprise-beans> </jboss>
ejb-jar.xml <?xml version="1.0" encoding="utf-8" ?> <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" 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"> <enterprise-beans> <session> <ejb-name>WitnessServiceBean</ejb-name> <env-entry> <env-entry-name>nodeID</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>NotaryA</env-entry-value> </env-entry> <env-entry> <env-entry-name>serviceID</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>witness1</env-entry-value> </env-entry> </session> </enterprise-beans> </ejb-jar>
Code: In StatessSessionBean @Resource(name="nodeID") private String nodeID; @Resource(name="serviceID") private String serviceID;
Let's see if we can get it resolved in your other post at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=118773. If it turns out to be a EJB3 issue, then lets continue the discussion here.