我在尝试在weblogic中调整应用程序的部署设置时遇到了一些麻烦。我觉得我正在努力做的事情应该很简单,但并不像预期的那样工作。为什么weblogic不使用我的部署计划?
我只是想覆盖weblogic.xml中的上下文根和数据源的JNDI名称,所以这些都可以在部署时进行配置。
我已经从ear文件中删除了application.xml,所以不应该影响覆盖。
我到目前为止有:
的weblogic.xml:
<context-root>mosaic</context-root>
<resource-description>
<res-ref-name>jdbc/LogicalDS</res-ref-name>
<jndi-name>LogicalDS</jndi-name>
</resource-description>
web.xml时,我使用
<resource-ref>
<description>A logical reference to the datasource - mapped in deployment plan</description>
<res-ref-name>jdbc/LogicalDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
的plan.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:deployment-plan xmlns:wls="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" global-variables="true">
<!--weblogic-version:10.3.5-->
<wls:application-name>mosaic.ear</wls:application-name>
<wls:variable-definition>
<wls:variable>
<wls:name>datasource_name</wls:name>
<wls:value xsi:nil="true"></wls:value>
<wls:description>The name of the datasource to map to the mosaic application</wls:description>
</wls:variable>
<wls:variable>
<wls:name>new_context_root</wls:name>
<wls:value xsi:nil="true"></wls:value>
<wls:description>URL to deploy Mosaic at</wls:description>
</wls:variable>
</wls:variable-definition>
<wls:module-override>
<wls:module-name>mosaic.war</wls:module-name>
<wls:module-type>war</wls:module-type>
<wls:module-descriptor>
<wls:root-element>weblogic-web-app</wls:root-element>
<wls:uri>WEB-INF/weblogic.xml</wls:uri>
<wls:variable-assignment>
<wls:name>new_context_root</wls:name>
<wls:xpath>/weblogic-web-app/context-root</wls:xpath>
<wls:operation>replace</wls:operation>
</wls:variable-assignment>
<wls:variable-assignment>
<wls:description>Data source for mosaic application</wls:description>
<wls:name>datasource_name</wls:name>
<wls:xpath>/weblogic-web-app/resource-env-description/resource-env-ref-name</wls:xpath>
<wls:operation>replace</wls:operation>
</wls:variable-assignment>
<wls:variable-assignment>
<wls:name>datasource_name</wls:name>
<wls:xpath>/weblogic-web-app/resource-description/[res-ref-name="jdbc/LogicalDS"]/jndi-name</wls:xpath>
<wls:operation>replace</wls:operation>
</wls:variable-assignment>
</wls:module-descriptor>
</wls:module-override>
</wls:deployment-plan>
什么也没有发生部署计划,并没有VA在管理控制台中的部署计划配置屏幕下会显示可用的页面。根据我的理解,我至少应该被要求提供这些变量,因为我已经指定它们在部署计划中为空。
当我使用WLST浏览树时,发现运行时配置只是作为部署描述符中的值保留。
我已验证部署计划正在管理控制台的常规选项卡中使用。
任何人都可以帮我找出我在这里做错了吗?
我从来没有把它出现在控制台中。 (也许几年前)。尝试删除'xsi:nil'并提供一个值,即使你没有在管理控制台中看到它,它也会提取它。 –