• tomcat热启动没问题, 访问项目报500解决办法


    新建maven项目

    添加热启动

    启动访问项目报错

    报错提示

    解决办法

    思路:包冲突

    在pom.xml中添加servlet
    
    <dependency>
    	<groupId>javax.servlet</groupId>
    	<artifactId>javax.servlet-api</artifactId>
    	<version>3.0.1</version>
    	<scope>provided</scope>
    </dependency>
    

    注释

    		<!-- <dependency>
    			<groupId>javax</groupId>
    			<artifactId>javaee-api</artifactId>
    			<version>7.0</version>
    			<scope>provided</scope>
    		</dependency> -->
            <!-- 	 <dependency>
    			<groupId>org.glassfish.web</groupId>
    			<artifactId>javax.servlet.jsp.jstl</artifactId>
    			<version>1.2.2</version>
    		</dependency> -->     
    

    完整的pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    	<groupId>11</groupId>
    	<artifactId>11</artifactId>
    	<version>0.0.1-SNAPSHOT</version>
    	<packaging>war</packaging>
    	<name>11</name>
    	<description />
    	<properties>
    		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    	</properties>
    	<dependencies>
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>javax.servlet-api</artifactId>
    			<version>3.0.1</version>
    			<scope>provided</scope>
    		</dependency>
    		<!-- <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> 
    			<version>7.0</version> <scope>provided</scope> </dependency> -->
    		<!-- <dependency> <groupId>org.glassfish.web</groupId> <artifactId>javax.servlet.jsp.jstl</artifactId> 
    			<version>1.2.2</version> </dependency> -->
    	</dependencies>
    	<build>
    		<plugins>
    			<plugin>
    				<artifactId>maven-compiler-plugin</artifactId>
    				<version>2.3.2</version>
    				<configuration>
    					<source>1.7</source>
    					<target>1.7</target>
    				</configuration>
    			</plugin>
    			<plugin>
    				<artifactId>maven-war-plugin</artifactId>
    				<version>2.2</version>
    				<configuration>
    					<version>3.1</version>
    					<failOnMissingWebXml>false</failOnMissingWebXml>
    				</configuration>
    			</plugin>
    			<plugin>
    				<groupId>org.apache.tomcat.maven</groupId>
    				<artifactId>tomcat7-maven-plugin</artifactId>
    				<configuration>
    					<port>9921</port>
    					<path>/</path>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
    </project>
    

      

  • 相关阅读:
    【转】C#中的委托和事件
    ASP.NET上传文件实例代码
    我在配置OpenCV环境以及使用VS2013运行代码时遇到的问题
    JAVA_HOME环境变量失效的解决办法
    一道int和unsigned char之间强制类型转换的题目
    为什么不看好OpenStack:它的没落不可避免[转]
    一个销前谈云桌面的适用场景(再议云桌面营销之选择正确的客户环境)
    云桌面的前世今生
    云桌面三大谎言之GPU虚拟化
    如何理解清零心态
  • 原文地址:https://www.cnblogs.com/chenglee/p/7451609.html
Copyright © 2020-2023  润新知