我为大学开发了一个应用程序,但由于某些原因,我似乎无法设置它的上下文根。这是我试图做的:
从 glassfish-web.xml 更改上下文根,但它不起作用。服务器识别过 /web/ 路径(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 error-url=""> <web-uri>web</web-uri> <context-root>/</context-root> <class-loader delegate="true"/> <jsp-config> <property name="keepgenerated" value="true"> <description>Keep a copy of the generated servlet class' java code.</description> </property> </jsp-config> </glassfish-web-app>
我尝试使用 deploydir 从 asadmin 设置上下文根目录。它部署应用程序,但始终将其运行到 /web/ 路径。
我试图检查domains.xml,但我没有其他应用程序,而且我的应用程序没有将上下文根设置为属性。
我在服务器日志中看到的唯一奇怪的事情是:
SEVERE: Application previously deployed is not at its original location any more: file:/C:/Users/Danilo/Documents/NetBeansProjects/ibei/dist/gfdeploy/ibei/ WARNING: Unsupported deployment descriptors element web-uri value web. WARNING: Context path from ServletContext: /web differs from path from bundle: web
最后一个警告真的很奇怪,因为 web 应用程序被简单地称为“web”。我尝试制作 web-uri web、web.war、web_ear,但它从未将 web-uri 识别为正确的 :(