Jakarta ee 如何在ejb-jar.xml中引用websphere资源环境提供程序?
关于这个问题和这个URL(都在下面给出),我有完全相同的要求,但在ejb-jar.xml中,我知道我必须插入这个部分Jakarta ee 如何在ejb-jar.xml中引用websphere资源环境提供程序?,jakarta-ee,websphere,ejb-3.0,websphere-8,Jakarta Ee,Websphere,Ejb 3.0,Websphere 8,关于这个问题和这个URL(都在下面给出),我有完全相同的要求,但在ejb-jar.xml中,我知道我必须插入这个部分 <resource-env-ref> <resource-env-ref-name>MyConstants</resource-env-ref-name> <resource-env-ref-type>com.ibm.acme.ree.lib.Config</resource-env-
<resource-env-ref>
<resource-env-ref-name>MyConstants</resource-env-ref-name>
<resource-env-ref-type>com.ibm.acme.ree.lib.Config</resource-env-ref-type>
</resource-env-ref>
菌剂
com.ibm.acme.ree.lib.Config
但是这一部分不能直接插入到“EJBJAR”的标记中,它必须插入到子标记中,如“EnterpriseBean”或“AssemblyDescriptor”或“relationships”等,请帮助我获取这方面的确切xml代码
类似的内容可以用作起点:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
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>TestBean</ejb-name>
<session-type>Stateless</session-type>
<resource-env-ref>
<resource-env-ref-name>MyConstants</resource-env-ref-name>
<resource-env-ref-type>com.ibm.acme.ree.lib.Config</resource-env-ref-type>
</resource-env-ref>
</session>
</enterprise-beans>
</ejb-jar>
这样的东西可以作为起点:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
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>TestBean</ejb-name>
<session-type>Stateless</session-type>
<resource-env-ref>
<resource-env-ref-name>MyConstants</resource-env-ref-name>
<resource-env-ref-type>com.ibm.acme.ree.lib.Config</resource-env-ref-type>
</resource-env-ref>
</session>
</enterprise-beans>
</ejb-jar>
我现在使用@Resource进行操作,应用程序运行正常,没有任何错误,并且在共享库中为其提供了正确的REFRENTICABLE路径,我为远程类提供了Check1234 JNDI名称,现在在客户端使用ctx.lookup调用它时,我得到错误“配置无法解析”:(我需要为我的包中的资源创建存根类吗?我现在使用@resource,应用程序运行正常,没有任何错误,并且在共享库中给它提供了REFRICATABLE的正确路径,我给远程类提供了Check1234 JNDI名称,现在当我在客户端中使用ctx.lookup调用它时,我得到错误“配置无法解析”:(我是否需要为包中的资源创建存根类?