For EJB JAR files, the same resource-ref should be declared in each EJB that needs to access the data source.
对于EJBJAR文件,应该在需要访问数据源的每个EJB中声明同一资源引用。
The <resource-ref> tag is a way of saying, "This component has a dependency on an external resource." Listing 3 shows an example
<resource-ref>标签的意思就是“这个组件依赖于外部资源”。
Note that we called our database pool adserver and that is the resource-link you see in the resource-ref and the dependency.
注意,我们把数据库池称为adserver,并且这是您在resource - ref和依赖关系中看到的resource - link。
To do this, you need to specify the name of the database pool to the ref-name, which should be mapped with the resource-ref in web.xml.
为此,您需要将数据库池的名称指定为ref - name,该名称应映射到web . xml中的resource - ref。
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’属性。
In J2EE 1.3, each of those beans would define a resource-env-ref in its deployment descriptor, which it would then look up from its local namespace.
在J2EE 1.3中,每个bean都要在其部署描述符中定义一个resource - env - ref,它在以后要在其本地命名空间中查询它。
In J2EE 1.3, each of those beans would define a resource-env-ref in its deployment descriptor, which it would then look up from its local namespace.
在J2EE 1.3中,每个bean都要在其部署描述符中定义一个resource - env - ref,它在以后要在其本地命名空间中查询它。
应用推荐