如何查看 WebLogic 部署计划的结果

发布于 2024-09-25 22:24:48 字数 315 浏览 2 评论 0原文

我正在尝试使用 weblogic 部署计划将 init-param 值添加到供应商提供的 .war 文件的 web.xml 中。

虽然我意识到我可以打开 .war 文件并只编辑其中的文件,但我更喜欢使用部署计划来完成此任务,因为我需要将 .war 文件部署到具有不同 init- 值的多个服务器上有问题的参数。

我在网上找到了很多如何做到这一点的例子,但我的努力却时好时坏。我认为,如果我能够看到部署计划对我部署的 war 文件的影响,我将能够快速找出我做错了什么。

有没有办法让我在应用部署计划后查看 weblogic (10.3.3) 应用程序的运行时部署描述符?

I'm trying to use a weblogic deployment plan to add init-param values to a vendor-provided .war file's web.xml.

While I realize that I can open the .war file and just edit the file inside, I'd prefer to use a deployment plan to accomplish this as I will need to deploy the .war file to multiple servers with different values for the init-param in question.

I have found many examples of how to do this on-line, but my efforts are hit and miss. I think that if I could see the impact of the deployment plan on my deployed war file, I would be able to quickly figure out what I am doing wrong.

Is there a way for me to view the runtime deployment descriptors of a weblogic (10.3.3) application after the deployment plan has been applied?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

九厘米的零° 2024-10-02 22:24:48

不久前我花了一些时间对此进行调查,尽管 WL10 将 WAR 解压到临时目录中,但它不会修改该位置的部署计划中列出的文件。我还尝试使用 getResource/getResourceAsStream 读取整个 web.xml,发现它也是原始的、未修改的文件。

我从来没有弄清楚 WL 如何应用这些更改,以便它们被 ServletContext 拾取,而不在其他任何地方可见。我的猜测是它使用了一些技巧来覆盖这些文件的加载并动态应用更改。

在与它斗争了一段时间后,我最终决定采用如下方式列出启动时初始化参数的值:(

    if (log.isTraceEnabled()) {
        final Enumeration<String> names = context.getInitParameterNames();
        while (names.hasMoreElements()) {
            final String key = names.nextElement();
            final String value = context.getInitParameter(key);
            log.trace("Init Parameter '{}' = '{}'", key, value);
        }
    }

使用 slf4j 进行日志记录)

当然,如果出现问题,它也没有什么帮助。部署计划和值尚未设置,但这是我能想到的最好的。

I spent some time investigating this a while back, and although WL10 unpacks the WAR in a temporary directory, it does not modify the files listed in the deployment plan in that location. I also tried using getResource/getResourceAsStream to read the whole web.xml, and found it to be the original, unmodified file as well.

I never did figure out how WL applies the changes so that they get picked up by the ServletContext without them being visible anywhere else. My guess is that it's using some trickery to override the loading of those files and applying the changes dynamically.

After fighting with it for a while, I eventually settled on something like the following to list out the values of the init parameters on startup:

    if (log.isTraceEnabled()) {
        final Enumeration<String> names = context.getInitParameterNames();
        while (names.hasMoreElements()) {
            final String key = names.nextElement();
            final String value = context.getInitParameter(key);
            log.trace("Init Parameter '{}' = '{}'", key, value);
        }
    }

(Using slf4j for the logging)

Of course it doesn't help a bit if there's something wrong with the deployment plan and the values aren't being set, but it's the best I could come up with.

花之痕靓丽 2024-10-02 22:24:48

在 12.2.1 中有一个 DebugDeploymentPlan Server 调试设置,如果打开,服务器会记录类似的内容

 <After applying the overrides from the deployment plan, the descriptor "META-INF/ejb-jar.xml" is:

In 12.2.1 there is a DebugDeploymentPlan Server debug setting, if on, the server logs something like

 <After applying the overrides from the deployment plan, the descriptor "META-INF/ejb-jar.xml" is:
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文