For EJB JAR files, the same resource-ref should be declared in each EJB that needs to access the data source.
对于EJBJAR文件,应该在需要访问数据源的每个EJB中声明同一资源引用。
Typical examples of <resource-ref> elements that are defined in the ejb-jar.xml file are JDBC data sources and JMS connection factories.
ejb-jar.xml文件中定义的 <resource-ref>元素的典型例子是JDBC数据源和JMS连接工厂。
The <resource-ref> associates the JNDI name with the CustomerServiceConnectionFactory created in the Geronimo console in the previous section.
<resource-ref> 将把JNDI名称与上一节在Geronimo控制台中创建的 CustomerServiceConnectionFactory 关联起来。
Alternatively, to enable lookup based upon global JNDI names specified as 'resource-ref-mappings', provide the 'mappedName' attribute within the @Resource annotation.
另一个选择是,激活指定为‘resource-ref-mappings’的依据全局JNDI名的查找,在@Resource注解内提供‘mappedName’属性。
Alternatively, to enable lookup based upon global JNDI names specified as 'resource-ref-mappings', provide the 'mappedName' attribute within the @Resource annotation.
另一个选择是,激活指定为‘resource-ref-mappings’的依据全局JNDI名的查找,在@Resource注解内提供‘mappedName’属性。
应用推荐