CACTUS
60
2018-01-14 16:28:58 작성 2018-01-14 16:29:57 수정됨
0
154

maven 프로젝트에서 DispatcherServlet 관련 설정 좀 도와주세요..


지금 스프링 공부중인데여 maven 프로젝트를 생성하고나서 spring mvc 기반으로 웹 만들려고 합니다.

처음 pom.xml 설정을 하고나서 web.xml에서 servlet 매핑설정을 하고 로딩이 안되는데 이부분 어디서 잘 못되었는지 알수가 없네요..

보충설명좀 부탁 드립니다.


web.xml 설정

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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"
	version="3.0" metadata-complete="true">
	<display-name>myholidays</display-name>

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

	<servlet-mapping>
		<servlet-name>myholidays</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>

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


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>com.myholidays</groupId>
	<artifactId>myholidays</artifactId>
	<version>1.0.0</version>
	<packaging>war</packaging>
	<url>http://maven.apache.org</url>

	<properties>

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

		<!-- Spring -->
		<spring-framework.version>5.0.2.RELEASE</spring-framework.version>

		<!-- Hibernate / JPA -->
		<hibernate.version>4.2.1.Final</hibernate.version>

		<!-- Logging -->
		<logback.version>1.0.13</logback.version>
		<slf4j.version>1.7.5</slf4j.version>

		<!-- Test -->
		<junit.version>4.11</junit.version>

	</properties>

	<dependencies>
		<!-- Spring and Transactions -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring-framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring-framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${spring-framework.version}</version>
		</dependency>

		<!-- Logging with SLF4J & LogBack -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${logback.version}</version>
			<scope>runtime</scope>
		</dependency>

		<!-- Hibernate -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>${hibernate.version}</version>
		</dependency>


		<!-- Test Artifacts -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring-framework.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>
		<finalName>myholidays</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
					<compilerArgument></compilerArgument>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<!-- wtp 설정 -->
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<warSourceDirectory>webapp</warSourceDirectory>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.9</version>
				<configuration>
					<wtpversion>2.0</wtpversion>
					<wtpContextName>/</wtpContextName>	<!-- webapp 최상위 경로로 변경 -->
				</configuration>
			</plugin>
			<plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>/webapp/WEB-INF/classes</directory>
                            </fileset>
                            <fileset>
                                <directory>/webapp/WEB-INF/lib</directory>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
		</plugins>
	</build>
</project>


로그

1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Server version:        Apache Tomcat/8.5.23
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Server built:          Sep 28 2017 10:30:11 UTC
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Server number:         8.5.23.0
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: OS Name:               Windows 10
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: OS Version:            10.0
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Architecture:          amd64
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Java Home:             C:\Program Files\Java\jre1.8.0_151
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: JVM Version:           1.8.0_151-b12
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: JVM Vendor:            Oracle Corporation
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: CATALINA_BASE:         C:\DEV\Spring\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: CATALINA_HOME:         C:\DEV\Spring\apache-tomcat-8.5.23
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Dcatalina.base=C:\DEV\Spring\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Dcatalina.home=C:\DEV\Spring\apache-tomcat-8.5.23
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Dwtp.deploy=C:\DEV\Spring\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Djava.endorsed.dirs=C:\DEV\Spring\apache-tomcat-8.5.23\endorsed
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.VersionLoggerListener log
정보: Command line argument: -Dfile.encoding=UTF-8
1월 14, 2018 4:18:59 오후 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
정보: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_151\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_151/bin/server;C:/Program Files/Java/jre1.8.0_151/bin;C:/Program Files/Java/jre1.8.0_151/lib/amd64;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\oraclexe\app\oracle\product\11.2.0\server\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jdk1.8.0_151\bin;C:\Program Files\Java\jdk1.8.0_151\lib\tools.jar;C:\Program Files\PuTTY\;C:\Program Files\TortoiseSVN\bin;C:\Users\home\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Bandizip\;C:\DEV\sts-bundle\sts-3.9.1.RELEASE;;.]
1월 14, 2018 4:18:59 오후 org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["http-nio-8088"]
1월 14, 2018 4:18:59 오후 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
정보: Using a shared selector for servlet write/read
1월 14, 2018 4:18:59 오후 org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["ajp-nio-8009"]
1월 14, 2018 4:18:59 오후 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
정보: Using a shared selector for servlet write/read
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.Catalina load
정보: Initialization processed in 580 ms
1월 14, 2018 4:18:59 오후 org.apache.catalina.core.StandardService startInternal
정보: Starting service [Catalina]
1월 14, 2018 4:18:59 오후 org.apache.catalina.core.StandardEngine startInternal
정보: Starting Servlet Engine: Apache Tomcat/8.5.23
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.HostConfig deployDescriptor
정보: Deploying configuration descriptor [C:\DEV\Spring\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\ROOT.xml]
1월 14, 2018 4:18:59 오후 org.apache.catalina.startup.SetContextPropertiesRule begin
경고: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:myholidays' did not find a matching property.
1월 14, 2018 4:19:02 오후 org.apache.jasper.servlet.TldScanner scanJars
정보: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
1월 14, 2018 4:19:02 오후 org.apache.catalina.core.ApplicationContext log
정보: No Spring WebApplicationInitializer types detected on classpath
1월 14, 2018 4:19:02 오후 org.apache.catalina.startup.HostConfig deployDescriptor
정보: Deployment of configuration descriptor [C:\DEV\Spring\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\ROOT.xml] has finished in [3,189] ms
1월 14, 2018 4:19:02 오후 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["http-nio-8088"]
1월 14, 2018 4:19:02 오후 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["ajp-nio-8009"]
1월 14, 2018 4:19:02 오후 org.apache.catalina.startup.Catalina start
정보: Server startup in 3223 ms


0
0
  • 답변 0

  • 로그인을 하시면 답변을 등록할 수 있습니다.