• maven tomcat:run指定tomcat7:


    配置好下面的内容后,执行 run as -> tomcat7:run 或者tomcat6:run可以将maven的web应用在tomcat6/7里面运行 ,eclipse Indigo 版本默认tomcat:run是用tomcat6。

     DelegatingFilterProxy cannot be cast to Filter

    请在

    settings.xml

    Xml代码  收藏代码
    1. <pluginGroups>  
    2. <pluginGroup>org.apache.tomcat.maven</pluginGroup>  
    3. </pluginGroups>  

    pom.xml

    Xml代码  收藏代码
    1. <repositories>  
    2.     <repository>  
    3.       <id>people.apache.snapshots</id>  
    4.       <url>http://repository.apache.org/content/groups/snapshots-group/</url>  
    5.       <releases>  
    6.         <enabled>false</enabled>  
    7.       </releases>  
    8.       <snapshots>  
    9.         <enabled>true</enabled>  
    10.       </snapshots>  
    11.     </repository>  
    12.   </repositories>  
    13.   
    14.   <pluginRepositories>  
    15.     <pluginRepository>  
    16.       <id>apache.snapshots</id>  
    17.       <name>Apache Snapshots</name>  
    18.       <url>http://repository.apache.org/content/groups/snapshots-group/</url>  
    19.       <releases>  
    20.         <enabled>false</enabled>  
    21.       </releases>  
    22.       <snapshots>  
    23.         <enabled>true</enabled>  
    24.       </snapshots>  
    25.     </pluginRepository>  
    26.   </pluginRepositories>  
    27.   
    28. <plugins>  
    29.     <plugin>  
    30.       <groupId>org.apache.tomcat.maven</groupId>  
    31.       <artifactId>tomcat6-maven-plugin</artifactId>  
    32.       <version>2.0-SNAPSHOT</version>  
    33.       <configuration>  
    34.   
    35.         <path>/</path>  
    36.       </configuration>  
    37.     </plugin>  
    38.     <plugin>  
    39.       <groupId>org.apache.tomcat.maven</groupId>  
    40.       <artifactId>tomcat7-maven-plugin</artifactId>  
    41.       <version>2.0-SNAPSHOT</version>  
    42.       <configuration>  
    43.         <path>/</path>  
    44.       </configuration>  
    45.     </plugin>  
    46.   </plugins  

     过程中遇到了一个情况,就是打成war包放到webapps下面运行时正常 的,但是用tomcat:run会报错:org.springframework.web.filter.DelegatingFilterProxy cannot be cast to javax.servlet.Filter;

    检查一下:

    pom.xml文件编辑器(一般要装插件才能看到)下面的dependency hierarchy 里面,在右边框图里面找到servlet-api.jar,选中后在左边,右键->exclude maven artifact,去除依赖关系。

  • 相关阅读:
    海康API——获取监控点预览取流URL,获取的rtsp流不能播放
    MySQL——ON DUPLICATE KEY UPDATE添加索引值实现重复插入变更update
    maven——pom.xml的Missing artifact net.sf.json-lib:json-lib:jar:2.4 报错问题(两种有效的解决方案)
    Mysql——navicat如何导出mysql数据表结构
    MySQL——导入导出.sql文件
    仅用U盘就可以去除XP管理员密码
    测试

    navicat 或者workbench 无法连接127.0.0.1(61)的解决方法
    在linux中添加ftp用户,并设置相应的权限
  • 原文地址:https://www.cnblogs.com/zhaoxinshanwei/p/5769379.html
Copyright © 2020-2023  润新知