请问监听器为什么没起到效果?

请问监听器为什么没起到效果?

C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\bin\catalina.bat run
[2019-07-13 01:08:34,400] Artifact webapp: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro"
Using CATALINA_HOME:   "C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37"
Using CATALINA_TMPDIR: "C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_161"
Using CLASSPATH:       "C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\bin\bootstrap.jar;C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\bin\tomcat-juli.jar"
13-Jul-2019 01:08:35.751 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.37
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 12 2018 12:07:02 UTC
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.37.0
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_161\jre
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_161-b12
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
13-Jul-2019 01:08:35.754 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro
13-Jul-2019 01:08:35.755 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37
13-Jul-2019 01:08:35.755 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro\conf\logging.properties
13-Jul-2019 01:08:35.755 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
13-Jul-2019 01:08:35.755 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
13-Jul-2019 01:08:35.755 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
13-Jul-2019 01:08:35.755 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37
13-Jul-2019 01:08:35.756 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\temp
13-Jul-2019 01:08:35.757 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.19] using APR version [1.6.5].
13-Jul-2019 01:08:35.757 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
13-Jul-2019 01:08:35.757 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
13-Jul-2019 01:08:35.762 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1a  20 Nov 2018]
13-Jul-2019 01:08:35.895 淇℃伅 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
13-Jul-2019 01:08:35.913 淇℃伅 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2019 01:08:35.927 淇℃伅 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
13-Jul-2019 01:08:35.930 淇℃伅 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2019 01:08:35.931 淇℃伅 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 707 ms
13-Jul-2019 01:08:35.970 淇℃伅 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
13-Jul-2019 01:08:35.970 淇℃伅 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.37
13-Jul-2019 01:08:35.983 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
13-Jul-2019 01:08:36.000 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
13-Jul-2019 01:08:36.004 淇℃伅 [main] org.apache.catalina.startup.Catalina.start Server startup in 72 ms
Connected to server
[2019-07-13 01:08:36,092] Artifact webapp: Artifact is being deployed, please wait...
[2019-07-13 01:08:36,504] Artifact webapp: Artifact is deployed successfully
[2019-07-13 01:08:36,504] Artifact webapp: Deploy took 412 milliseconds
13-Jul-2019 01:08:45.989 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\webapps\manager]
13-Jul-2019 01:08:46.058 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\webapps\manager] has finished in [68] ms
package com.damu.listener;

import com.damu.utils.SqlSessionFactoryUtils;

import javax.servlet.ServletContextAttributeListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class SqlSessionListener implements ServletContextListener {
    // 容器初始化方法
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        System.out.println("容器启动中...");
        // 初始化SqlSessionFactory对象
        SqlSessionFactoryUtils.InitSqlSessionFactory();
    }

    // 容器销毁方法
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        System.out.println("容器销毁中...");
        // 关闭SqlSession对象
        SqlSessionFactoryUtils.close();
    }
}


正在回答

登陆购买课程后可参与讨论,去登陆

8回答

http://img1.sycdn.imooc.com//climg/5d29c0c0000198ae07760264.jpg

http://img1.sycdn.imooc.com//climg/5d29c0db0001b31e08000409.jpg

同学可以着重看Cased by后边的信息哦。

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!


好帮手慕阿满 2019-07-13 18:53:58

同学你好,报错提示找不到db.properties,如:

http://img1.sycdn.imooc.com//climg/5d29b7f40001d99705230039.jpg

建议同学检查一下mybatis-config.xml中是否引入了db.properties,如:

http://img1.sycdn.imooc.com//climg/5d29b82900011d6406240414.jpg

如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

  • 提问者 JavaNice #1
    非常感谢老师,我不小心把db.properties放到db文件夹了。我还想问一下老师,对于报错要如何看,感觉我都找不重点
    2019-07-13 19:03:14
提问者 JavaNice 2019-07-13 18:16:54
13-Jul-2019 17:57:30.208 涓ラ噸 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.damu.listener.SqlSessionListener]
 org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### The error may exist in SQL Mapper Configuration
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource db.properties
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
	at com.damu.utils.SqlSessionFactoryUtils.InitSqlSessionFactory(SqlSessionFactoryUtils.java:35)
	at com.damu.listener.SqlSessionListener.contextInitialized(SqlSessionListener.java:16)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5278)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:483)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:432)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource db.properties
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:120)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:98)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78)
	... 48 more


  • 提问者 JavaNice #1
    Caused by: java.io.IOException: Could not find resource db.properties at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:114) at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:100) at org.apache.ibatis.io.Resources.getResourceAsProperties(Resources.java:128) at org.apache.ibatis.builder.xml.XMLConfigBuilder.propertiesElement(XMLConfigBuilder.java:224) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:105) ... 50 more
    2019-07-13 18:19:54
