小白请教下关于ssh的问题,卡一天了

白白了白呀白 2018-01-06 11:05:43
目前正在学ssh,按照教程敲代码相关的包也引入了,web.xml struts.xml等等需要的文件也要教程弄了,但是启动tomcat不报错,输入地址却出现HTTP Status 404 – Not Found
Type Status Report

Message /Spring_Registration_5/register.jsp

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
按百度的教程找了一天了都没解决
这应该是日志的错误
[06/Jan/2018:22:41:11 +0800] "GET / HTTP/1.1" 200 11452
0:0:0:0:0:0:0:1 - - [06/Jan/2018:22:41:18 +0800] "GET /Spring_Registration_5/register.jsp HTTP/1.1" 404 1112
0:0:0:0:0:0:0:1 - - [06/Jan/2018:22:41:18 +0800] "GET /favicon.ico HTTP/1.1" 200 21630
0:0:0:0:0:0:0:1 - - [06/Jan/2018:22:41:20 +0800] "GET /Spring_Registration_5/register.jsp HTTP/1.1" 404 1112
0:0:0:0:0:0:0:1 - - [06/Jan/2018:22:41:20 +0800] "GET /favicon.ico HTTP/1.1" 200 21630
0:0:0:0:0:0:0:1 - - [06/Jan/2018:22:41:21 +0800] "GET /Spring_Registration_5/register.jsp HTTP/1.1" 404 1112
0:0:0:0:0:0:0:1 - - [06/Jan/2018:22:41:21 +0800] "GET /favicon.ico HTTP/1.1" 200 21630
视频教程是马士兵的比较早了不知道相关配置是否影响到了,代码我都是照着敲的
这是web.xml的代码
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

</web-app>

这是hibernate.cfg.xml配置
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>


<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/spring</property> //这里localhost有黄色下划线提示说localhost不正确,不懂什么意思
<property name="connection.username">root</property>
<property name="connection.password">admin</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!--
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:SXT</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
-->

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>



<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>

<!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">update</property>
-->
<mapping class="com.bjsxt.registration.model.User"/>


</session-factory>

</hibernate-configuration>

这是struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">

<struts>
<package name="registration" extends="struts-default">

<action name="user" class="com.bjsxt.registration.action.UserAction">

<result name="success">/registerSuccess.jsp</result>
<result name="fail">/registerFail.jsp</result>

</action>
</package>

</struts>
代码基本都是按照教程来的应该都不会错了,不知道是否是配置问题,麻烦大神帮小弟看一下
...全文
570 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
白白了白呀白 2018-01-07
  • 打赏
  • 举报
回复
你指的日志是哪个,我tomcat的logs文件夹下有个localhost_access的文本我上面那个日志内容就是那里复制的, 这是myeclipse启动时没有报错的内容 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.5.24 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Nov 27 2017 13:05:30 UTC 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.5.24.0 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 10.0 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: x86 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: D:\jdk\jre 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_65-b17 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\apache-tomcat-8.5.24 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\apache-tomcat-8.5.24 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:50647 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\apache-tomcat-8.5.24 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=D:\apache-tomcat-8.5.24 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=D:\apache-tomcat-8.5.24\webapps 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-8.5.24\endorsed 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.library.path=D:\jdk\bin;D:\apache-tomcat-8.5.24\bin 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=GBK 一月 07, 2018 9:24:41 上午 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: [D:\jdk\bin;D:\apache-tomcat-8.5.24\bin] 一月 07, 2018 9:24:41 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8080"] 一月 07, 2018 9:24:41 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 一月 07, 2018 9:24:41 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8009"] 一月 07, 2018 9:24:41 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1095 ms 一月 07, 2018 9:24:41 上午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 一月 07, 2018 9:24:41 上午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.5.24 一月 07, 2018 9:24:41 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\BBS2] 一月 07, 2018 9:24:42 上午 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. 一月 07, 2018 9:24:42 上午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [166] milliseconds. 一月 07, 2018 9:24:42 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\BBS2] has finished in [1,093] ms 一月 07, 2018 9:24:42 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\docs] 一月 07, 2018 9:24:42 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\docs] has finished in [23] ms 一月 07, 2018 9:24:42 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\examples] 一月 07, 2018 9:24:43 上午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 一月 07, 2018 9:24:43 上午 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\examples] has finished in [283] ms 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\host-manager] 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\host-manager] has finished in [37] ms 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\javaLearn] 一月 07, 2018 9:24:43 上午 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. 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\javaLearn] has finished in [263] ms 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\manager] 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\manager] has finished in [25] ms 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\ROOT] 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\ROOT] has finished in [13] ms 一月 07, 2018 9:24:43 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\Spring_2500_Registration_3] 一月 07, 2018 9:24:44 上午 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. 一月 07, 2018 9:24:44 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\Spring_2500_Registration_3] has finished in [1,419] ms 一月 07, 2018 9:24:44 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory [D:\apache-tomcat-8.5.24\webapps\TestTomcat] 一月 07, 2018 9:24:44 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory [D:\apache-tomcat-8.5.24\webapps\TestTomcat] has finished in [18] ms 一月 07, 2018 9:24:44 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8080"] 一月 07, 2018 9:24:44 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8009"] 一月 07, 2018 9:24:44 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 3310 ms
radeonxhl 2018-01-06
  • 打赏
  • 举报
回复
但是启动tomcat不报错:日志发上来看看

50,523

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