设置上下文根在Glassfish中不起作用 [英] Setting context root does not work in Glassfish

查看:100
本文介绍了设置上下文根在Glassfish中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指定一个上下文根,如下面的XML所示。但是,当我在Glassfish管理员Web控制台上手动上传War文件时,它不起作用。如果我通过glassfish的maven插件进行部署,它就可以工作。看起来Glassfish不会读取文件并使用默认名称......我错过了什么,或者是这个(又一个)错误吗?我使用的是Glassfish 3.1.2.2 build 5。
$ b $ glassfish-web.xml

 <?xml version =1.0encoding =UTF-8?> 
<!DOCTYPE glassfish-web-app PUBLIC - // GlassFish.org //DTD GlassFish应用服务器3.1 Servlet 3.0 // EN
http://glassfish.org/dtds/glassfish -web-app_3_0-1.dtd>
< glassfish-web-app>
< context-root> myContextRoot< / context-root>
< / glassfish-web-app>


解决方案

是的,这是Glassfish的一个问题。管理Web控制台有一个自己的文本字段,用于上下文根,该文本字段将自动填充战争文件的名称,而不是他的配置。当您点击部署按钮时,此值将覆盖配置文件中的上下文根。但是,asadmin的部署和所有插件蚂蚁,maven ...工作正常。


I am specifying a context root as the XML below shows. It does not work however when I upload the war file manually in the Glassfish admin web console. If I deploy it through the maven plugin for glassfish it works. It seems like Glassfish does not read the file and use the default name...Am I missing something or is this (yet another) a bug? I am using Glassfish 3.1.2.2 build 5.

glassfish-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN"
    "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
    <context-root>myContextRoot</context-root>
</glassfish-web-app>

解决方案

Yes this is an issue of Glassfish. The admin web console have an own text field for the context root which will be auto filled with the name of the war file not his config. When you hit the deploy button this value overwrites the context-root from your config file. But the asadmin deploy and all plugins ant, maven ... are working OK.

这篇关于设置上下文根在Glassfish中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