好帮手慕阿满 2019-07-13 17:46:29

同学你好,建议同学查看一下server后边两个窗口中是否有报错,如:

http://img1.sycdn.imooc.com//climg/5d29a85800016e4f04920103.jpg

如果有,将错误信息贴一下。

祝:学习愉快~

提问者 JavaNice 2019-07-13 16:02:16
提问者 JavaNice 2019-07-13 16:00:46

我更改了一些Tomcat的配置,然后能进行监听了,但是监听器自动销毁,也就意味着web容器自动关闭?

C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\bin\catalina.bat run
[2019-07-13 03:49:12,267] Artifact webapp: Waiting for server connection to start artifact deployment...
[2019-07-13 03:49:12,268] Artifact User_MybatisPro:war: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro"
Using CATALINA_HOME:   "C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37"
Using CATALINA_TMPDIR: "C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_161"
Using CLASSPATH:       "C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\bin\bootstrap.jar;C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\bin\tomcat-juli.jar"
13-Jul-2019 15:49:13.579 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.37
13-Jul-2019 15:49:13.581 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 12 2018 12:07:02 UTC
13-Jul-2019 15:49:13.581 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.37.0
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_161\jre
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_161-b12
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37
13-Jul-2019 15:49:13.582 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro\conf\logging.properties
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
13-Jul-2019 15:49:13.583 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
13-Jul-2019 15:49:13.584 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Jun\.IntelliJIdea2018.1\system\tomcat\Unnamed_User_MybatisPro
13-Jul-2019 15:49:13.584 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37
13-Jul-2019 15:49:13.584 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\temp
13-Jul-2019 15:49:13.584 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.19] using APR version [1.6.5].
13-Jul-2019 15:49:13.584 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
13-Jul-2019 15:49:13.585 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
13-Jul-2019 15:49:13.589 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1a  20 Nov 2018]
13-Jul-2019 15:49:13.733 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
13-Jul-2019 15:49:13.753 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2019 15:49:13.769 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
13-Jul-2019 15:49:13.773 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
13-Jul-2019 15:49:13.773 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 642 ms
13-Jul-2019 15:49:13.800 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
13-Jul-2019 15:49:13.800 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.37
13-Jul-2019 15:49:13.810 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
13-Jul-2019 15:49:13.822 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
13-Jul-2019 15:49:13.824 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 50 ms
  • 提问者 JavaNice #1
    Connected to server [2019-07-13 03:57:29,555] Artifact User_MybatisPro:war: Artifact is being deployed, please wait... 13-Jul-2019 15:57:30.973 信息 [RMI TCP Connection(3)-127.0.0.1] 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. 容器启动中... 13-Jul-2019 15:57:31.196 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 13-Jul-2019 15:57:31.198 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors 容器销毁中... [2019-07-13 03:57:31,220] Artifact User_MybatisPro:war: Error during artifact deployment. See server log for details. 13-Jul-2019 15:57:39.364 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\webapps\manager] 13-Jul-2019 15:57:39.456 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.37-windows-x64\apache-tomcat-8.5.37\webapps\manager] has finished in [91] ms
    2019-07-13 16:01:25
提问者 JavaNice 2019-07-13 15:31:10

难道是我Tomcat配置有问题?

http://img1.sycdn.imooc.com//climg/5d2988a70001236e12540886.jpg

http://img1.sycdn.imooc.com//climg/5d2988ac000127c012540886.jpg

http://img1.sycdn.imooc.com//climg/5d2988b80001ad9c05000972.jpg

好帮手慕阿满 2019-07-13 14:24:04

同学你好,问一下同学写好监听器后,有重写运行项目吗?如果没有,建议同学重新运行项目再试试。

祝:学习愉快~

  • 提问者 JavaNice #1
    老师是指重新启动Tomcat吗?如果是的话我已经试过了
    2019-07-13 15:30:08
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师