2015-06-24 3 views
1

Я пробовал все решения, предоставляемые стеком для этой проблемы, однако я столкнулся с той же проблемой. Я попытался изменить фасет на 3.0, но все равно проблема такая же. Может ли кто-нибудь помочь мне в этом, пожалуйста.Невозможно изменить версию факела проекта Динамический веб-модуль до 2.4

pom.xml http://maven.apache.org/maven-v4_0_0.xsd "> 4.0.0 AMPortal AMPortal войны 0.0.1-SNAPSHOT AMPortal Maven Webapp http://maven.apache.org

<properties> 
     <!-- Generic properties --> 
     <java.version>1.7</java.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    </properties> 

    <dependencies> 

    <!-- Spring framework START --> 
     <!-- http://mvnrepository.com/artifact/org.springframework/spring-core --> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-core</artifactId> 
      <version>4.1.4.RELEASE</version> 
     </dependency> 

     <!-- http://mvnrepository.com/artifact/org.springframework/spring-web --> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-web</artifactId> 
      <version>4.1.4.RELEASE</version> 
     </dependency> 

     <!-- http://mvnrepository.com/artifact/org.springframework/spring-webmvc --> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-webmvc</artifactId> 
      <version>4.1.4.RELEASE</version> 
     </dependency> 
     <!-- http://mvnrepository.com/artifact/org.springframework/spring-jdbc --> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-jdbc</artifactId> 
      <version>4.1.4.RELEASE</version> 
     </dependency> 
     <!-- Spring framework END --> 
     <!-- Spring Security Artifacts - START --> 
     <!-- http://mvnrepository.com/artifact/org.springframework.security/spring-security-web --> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-web</artifactId> 
      <version>3.2.5.RELEASE</version> 
     </dependency> 
     <!-- http://mvnrepository.com/artifact/org.springframework.security/spring-security-config --> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-config</artifactId> 
      <version>3.2.5.RELEASE</version> 
     </dependency> 
     <!-- Spring Security Artifacts - END --> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
     <!-- Jstl for jsp page --> 
     <!-- http://mvnrepository.com/artifact/javax.servlet/jstl --> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.2</version> 
     </dependency> 
     <!-- Servlet API --> 
     <!-- http://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>javax.servlet-api</artifactId> 
      <version>3.1.0</version> 
      <scope>provided</scope> 
     </dependency> 
     <!-- JSP API --> 
     <!-- http://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api --> 
     <dependency> 
      <groupId>javax.servlet.jsp</groupId> 
      <artifactId>jsp-api</artifactId> 
      <version>2.2</version> 
      <scope>provided</scope> 
     </dependency> 
     <!-- MySQL JDBC driver --> 
     <!-- http://mvnrepository.com/artifact/mysql/mysql-connector-java --> 
     <dependency> 
      <groupId>mysql</groupId> 
      <artifactId>mysql-connector-java</artifactId> 
      <version>5.1.34</version> 
     </dependency> 
    </dependencies> 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.1</version> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
    </plugin> 
    </plugins> 
    <finalName>AMPortal</finalName> 
    </build> 
</project> 

мой web.xml

<web-app id="WebApp_ID" version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 

<display-name>Archetype Created Web Application</display-name> 

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


<!-- Loads Spring Security config file --> 
<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>   
     /WEB-INF/spring-security.xml, 
     /WEB-INF/data-source-cfg.xml 
    </param-value> 
</context-param> 


<!-- Spring MVC --> 
<servlet> 
    <servlet-name>mvc-dispatcher</servlet-name> 

    <servlet-class> 
     org.springframework.web.servlet.DispatcherServlet 
    </servlet-class> 

    <load-on-startup>1</load-on-startup> 
</servlet> 

<servlet-mapping> 
    <servlet-name>mvc-dispatcher</servlet-name> 
    <url-pattern>/</url-pattern> 
</servlet-mapping> 


<!-- Spring Security Filter --> 
<filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
</filter> 

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

+0

Измените свой web.xml, то есть версию 2.4. –

+0

Какую версию Java вы используете? – arch

ответ

4

Вы имеете следующий заголовок в вашем web.xml

<web-app id="WebApp_ID" 
    version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 

В основном это говорит ваш контейнер (а также затмение), что это приложение спецификации 2.4 сервлет. Измените его, чтобы использовать заголовок 3.0 вместо

<web-app 
    version="3.0" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> 
+0

спасибо @M. Deinum! –

Смежные вопросы