tomcat部署web项目常见问题(关于tomcat部署应用无法访问前端页面的问题)
类别:服务器 浏览量:2810
时间:2022-01-24 00:35:45 tomcat部署web项目常见问题
关于tomcat部署应用无法访问前端页面的问题最近在做实训项目的时候使用到了 ssm框架,在项目环境搭建好后,运行程序时,一直遇到页面访问404错误。
项目运行日志如下:
十一月 13, 2020 11:56:07 上午 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.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:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;d:\python\Scripts;D:\爬虫所需软件\数据库\;D:\Git\cmd;D:\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;D:\MySQL\MySQL Server 5.5\bin;D:\Python;C:\Program Files\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\PyCharm 2018.3.2\bin;D:\爬虫所需软件\数据库\mysql-5.6.43-winx64\bin;D:\tools\Programs\Fiddler;D:\IDE\JetBrains\IDEA 2020.1\IntelliJ IDEA 2020.1\bin;C:\Users\erbin\AppData\Local\Pandoc\;D:\go\idea\GoLand 2020.1\bin;D:\eclipse-jee-neon-3-win32-x86_64\eclipse;;. 十一月 13, 2020 11:56:07 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:CRMSystem' did not find a matching property. 十一月 13, 2020 11:56:08 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8080"] 十一月 13, 2020 11:56:08 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 十一月 13, 2020 11:56:08 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8009"] 十一月 13, 2020 11:56:08 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 十一月 13, 2020 11:56:08 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 866 ms 十一月 13, 2020 11:56:08 上午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 十一月 13, 2020 11:56:08 上午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.0.5 十一月 13, 2020 11:56:12 上午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 十一月 13, 2020 11:56:12 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8080"] 十一月 13, 2020 11:56:12 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8009"] 十一月 13, 2020 11:56:12 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 3826 ms 十一月 13, 2020 11:56:13 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'SpringMVC' 十一月 13, 2020 11:56:13 上午 org.springframework.web.servlet.DispatcherServlet initServletBean 信息: FrameworkServlet 'SpringMVC': initialization started 十一月 13, 2020 11:56:13 上午 org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh 信息: Refreshing WebApplicationContext for namespace 'SpringMVC-servlet': startup date [Fri Nov 13 11:56:13 CST 2020]; root of context hierarchy 十一月 13, 2020 11:56:13 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [G:\Language Proctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-dao.xml] 十一月 13, 2020 11:56:13 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [G:\Language Proctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-mvc.xml] 十一月 13, 2020 11:56:13 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [G:\Language Proctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-service.xml] 十一月 13, 2020 11:56:14 上午 org.springframework.context.support.PropertySourcesPlaceholderConfigurer loadProperties 信息: Loading properties file from class path resource [jdbc.properties] 十一月 13, 2020 11:56:14 上午 com.mchange.v2.log.MLog <clinit> 信息: MLog clients using java 1.4+ standard logging. 十一月 13, 2020 11:56:14 上午 com.mchange.v2.c3p0.C3P0Registry banner 信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10] 11:56:14,733 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 11:56:14,734 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 11:56:14,734 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [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 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] 11:56:14,878 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT] 11:56:14,911 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property 11:56:15,026 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG 11:56:15,026 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT] 11:56:15,029 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration. 11:56:15,031 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5ad72777 - Registering current configuration as safe fallback point 11:56:15.057 [http-nio-8080-exec-2] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter. 11:56:15.272 [http-nio-8080-exec-2] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VFS 11:56:15.272 [http-nio-8080-exec-2] DEBUG org.apache.ibatis.io.JBoss6VFS - JBoss 6 VFS API is not available in this environment. 11:56:15.275 [http-nio-8080-exec-2] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VirtualFile 11:56:15.277 [http-nio-8080-exec-2] DEBUG org.apache.ibatis.io.VFS - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment. 11:56:15.277 [http-nio-8080-exec-2] DEBUG org.apache.ibatis.io.VFS - Using VFS adapter org.apache.ibatis.io.DefaultVFS 11:56:15.279 [http-nio-8080-exec-2] DEBUG o.m.spring.SqlSessionFactoryBean - Scanned package: 'com.crm.entity' for aliases 11:56:15.367 [http-nio-8080-exec-2] DEBUG o.m.spring.SqlSessionFactoryBean - Parsed configuration file: 'class path resource [mybatis-config.xml]' 11:56:15.369 [http-nio-8080-exec-2] DEBUG o.m.spring.SqlSessionFactoryBean - Property 'mapperLocations' was not specified or no matching resources found 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache 信息: Looking for @ControllerAdvice: WebApplicationContext for namespace 'SpringMVC-servlet': startup date [Fri Nov 13 11:56:13 CST 2020]; root of context hierarchy 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache 信息: Looking for @ControllerAdvice: WebApplicationContext for namespace 'SpringMVC-servlet': startup date [Fri Nov 13 11:56:13 CST 2020]; root of context hierarchy 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerHandler 信息: Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0' 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerHandler 信息: Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0' 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.DispatcherServlet initServletBean 信息: FrameworkServlet 'SpringMVC': initialization completed in 3240 ms
刚开始,我觉得是ssm环境问题,spirng-mvc没有正确配置,但是仔细观察日志,可以看到:
spring mvc 已经成功接管了我的静态资源
十一月 13, 2020 11:56:13 上午 org.springframework.web.servlet.DispatcherServlet initServletBean 信息: FrameworkServlet 'SpringMVC': initialization started 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.DispatcherServlet initServletBean
spring三个配置文件都已经加载进环境
十一月 13, 2020 11:56:13 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [G:\Language Proctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-dao.xml] 十一月 13, 2020 11:56:13 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [G:\Language Proctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-mvc.xml] 十一月 13, 2020 11:56:13 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from file [G:\Language Proctice\java\pro\20201109\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CRMSystem\WEB-INF\classes\spring\spring-service.xml]
资源目录和orm映射模型目录已经加载
十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerHandler 信息: Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0' 十一月 13, 2020 11:56:16 上午 org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerHandler 信息: Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
所以排除对ssm环境配置的怀疑,我再次查看tomcat。
在检验端口号未被占用等问题以后,我将tomcat8.0.5换成了tomcat8.5。
结果是成功访问到了前端页面,解决了这个问题。
到此这篇关于关于tomcat部署应用无法访问前端页面的问题的文章就介绍到这了,更多相关tomcat部署无法访问页面内容请搜索开心学习网以前的文章或继续浏览下面的相关文章希望大家以后多多支持开心学习网!
您可能感兴趣
- idea 部署到tomcat 的项目在哪儿(使用IDEA创建Web项目并发布到tomcat的操作方法)
- tomcat的部署和优化(看看Tomcat安装、配置、优化及负载均衡)
- Tomcat和Weblogic部署纯html文件过程解析(Tomcat和Weblogic部署纯html文件过程解析)
- centos怎样开启tomcat(Centos8.2云服务器环境安装Tomcat8.5的详细教程)
- tomcat正常启动404(Tomcat正常访问localhost报404问题解决)
- tomcat docker 性能(Docker Nginx容器和Tomcat容器实现负载均衡与动静分离操作)
- tomcat运行警告(tomcat异常解决Invalid character found in the request target. The valid characters are defined in)
- tomcat的startup闪退的原因(直接双击启动tomcat中的startup.bat闪退原因及解决方法)
- 多个tomcat实例配置文件(tomcat单机多实例的实现)
- idea如何运行tomcat项目(在IDEA 2020.3.1中部署Tomcat并且创建第一个web项目的过程详解)
- tomcatxml文件放在哪(Tomcat中修改server.xml和content.xml后自动还原问题解决)
- tomcat优化jvm(Tomcat修正JDK原生线程池bug的实现原理)
- apache服务部署tomcat(详解Apache 和 Tomcat 整合原理、配置方案)
- nginx tomcat docker 负载均衡(Nginx+Tomcat实现负载均衡、动静分离的原理解析)
- 如何使用docker启动tomcat(Docker容器上用DockerFile部署多个tomcat服务的步骤)
- tomcat处理乱码(Tomcat中catalina.bat设置为UTF-8控制台出现乱码)
- 林心如是谁(林心如是谁演的)
- 泰国安全吗(泰国安全吗2023)
- 菲律宾安全吗(菲律宾安全吗)
- 泰国旅游攻略(泰国旅游攻略必去景点)
- 数字藏品市场有多乱 周杰伦丢了 一只猴 ,损失超300万(数字藏品市场有多乱)
- 这里输入关键词(怎么输入关键词搜索)
热门推荐
- css图片3D效果(用CSS实现图片的3D凹凸感凸出镜框外或凹陷镜框里)
- js中alert加参数写法(详解JavaScript Alert函数执行顺序问题)
- mysql中查询数据合并(Mysql合并结果接横向拼接字段的实现步骤)
- ant design 的vue批量操作(ant desing vue table 实现可伸缩列的完整例子)
- php 常见的三种缓存(PHP进阶学习之垃圾回收机制详解)
- sqlserver 存储过程参数类型(详解SQL Server表和索引存储结构)
- 使用canvas画个正方形(canvas绘制树形结构可视图形的实现)
- centos装docker稳定吗(Centos8无法安装docker问题的解决方法)
- dedecms注册会员界面如何打开(dedecms后台登录成功后返回到登录界面的解决方法)
- sqlserver连接字符串函数(SQL SERVER 2012新增函数之字符串函数FORMAT详解)
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9