特定于 WebLogic 的部署描述符 weblogic.xml 或 weblogic-ejb-jar.xml 可能包含资源环境描述元素。
这些元素会将资源环境引用映射至 JNDI 名称。
此规则会检测 WebLogic 资源环境引用 JNDI 名称。
自动修复将把 JNDI 名称迁移到 WebSphere Application Server 绑定文件。
下面举例说明了检测到的 weblogic.xml 构造:
<weblogic-web-app>
...
<resource-env-description>
<res-env-ref-name>jms/myQueue</res-env-ref-name>
<jndi-name>jndi/myQueue</jndi-name>
</resource-env-description>
...
</weblogic-web-app>
相应的资源环境引用在相应的 web.xml 文件中必须可用。
对于本示例,web.xml 文件必须包含名为 jms/myQueue 的 resource-env-ref。
<web-app>
...
<resource-env-ref>
<resource-env-ref-name>jms/myQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
...
</web-app>
自动修复将在 绑定文件中、 中的 <resource-env-ref> 元素相关联。 web.xml 文件中的 <resource-env-ref> 元素相关联。
类似地,对于 weblogic-ejb-jar.xml 构造,如果 <resource-env-description> 元素对应于所指定 EJB 的 <resource-env-ref> 元素,那么会将该 JNDI 名称保存在 WebSphere Traditional 或 Liberty 绑定中。
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>MyBean</ejb-name>
...
<reference-descriptor>
...
<resource-env-description>
<res-env-ref-name>jms/myQueue</res-env-ref-name>
<jndi-name>jndi/myQueue</jndi-name>
</resource-env-description
</reference-descriptor>
...
</weblogic-enterprise-bean>
</weblogic-ejb-jar>