java.lang.IllegalArgumentException:指定的主资源集[...]无效 [英] java.lang.IllegalArgumentException: The main resource set specified [...] is not valid

查看:705
本文介绍了java.lang.IllegalArgumentException:指定的主资源集[...]无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我无法启动我的Tomcat服务器,它曾经工作,但是我做错了, code>导致:java.lang.IllegalArgumentException:指定的主资源集[E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps \workspace\j2eeapplication\target\j2eeapplication-0.0.1-SNAPSHOT]无效
在org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:643)
在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9更多

这是我的web.xml:

 <?xml version =1.0encoding = UTF-8\" >?; 
< web-app xmlns =http://xmlns.jcp.org/xml/ns/javaeexmlns: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
版本= 3.1 >

< display-name> J2EE应用示例< / display-name>

< welcome-file-list>
< welcome-file> index.jsp< / welcome-file>
< / welcome-file-list>

< context-param>
< param-name> contextConfigLocation< / param-name>
< param-value> /WEB-INF/applicationContext.xml< / param-value>
< / context-param>

< context-param>
< param-name> javax.faces.DEFAULT_SUFFIX< / param-name>
< param-value> .xhtml< / param-value>
< / context-param>

< context-param>
< param-name> facelets.DEVELOPMENT< / param-name>
< param-value> true< / param-value>
< / context-param>

< context-param>
< param-name> javax.faces.FACELETS_REFRESH_PERIOD< / param-name>
< param-value> 1< / param-value>
< / context-param>

< listener>
< listener-class> org.springframework.web.context.ContextLoaderListener< / listener-class>
< / listener>

< servlet>
< servlet-name>资源Servlet< / servlet-name>
< servlet-class> org.springframework.js.resource.ResourceServlet< / servlet-class>
< load-on-startup> 0< / load-on-startup>
< / servlet>

< servlet-mapping>
< servlet-name>资源Servlet< / servlet-name>
< url-pattern> / resources / *< / url-pattern>
< / servlet-mapping>

< servlet>
< servlet-name> Spring MVC Dispatcher Servlet< / servlet-name>
< servlet-class> org.springframework.web.servlet.DispatcherServlet< / servlet-class>
< init-param>
< param-name> contextConfigLocation< / param-name>
< param-value>< / param-value>
< / init-param>
< load-on-startup> 1< / load-on-startup>
< / servlet>

< servlet-mapping>
< servlet-name> Spring MVC Dispatcher Servlet< / servlet-name>
< url-pattern> / app / *< / url-pattern>
< / servlet-mapping>

< 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> *。jsf< / url-pattern>
< / servlet-mapping>

< filter>
< filter-name> charEncodingFilter< / filter-name>
< filter-class> org.springframework.web.filter.CharacterEncodingFilter< / filter-class>
< init-param>
< param-name> encoding< / param-name>
< param-value> UTF-8< / param-value>
< / init-param>
< init-param>
< param-name> forceEncoding< / param-name>
< param-value> true< / param-value>
< / init-param>
< / filter>

< filter-mapping>
< filter-name> charEncodingFilter< / filter-name>
< url-pattern> / *< / url-pattern>
< / filter-mapping>

< / web-app>

我在论坛上看了不同的解决方案,但没有任何效果。最终的选择将卸载tomcat和新安装,因为我看到这可能工作。感谢您提前的帮助。

解决方案

似乎您的Tomcat嵌入式服务器中引用了过时的Web应用程序(您正在使用



首先检查您服务器中部署的应用程序,然后检查工件名称​​ j2eeapplication-0.0.1-SNAPSHOT 和版本。您可能需要删除它并清理您的工作目录重新部署它,您应该是安全的。


I'm having trouble starting my Tomcat server, it used to work, but I did something wrong and now it throws me this exception:

Caused by: java.lang.IllegalArgumentException: The main resource set specified [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\workspace\j2eeapplication\target\j2eeapplication-0.0.1-SNAPSHOT] is not valid
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:643)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 9 more

And this is my web.xml :

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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"
        version="3.1">

        <display-name>J2EE Application Example</display-name>

        <welcome-file-list>
                <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>

        <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/applicationContext.xml</param-value>
        </context-param>

        <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</param-value>
        </context-param>

        <context-param>
                <param-name>facelets.DEVELOPMENT</param-name>
                <param-value>true</param-value>
        </context-param>

        <context-param>
                <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
                <param-value>1</param-value>
        </context-param>

        <listener>
                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

        <servlet>
                <servlet-name>Resources Servlet</servlet-name>
                <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
                <load-on-startup>0</load-on-startup>
        </servlet>

        <servlet-mapping>
                <servlet-name>Resources Servlet</servlet-name>
                <url-pattern>/resources/*</url-pattern>
        </servlet-mapping>

        <servlet>
                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                <init-param>
                        <param-name>contextConfigLocation</param-name>
                        <param-value></param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                <url-pattern>/app/*</url-pattern>
        </servlet-mapping>

        <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>*.jsf</url-pattern>
        </servlet-mapping>

        <filter>
                <filter-name>charEncodingFilter</filter-name>
                <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
                <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
        </filter>

        <filter-mapping>
            <filter-name>charEncodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

</web-app>

I looked at different solutions over the forums, but nothing worked. Final option will be uninstalling tomcat and fresh installation, cause I read that might work. Thanks for the help in advance.

解决方案

Seems like you have an outdated web application referenced in your Tomcat embeded server (You are using Tomcat As within Eclipse right?).

First checkout the deployed application within you server, and check the artifact name j2eeapplication-0.0.1-SNAPSHOT and version. You may need to remove it and clean your working directory the redeploy it and you should be safe.

这篇关于java.lang.IllegalArgumentException:指定的主资源集[...]无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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