こんにちは 以前は tomcat 7 を使用していて、war ファイルを tomcat 7 (Linux サーバー上) にデプロイしていました。これで tomcat8 を (Linux サーバーに) インストールしましたが、war ファイルをデプロイしていません。私の構成は次のとおりです。
次の画像の最後の 1 つは、私の Web アプリケーションです。
メートル
私の Web.xml ファイルは次のとおりです。
<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">
<display-name>DL Access</display-name>
<listener>
<listener-class>
com.dl.pretasks.PreTasks
</listener-class>
</listener>
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.dl.dlaccess.service</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>jersey-serlvet1</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.dl.contentTags.service</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>jersey-serlvet2</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.dl.contentTags.service</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<servlet-name>jersey-serlvet3</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.dl.changeApiStatus.service</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/dl/dlaccess/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jersey-serlvet1</servlet-name>
<url-pattern>/dl/content/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jersey-serlvet2</servlet-name>
<url-pattern>/dl/content/cron</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jersey-serlvet3</servlet-name>
<url-pattern>/apistatus/*</url-pattern>
</servlet-mapping>
<error-page>
<location>/defaultErrorPage.jsp</location>
</error-page>
</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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>svc</groupId>
<artifactId>svc</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>svc Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<!-- <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId>
<version>0.9.0</version> </dependency> -->
<dependency>
<groupId>com.github.ptgoetz</groupId>
<artifactId>storm-signals</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>0.9.1-incubating</version>
<exclusions>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.2.0</version>
<exclusions>
<exclusion>
<artifactId>javax.servlet</artifactId>
<groupId>org.glassfish</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>0.98.4-hadoop2</version>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.0.0</version>
</dependency>
<!-- <dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency> -->
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
<!-- <dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency> -->
</dependencies>
<build>
<finalName>svc</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Tomcat ログ ファイル:
16-Nov-2014 20:27:44.985 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.14
16-Nov-2014 20:27:44.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 24 2014 09:01:51
16-Nov-2014 20:27:44.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.14.0
16-Nov-2014 20:27:44.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
16-Nov-2014 20:27:44.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.13.0-37-generic
16-Nov-2014 20:27:44.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
16-Nov-2014 20:27:44.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.7.0_67-b01
16-Nov-2014 20:27:44.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
16-Nov-2014 20:27:45.295 INFO [main] org.apache.catalina.core.AprLifecycleListener.init The APR based Apache Tomcat Native library which allows optimal performance in production environments was n$
16-Nov-2014 20:27:45.520 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-22410"]
16-Nov-2014 20:27:45.536 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
16-Nov-2014 20:27:45.539 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
16-Nov-2014 20:27:45.543 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
16-Nov-2014 20:27:45.543 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 636 ms
16-Nov-2014 20:27:45.568 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
16-Nov-2014 20:27:45.569 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.14
16-Nov-2014 20:27:45.609 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /etc/tools/tomcat-8.0.14/webapps/svc.war
SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
16-Nov-2014 20:27:50.074 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Error listenerStart
16-Nov-2014 20:27:50.080 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/svc] startup failed due to previous errors
16-Nov-2014 20:27:50.091 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /etc/tools/tomcat-8.0.14/webapps/svc.war has finished i$
16-Nov-2014 20:27:50.094 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /etc/tools/tomcat-8.0.14/webapps/docs
16-Nov-2014 20:27:50.145 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /etc/tools/tomcat-8.0.14/webapps/docs has finis$
16-Nov-2014 20:27:50.146 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /etc/tools/tomcat-8.0.14/webapps/examples
16-Nov-2014 20:27:50.437 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /etc/tools/tomcat-8.0.14/webapps/examples has f$
16-Nov-2014 20:27:50.437 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /etc/tools/tomcat-8.0.14/webapps/ROOT
16-Nov-2014 20:27:50.460 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /etc/tools/tomcat-8.0.14/webapps/ROOT has finis$
16-Nov-2014 20:27:50.460 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /etc/tools/tomcat-8.0.14/webapps/manager
16-Nov-2014 20:27:50.491 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /etc/tools/tomcat-8.0.14/webapps/manager has fi$
16-Nov-2014 20:27:50.491 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /etc/tools/tomcat-8.0.14/webapps/host-manager
16-Nov-2014 20:27:50.516 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /etc/tools/tomcat-8.0.14/webapps/host-manager h$
16-Nov-2014 20:27:50.526 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-22410"]
16-Nov-2014 20:27:50.535 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
16-Nov-2014 20:27:50.540 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 4996 ms
私のubuntuマシンのローカルでは、このWebアプリケーションはTomcatで正常に動作しています。しかし、ubuntuサーバーに配置してアクセスしたい場合、404エラーが発生し始めます。web.xml または pom.xml に問題があるとは思いません。その場合、ローカル マシンにデプロイするべきではなかったからです。
何か提案はありますか?