关于tomcat部署应用无法访问前端页面的问题

关于tomcat部署应用无法访问前端页面的问题,第1张

关于tomcat部署应用无法访问前端页面的问题

本文主要介绍tomcat部署应用无法访问前端页面的问题。这篇文章给你做了非常详细的介绍,对你的学习或者工作有一定的参考价值。有需要的朋友可以参考一下。

最近,ssm框架被用于实践培训项目。项目环境建立后,运行程序时,我总是遇到页面访问404错误

项目日志如下:

十一月13,202011:56:07上午org.apache.catalina.core.AprLifecycleListenerinit 信息:TheAPRbasedApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:D:\java\jdk\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/java/jdk/bin/../jre/bin/server;D:/java/jdk/bin/../jre/bin;D:/java/jdk/bin/../jre/lib/amd64;D:\java\jdk\bin;D:\java\JRE\bin;D:\ernv\gradle\gradle-6.6.1-all\gradle-6.6.1\bin;C:\sqlite3;C:\ProgramData\Oracle\Java\javapath;C:\ProgramFiles(x86)\Intel\Intel(R)ManagementEngineComponents\iCLS\;C:\ProgramFiles\Intel\Intel(R)ManagementEngineComponents\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramFiles(x86)\Intel\Intel(R)ManagementEngineComponents\DAL;C:\ProgramFiles\Intel\Intel(R)ManagementEngineComponents\DAL;C:\ProgramFiles\Intel\WiFi\bin\;C:\ProgramFiles\CommonFiles\Intel\WirelessCommon\;C:\ProgramFiles(x86)\NVIDIACorporation\PhysX\Common;C:\ProgramFiles(x86)\MicrosoftSQLServer\100\Tools\Binn\;C:\ProgramFiles\MicrosoftSQLServer\100\Tools\Binn\;C:\ProgramFiles\MicrosoftSQLServer\100\DTS\Binn\;d:\python\Scripts;D:\爬虫所需软件\数据库\;D:\Git\cmd;D:\bin;C:\ProgramFiles(x86)\MicrosoftSQLServer\110\Tools\Binn\;C:\ProgramFiles\MicrosoftSQLServer\110\Tools\Binn\;C:\ProgramFiles\MicrosoftSQLServer\110\DTS\Binn\;D:\MySQL\MySQLServer5.5\bin;D:\Python;C:\ProgramFiles\Terminus\Terminus.exe;D:\tools\myBlog\node-v12.1.0-win-x64;D:\tools\myBlog\node-v12.1.0-win-x64\node-global;D:\tools\myBlog\node-v12.1.0-win-x64\node-global\node_modules\hexo\node_modules\.bin;D:\ernv\java\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin;D:\ernv\lib\opencv\Opencv3.4.2\Opencv3.4.2\WindowSoft\opencv\build\x64\vc15\bin;I:\软件安装包\mrunit\windows系统hadoop插件-winutilsmaster\winutils-master\hadoop-2.6.3\bin;C:\Users\erbin\AppData\Local\Microsoft\WindowsApps;D:\ProGramTool\byTool\PyCharm2018.3.2\bin;D:\爬虫所需软件\数据库\mysql-5.6.43-winx64\bin;D:\tools\Programs\Fiddler;D:\IDE\JetBrains\IDEA2020.1\IntelliJIDEA2020.1\bin;C:\Users\erbin\AppData\Local\Pandoc\;D:\go\idea\GoLand2020.1\bin;D:\eclipse-jee-neon-3-win32-x86_64\eclipse;;. 十一月13,202011:56:07上午org.apache.tomcat.util.digester.SetPropertiesRulebegin 警告:[SetPropertiesRule]{Server/Service/Engine/Host/Context}Settingproperty'source'to'org.eclipse.jst.j2ee.server:CRMSystem'didnotfindamatchingproperty. 十一月13,202011:56:08上午org.apache.coyote.AbstractProtocolinit 信息:InitializingProtocolHandler["http-nio-8080"] 十一月13,202011:56:08上午org.apache.tomcat.util.net.NioSelectorPoolgetSharedSelector 信息:Usingasharedselectorforservletwrite/read 十一月13,202011:56:08上午org.apache.coyote.AbstractProtocolinit 信息:InitializingProtocolHandler["ajp-nio-8009"] 十一月13,202011:56:08上午org.apache.tomcat.util.net.NioSelectorPoolgetSharedSelector 信息:Usingasharedselectorforservletwrite/read 十一月13,202011:56:08上午org.apache.catalina.startup.Catalinaload 信息:Initializationprocessedin866ms 十一月13,202011:56:08上午org.apache.catalina.core.StandardServicestartInternal 信息:StartingserviceCatalina 十一月13,202011:56:08上午org.apache.catalina.core.StandardEnginestartInternal 信息:StartingServletEngine:ApacheTomcat/8.0.5 十一月13,202011:56:12上午org.apache.catalina.core.ApplicationContextlog 信息:NoSpringWebApplicationInitializertypesdetectedonclasspath 十一月13,202011:56:12上午org.apache.coyote.AbstractProtocolstart 信息:StartingProtocolHandler["http-nio-8080"] 十一月13,202011:56:12上午org.apache.coyote.AbstractProtocolstart 信息:StartingProtocolHandler["ajp-nio-8009"] 十一月13,202011:56:12上午org.apache.catalina.startup.Catalinastart 信息:Serverstartupin3826ms 十一月13,202011:56:13上午org.apache.catalina.core.ApplicationContextlog 信息:InitializingSpringFrameworkServlet'SpringMVC' 十一月13,202011:56:13上午org.springframework.web.servlet.DispatcherServletinitServletBean 信息:FrameworkServlet'SpringMVC':initializationstarted 十一月13,202011:56:13上午org.springframework.web.context.support.XmlWebApplicationContextprepareRefresh 信息:RefreshingWebApplicationContextfornamespace'SpringMVC-servlet':startupdate[FriNov1311:56:13CST2020];rootofcontexthierarchy 十一月13,202011:56:13上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions 信息:LoadingXMLbeandefinitionsfromfile[G:\LanguageProctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-dao.xml] 十一月13,202011:56:13上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions 信息:LoadingXMLbeandefinitionsfromfile[G:\LanguageProctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-mvc.xml] 十一月13,202011:56:13上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions 信息:LoadingXMLbeandefinitionsfromfile[G:\LanguageProctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-service.xml] 十一月13,202011:56:14上午org.springframework.context.support.PropertySourcesPlaceholderConfigurerloadProperties 信息:Loadingpropertiesfilefromclasspathresource[jdbc.properties] 十一月13,202011:56:14上午com.mchange.v2.log.MLog<clinit> 信息:MLogclientsusingjava1.4+standardlogging. 十一月13,202011:56:14上午com.mchange.v2.c3p0.C3P0Registrybanner 信息:Initializingc3p0-0.9.1.2[built21-May-200715:04:56;debug?true;trace:10] 11:56:14,733|-INFOinch.qos.logback.classic.LoggerContext[default]-CouldNOTfindresource[logback.groovy] 11:56:14,734|-INFOinch.qos.logback.classic.LoggerContext[default]-CouldNOTfindresource[logback-test.xml] 11:56:14,734|-INFOinch.qos.logback.classic.LoggerContext[default]-Foundresource[logback.xml]at[file:/G:/Language%20Proctice/java/pro/20201109/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/CRMSystem/WEB-INF/classes/logback.xml] 11:56:14,868|-INFOinch.qos.logback.core.joran.action.AppenderAction-Abouttoinstantiateappenderoftype[ch.qos.logback.core.ConsoleAppender] 11:56:14,878|-INFOinch.qos.logback.core.joran.action.AppenderAction-Namingappenderas[STDOUT] 11:56:14,911|-INFOinch.qos.logback.core.joran.action.NestedComplexPropertyIA-Assumingdefaulttype[ch.qos.logback.classic.encoder.PatternLayoutEncoder]for[encoder]property 11:56:15,026|-INFOinch.qos.logback.classic.joran.action.RootLoggerAction-SettinglevelofROOTloggertoDEBUG 11:56:15,026|-INFOinch.qos.logback.core.joran.action.AppenderRefAction-Attachingappendernamed[STDOUT]toLogger[ROOT] 11:56:15,029|-INFOinch.qos.logback.classic.joran.action.ConfigurationAction-Endofconfiguration. 11:56:15,031|-INFOinch.qos.logback.classic.joran.JoranConfigurator@5ad72777-Registeringcurrentconfigurationassafefallbackpoint 11:56:15.057[http-nio-8080-exec-2]DEBUGorg.apache.ibatis.logging.LogFactory-Logginginitializedusing'classorg.apache.ibatis.logging.slf4j.Slf4jImpl'adapter. 11:56:15.272[http-nio-8080-exec-2]DEBUGorg.apache.ibatis.io.VFS-Classnotfound:org.jboss.vfs.VFS 11:56:15.272[http-nio-8080-exec-2]DEBUGorg.apache.ibatis.io.JBoss6VFS-JBoss6VFSAPIisnotavailableinthisenvironment. 11:56:15.275[http-nio-8080-exec-2]DEBUGorg.apache.ibatis.io.VFS-Classnotfound:org.jboss.vfs.VirtualFile 11:56:15.277[http-nio-8080-exec-2]DEBUGorg.apache.ibatis.io.VFS-VFSimplementationorg.apache.ibatis.io.JBoss6VFSisnotvalidinthisenvironment. 11:56:15.277[http-nio-8080-exec-2]DEBUGorg.apache.ibatis.io.VFS-UsingVFSadapterorg.apache.ibatis.io.DefaultVFS 11:56:15.279[http-nio-8080-exec-2]DEBUGo.m.spring.SqlSessionFactoryBean-Scannedpackage:'com.crm.entity'foraliases 11:56:15.367[http-nio-8080-exec-2]DEBUGo.m.spring.SqlSessionFactoryBean-Parsedconfigurationfile:'classpathresource[mybatis-config.xml]' 11:56:15.369[http-nio-8080-exec-2]DEBUGo.m.spring.SqlSessionFactoryBean-Property'mapperLocations'wasnotspecifiedornomatchingresourcesfound 十一月13,202011:56:16上午org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapterinitControllerAdviceCache 信息:Lookingfor@ControllerAdvice:WebApplicationContextfornamespace'SpringMVC-servlet':startupdate[FriNov1311:56:13CST2020];rootofcontexthierarchy 十一月13,202011:56:16上午org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapterinitControllerAdviceCache 信息:Lookingfor@ControllerAdvice:WebApplicationContextfornamespace'SpringMVC-servlet':startupdate[FriNov1311:56:13CST2020];rootofcontexthierarchy 十一月13,202011:56:16上午org.springframework.web.servlet.handler.SimpleUrlHandlerMappingregisterHandler 信息:MappedURLpath[/resources/**]ontohandler'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0' 十一月13,202011:56:16上午org.springframework.web.servlet.handler.SimpleUrlHandlerMappingregisterHandler 信息:MappedURLpath[/**]ontohandler'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0' 十一月13,202011:56:16上午org.springframework.web.servlet.DispatcherServletinitServletBean 信息:FrameworkServlet'SpringMVC':initializationcompletedin3240ms

一开始我以为是ssm环境问题,spirng-mvc配置不正确。但是,如果仔细查看日志,您会发现:

Springmvc已经成功接管了我的静态资源。

十一月13,202011:56:13上午org.springframework.web.servlet.DispatcherServletinitServletBean 信息:FrameworkServlet'SpringMVC':initializationstarted 十一月13,202011:56:16上午org.springframework.web.servlet.DispatcherServletinitServletBean

spring的所有三个配置文件都已经加载到环境中。

十一月13,202011:56:13上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions 信息:LoadingXMLbeandefinitionsfromfile[G:\LanguageProctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-dao.xml] 十一月13,202011:56:13上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions 信息:LoadingXMLbeandefinitionsfromfile[G:\LanguageProctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-mvc.xml] 十一月13,202011:56:13上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions 信息:LoadingXMLbeandefinitionsfromfile[G:\LanguageProctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-service.xml]

资源目录和orm映射模型目录已经加载。

十一月13,202011:56:16上午org.springframework.web.servlet.handler.SimpleUrlHandlerMappingregisterHandler 信息:MappedURLpath[/resources/**]ontohandler'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0' 十一月13,202011:56:16上午org.springframework.web.servlet.handler.SimpleUrlHandlerMappingregisterHandler 信息:MappedURLpath[/**]ontohandler'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'

所以排除ssm环境配置的嫌疑,我又查了一下tomcat。

在检查了端口号没有被占用后,我把tomcat8.0.5改成了Tomcat8.5[/s2/]。
结果成功访问前端页面,这个问题解决了。

关于tomcat部署应用无法访问前端页面的问题,本文到此为止。有关tomcat部署无法访问的页面内容的更多信息,请搜索我们以前的文章或继续浏览下面的相关文章。希望大家以后能多多支持我们!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/774175.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-03
下一篇 2022-05-03

发表评论

登录后才能评论

评论列表(0条)

保存