部署到Glassfish 4.1时无效的URL模式 [英] Invalid URL Pattern When Deploying To Glassfish 4.1

查看:125
本文介绍了部署到Glassfish 4.1时无效的URL模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户已经通过身份验证,我有一个网页过滤器可以从登录页面和索引页面重定向。最初我有一个无效的URL模式。我修复了无效模式,并尝试重新部署,只收到此:

  java.lang.IllegalArgumentException:无效的URL模式:[{ 0}] 
at org.glassfish.web.deployment.node.WebResourceCollectionNode.setElementValue(WebResourceCollectionNode.java:136)

我在应用程序中查了一下,看看我是否错过了某些东西或输入了其他错误。最后,我删除了WebFilter类,从web.xml中删除了它的映射并尝试重新部署,并且继续出现相同的错误。目前我无法重新部署应用程序。



我检查了一些Google搜索,发现这似乎是一个类似的问题,但没有解决。



完整的堆栈跟踪:

 严重:部署应用程序时出现异常[NCW-war] 
严重:生命周期处理期间的异常
java.lang.IllegalArgumentException:无效的URL模式:[{0}]
位于org.glassfish.web.deployment.node.WebResourceCollectionNode .setElementValue(WebResourceCollectionNode.java:136)
at com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:583)
at com.sun.org.apache.xerces.internal .parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:863)
at com在XML文档碎片扫描仪中, java:2973)
在com.sun.org.apache.xerces.inte rnal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
在com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
。在COM。 sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
在com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848 )
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser .parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache .xerces.internal.jaxp.SAXParserImpl $ JAXPSAXParser.parse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)$ b在com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDes criptorFile.java:318)
在com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:245)
在com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor( Archivist.java:665)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:391)
at com.sun.enterprise.deployment.archivist.Archivist.open( Archivist.java:271)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:280)
at com.sun.enterprise.deployment.archivist.Archivist.open( Archivist.java:241)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL( DolProvider.java:203)
在org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:227)
在org.glassfish.javaee.core.deployment.DolProvider.load( DolProvider.java:96)
在com.sun.enterprise.v3.server.Applic ationLifecycle.loadDeployer(ApplicationLifecycle.java:881)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:821)
at com.sun.enterprise.v3.server。 ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
位于com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
位于org.glassfish.deployment.admin.DeployCommand。在com.sun.enterprise.v3.admin.CommandRunnerImpl $ 2 $ 1.run(CommandRunnerImpl.java:539)
在com.sun.enterprise.v3.admin执行(DeployCommand.java:491)
。 CommandRunnerImpl $ 2 $ 1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl $ 2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl $ 3.run(CommandRunnerImpl.java:565 )
在com.sun.enterprise.v3.admin.CommandRunnerImpl $ 3.run(CommandRu nnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com。 sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com。 sun.enterprise.v3.admin.CommandRunnerImpl.access $ 1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper $ HttpHandlerCallable.call (ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler .runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter .handleRead(HttpServerFilter.java:235)
处org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119)
( DefaultFilterChain.java:284)在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201

在org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
在org.glassfish.gr izzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
在org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
。在org.glassfish.grizzly。 strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
。在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:56)$ b $在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy b $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)

任何帮助将不胜感激。

谢谢你,
-Jarrod


 < ?xml version =1.0encoding =UTF-8?> 
