gpt4 book ai didi

Java servlet tomcat 404

转载 作者:行者123 更新时间:2023-11-28 23:55:16 25 4
gpt4 key购买 nike

<分区>

您好,我正在尝试使用 tomcat servlet,但我使用 app ache tomcat 9.0 创建了一个动态 Web 项目、servlet 和服务器。

我已经尝试了几乎所有的答案,但一直没有成功。

type Status report

message /OOSSP1/hello

description The requested resource is not available.

控制台日志

Feabh 13, 2017 11:47:24 A.M. org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:OOSSP1' did not find a matching property.
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.0.M17
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jan 10 2017 20:59:20 UTC
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.0.0
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_121
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_121-b13
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: E:\Documents\Development\Projects\College\.metadata\.plugins\org.eclipse.wst.server.core\tmp3
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: E:\Program Files (x86)\Tomcat\apache-tomcat-9.0.0.M17\apache-tomcat-9.0.0.M17
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=E:\Documents\Development\Projects\College\.metadata\.plugins\org.eclipse.wst.server.core\tmp3
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=E:\Program Files (x86)\Tomcat\apache-tomcat-9.0.0.M17\apache-tomcat-9.0.0.M17
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=E:\Documents\Development\Projects\College\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=E:\Program Files (x86)\Tomcat\apache-tomcat-9.0.0.M17\apache-tomcat-9.0.0.M17\endorsed
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: 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_121\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_121/bin/server;C:/Program Files/Java/jre1.8.0_121/bin;C:/Program Files/Java/jre1.8.0_121/lib/amd64;C:\Program Files (x86)\Google\Chrome\Application;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)\NVIDIA Corporation\PhysX\Common;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\Git\cmd;C:\Users\alexi\.windows-build-tools\python27;C:\Program Files\Java\jdk1.8.0_111;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\Java\jdk1.8.0_111\bin;E:\Documents\Development\Projects\OOP3_Project1\bin\application;E:\Documents\Development\Projects\OOP3_Project1\src\application;E:\Program Files (x86)\PuTTY\;C:\HashiCorp\Vagrant\bin;C:\Program Files\nodejs\;C:\Ruby23-x64\bin;C:\Users\alexi\AppData\Local\Microsoft\WindowsApps;C:\Users\alexi\AppData\Local\.meteor\;C:\Users\alexi\.windows-build-tools\python27;E:\Documents\Development\Projects\OOP3_Project1\bin\application;E:\Documents\Development\Projects\OOP3_Project1\src\application;C:\Users\alexi\AppData\Roaming\npm;E:\Downloads;;.
Feabh 13, 2017 11:47:24 A.M. org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Feabh 13, 2017 11:47:24 A.M. org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feabh 13, 2017 11:47:24 A.M. org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Feabh 13, 2017 11:47:24 A.M. org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 518 ms
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.0.M17
Feabh 13, 2017 11:47:24 A.M. org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [http-nio-8080]
Feabh 13, 2017 11:47:24 A.M. org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [ajp-nio-8009]
Feabh 13, 2017 11:47:24 A.M. org.apache.catalina.startup.Catalina start
INFO: Server startup in 236 ms

HelloServlet.java

package ie.cit.oossp;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class HelloServlet
*/
@WebServlet({ "/HelloServlet", "/hello" })
public class HelloServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public HelloServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}

}

我对此很陌生,但我不明白这怎么会如此困难,这让我发疯。

任何帮助都会很棒。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com