< web-app version =3.1xmlns =http://xmlns.jcp.org/xml/ns/javaeexmlns:xsi =http://www.w3.org/2001/ XMLSchema-instancexsi:schemaLocation =http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd\">
< context-param>
< param-name> javax.faces.PROJECT_STAGE< / param-name>
<参数值>开发< /参数值>
< / context-param>
< context-param>
< param-name> primefaces.THEME< / param-name>
<参数值> trontastic< /参数值>
< / context-param>
< servlet>
< servlet-name> Faces Servlet< / servlet-name>
< servlet-class> javax.faces.webapp.FacesServlet< / servlet-class>
1< / load-on-startup>
< / servlet>
< servlet-mapping>
< servlet-name> Faces Servlet< / servlet-name>
< url-pattern> *。xhtml< / url-pattern>
< / servlet-mapping>
<错误页面>
< exception-type> java.lang.SecurityException< / exception-type>
< location> /login-error.xhtml< / location>
< / error-page>
< session-config>
< session-timeout>
30
< / session-timeout>
< / session-config>
< welcome-file-list>
< welcome-file> index.xhtml< / welcome-file>
< / welcome-file-list>
<错误页面>
<错误代码> 401< /错误代码>
< location> /unauthorized-access.xhtml< / location>
< / error-page>
<错误页面>
< error-code> 403< / error-code>
< location> /unauthorized-access.xhtml< / location>
< / error-page>
<错误页面>
< error-code> 404< / error-code>
< location> /page-not-found.xhtml< / location>
< / error-page>
< security-constraint>
< display-name>安装< / display-name>
< web-resource-collection>
< web-resource-name>安装< / web-resource-name>
< url-pattern> /安装/ *< / url-pattern>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>资源< / web-resource-name>
< url-pattern> / resources / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
< description />
<角色名称>安装< /角色名称>
< / auth-constraint>
< / security-constraint>
< security-constraint>
< display-name>管理员< / display-name>
< web-resource-collection>
< web-resource-name>管理员< / web-resource-name>
< url-pattern> / NCW-war / *< / url-pattern>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>资源< / web-resource-name>
< url-pattern> / resources / *< / url-pattern>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>项目管理< / web-resource-name>
< url-pattern>项目管理/ *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
< description />
<角色名称>管理员< /角色名称>
< / auth-constraint>
< / security-constraint>
< security-constraint>
< display-name> Analyst< / display-name>
< web-resource-collection>
< web-resource-name> Analyst Pages< / web-resource-name>
< url-pattern> / analyst / *< / url-pattern>
< http-method> GET< / http-method>
< http-method> PUT< / http-method>
< http-method> HEAD< / http-method>
< http-method> POST< / http-method>
< http-method> DELETE< / http-method>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>资源< / web-resource-name>
< url-pattern> / resources / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
<角色名称>分析师< /角色名称>
< / auth-constraint>
< / security-constraint>
< security-constraint>
< display-name> WAN分析师< / display-name>
< web-resource-collection>
< web-resource-name> WAN分析网页< / web-resource-name>
< url-pattern> / analyst / wan / *< / url-pattern>
< http-method> GET< / http-method>
< http-method> PUT< / http-method>
< http-method> HEAD< / http-method>
< http-method> POST< / http-method>
< http-method> DELETE< / http-method>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>资源< / web-resource-name>
< url-pattern> / resources / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
<角色名称> WAN分析师< /角色名称>
< / auth-constraint>
< / security-constraint>
< security-constraint>
< display-name> Voice Analyst< / display-name>
< web-resource-collection>
< web-resource-name> Voice Analyst Pages< / web-resource-name>
< url-pattern> / analyst / voice / *< / url-pattern>
< http-method> GET< / http-method>
< http-method> PUT< / http-method>
< http-method> HEAD< / http-method>
< http-method> POST< / http-method>
< http-method> DELETE< / http-method>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>资源< / web-resource-name>
< url-pattern> / resources / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
<角色名称>语音分析师< /角色名称>
< / auth-constraint>
< / security-constraint>
< security-constraint>
< display-name>项目管理页面< / display-name>
< web-resource-collection>
< web-resource-name>项目管理页面< / web-resource-name>
< url-pattern> / project-management / *< / url-pattern>
< http-method> GET< / http-method>
< http-method> PUT< / http-method>
< http-method> HEAD< / http-method>
< http-method> POST< / http-method>
< / web-resource-collection>
< web-resource-collection>
< web-resource-name>资源< / web-resource-name>
< url-pattern> / resources / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
< description />
<角色名称>项目经理< /角色名称>
< / auth-constraint>
< / security-constraint>
< login-config>
< auth-method> FORM< / auth-method>
< realm-name> LDAP< / realm-name>
< form-login-config>
< form-login-page> /index.xhtml< / form-login-page>
< form-error-page> /login-error.xhtml< / form-error-page>
< / form-login-config>
< / login-config>
< security-role>
<角色名称>管理员< /角色名称>
< / security-role>
< security-role>
<角色名称>安装< /角色名称>
< / security-role>
< security-role>
<角色名称>分析师< /角色名称>
< / security-role>
< security-role>
<角色名称> WAN分析师< /角色名称>
< / security-role>
< security-role>
<角色名称>语音分析师< /角色名称>
< / security-role>
< security-role>
<角色名称>项目经理< /角色名称>
< / security-role>



应该没有过滤器 一个< url-pattern> 标记其内容没有前导斜杠。这意味着,而不是 / project-management / * 它只是 project-management / * 。看来,一个网址模式已经开始了一个主要的斜线。除了管理员之外,web.xml中的所有其他url模式都以 / 开头。也许这是你问题的根源。但是我不确定这是Glassfish问题还是Java EE规范的一部分。


I had a web filter to redirect from the login and index page if the user was already authenticated. Originally I had an invalid URL pattern. I fixed the invalid pattern and attempted to redeploy only to receive this:

java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}]
at org.glassfish.web.deployment.node.WebResourceCollectionNode.setElementValue(WebResourceCollectionNode.java:136)

I checked around in my application to see if I was missing something or had typed something else wrong. Eventually I removed the WebFilter class, removed it's mappings from the web.xml and attempted to redeploy and the same error continues to come up. Currently I am unable to redeploy the application at all.

I checked around with some Googling and came across this which seems to be a similar issue, but no resolution.

The full stacktrace:

Severe:   Exception while deploying the app [NCW-war]
Severe:   Exception during lifecycle processing
java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}]
at org.glassfish.web.deployment.node.WebResourceCollectionNode.setElementValue(WebResourceCollectionNode.java:136)
at com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:583)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:863)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:318)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:245)
at com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:665)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:391)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:271)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:280)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:241)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:203)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:227)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:881)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:821)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)

Any help would be appreciated.

Thank You, -Jarrod

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
<context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>trontastic</param-value>
</context-param>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<error-page>
    <exception-type>java.lang.SecurityException</exception-type>
    <location>/login-error.xhtml</location>
</error-page>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<error-page>
    <error-code>401</error-code>
    <location>/unauthorized-access.xhtml</location>
</error-page>
<error-page>
    <error-code>403</error-code>
    <location>/unauthorized-access.xhtml</location>
</error-page>
<error-page>
    <error-code>404</error-code>
    <location>/page-not-found.xhtml</location>
</error-page>
<security-constraint>
    <display-name>Installations</display-name>
    <web-resource-collection>
        <web-resource-name>Installations</web-resource-name>
        <url-pattern>/installations/*</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Resources</web-resource-name>
        <url-pattern>/resources/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <description/>
        <role-name>Installations</role-name>
    </auth-constraint>
</security-constraint>
<security-constraint>
    <display-name>Administrator</display-name>
    <web-resource-collection>
        <web-resource-name>Administrator</web-resource-name>
        <url-pattern>/NCW-war/*</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Resources</web-resource-name>
        <url-pattern>/resources/*</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Project Management</web-resource-name>
        <url-pattern>project-management/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <description/>
        <role-name>Administrator</role-name>
    </auth-constraint>
</security-constraint>
<security-constraint>
    <display-name>Analyst</display-name>
    <web-resource-collection>
        <web-resource-name>Analyst Pages</web-resource-name>
        <url-pattern>/analyst/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>PUT</http-method>
        <http-method>HEAD</http-method>
        <http-method>POST</http-method>
        <http-method>DELETE</http-method>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Resources</web-resource-name>
        <url-pattern>/resources/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>Analyst</role-name>
    </auth-constraint>
</security-constraint>
<security-constraint>
    <display-name>WAN Analyst</display-name>
    <web-resource-collection>
        <web-resource-name>WAN Analyst Pages</web-resource-name>
        <url-pattern>/analyst/wan/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>PUT</http-method>
        <http-method>HEAD</http-method>
        <http-method>POST</http-method>
        <http-method>DELETE</http-method>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Resources</web-resource-name>
        <url-pattern>/resources/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>WAN Analyst</role-name>
    </auth-constraint>
</security-constraint>
<security-constraint>
    <display-name>Voice Analyst</display-name>
    <web-resource-collection>
        <web-resource-name>Voice Analyst Pages</web-resource-name>
        <url-pattern>/analyst/voice/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>PUT</http-method>
        <http-method>HEAD</http-method>
        <http-method>POST</http-method>
        <http-method>DELETE</http-method>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Resources</web-resource-name>
        <url-pattern>/resources/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>Voice Analyst</role-name>
    </auth-constraint>
</security-constraint>
<security-constraint>
    <display-name>Project Manager Pages</display-name>
    <web-resource-collection>
        <web-resource-name>Project Manager Pages</web-resource-name>
        <url-pattern>/project-management/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>PUT</http-method>
        <http-method>HEAD</http-method>
        <http-method>POST</http-method>
    </web-resource-collection>
    <web-resource-collection>
        <web-resource-name>Resources</web-resource-name>
        <url-pattern>/resources/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <description/>
        <role-name>Project Manager</role-name>
    </auth-constraint>
</security-constraint>
<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>LDAP</realm-name>
    <form-login-config>
        <form-login-page>/index.xhtml</form-login-page>
        <form-error-page>/login-error.xhtml</form-error-page>
    </form-login-config>
</login-config>
<security-role>
    <role-name>Administrator</role-name>
</security-role>
<security-role>
    <role-name>Installations</role-name>
</security-role>
<security-role>
    <role-name>Analyst</role-name>
</security-role>
<security-role>
    <role-name>WAN Analyst</role-name>
</security-role>
<security-role>
    <role-name>Voice Analyst</role-name>
</security-role>
<security-role>
    <role-name>Project Manager</role-name>
</security-role>

There should be no filter in there at this time.

解决方案

The web resource collection named Administrator has a <url-pattern> tag that its content has no leading slash. That means instead of /project-management/* it's just project-management/*. It seems that a url pattern has start with a leading slash. All other url-patterns in your web.xml are started with / except the Administrator one. Maybe this is the root cause of your problem. However I'm not sure it's a Glassfish problem or is part of Java EE spec.

这篇关于部署到Glassfish 4.1时无效的URL模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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