`
ch_space
  • 浏览: 109097 次
  • 性别: Icon_minigender_1
  • 来自: 农村进城务工人员
社区版块
存档分类
最新评论

从日志看Spring启动过程

阅读更多
信息: Initializing Spring root WebApplicationContext
15:07:33,078  INFO ContextLoader:189 - Root WebApplicationContext: initialization started
15:07:33,109  INFO XmlWebApplicationContext:411 - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@18c56d: display name [Root WebApplicationContext]; startup date [Wed Mar 02 15:07:33 CST 2011]; root of context hierarchy
15:07:33,156  INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from ServletContext resource [/WEB-INF/beans.xml]
15:07:33,390  INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from ServletContext resource [/WEB-INF/mail.xml]
15:07:33,406  INFO XmlWebApplicationContext:426 - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@18c56d]: org.springframework.beans.factory.support.DefaultListableBeanFactory@15fc40c
15:07:33,500  INFO PropertyPlaceholderConfigurer:178 - Loading properties file from ServletContext resource [/WEB-INF/jdbc.properties]
15:07:33,500  INFO PropertyPlaceholderConfigurer:178 - Loading properties file from ServletContext resource [/WEB-INF/mail.properties]
15:07:33,562  INFO DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@15fc40c: defining beans [favoriteDao,messageDao,refCommentDao,referenceDao,refRequestDao,sequenceDao,userDao,daoSupport,facade,mailFactory,mailTask,mailTaskFactory,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,dataSource,txManager,sqlMapClient,sqlMapClientTmp,threadPool,cookieFilter,propertyConfigurer,mailSender,regMail,updateMail]; root of factory hierarchy
15:07:33,953  INFO ThreadPoolTaskExecutor:250 - Initializing ThreadPoolExecutor 'threadPool'
15:07:33,984  INFO ContextLoader:209 - Root WebApplicationContext: initialization completed in 906 ms
2011-3-2 15:07:34 org.apache.catalina.core.ApplicationContext log




信息: Initializing Spring FrameworkServlet 'dispatcher'
15:07:34,015  INFO DispatcherServlet:277 - FrameworkServlet 'dispatcher': initialization started
15:07:34,015  INFO XmlWebApplicationContext:411 - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@16477d9: display name [WebApplicationContext for namespace 'dispatcher-servlet']; startup date [Wed Mar 02 15:07:34 CST 2011]; parent: org.springframework.web.context.support.XmlWebApplicationContext@18c56d
15:07:34,015  INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
15:07:34,046  INFO XmlWebApplicationContext:426 - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@16477d9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@c063ad
15:07:34,062  INFO DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c063ad: defining beans [checkcodeController,userController,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,velocityConfig,viewResolver,multipartResolver]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@15fc40c
15:07:34,093  INFO VelocityConfigurer:222 - Loading Velocity config from [ServletContext resource [/WEB-INF/velocity.properties]]
15:07:34,109  INFO VelocityConfigurer:138 - ClasspathResourceLoader with name 'springMacro' added to configured VelocityEngine
15:07:34,375  INFO DispatcherServlet:296 - FrameworkServlet 'dispatcher': initialization completed in 360 ms
2011-3-2 15:07:34 org.apache.coyote.http11.Http11Protocol start


注意两点:

1、Spring applicationContext先启动,servlet context后加载
2、dispatcher-servlet.xml中定义了控制器映射,使用Controller+RequestMapping注解映射时,相关controller组件扫描要定义在dispatcher-servlet.xml中,而非applicationContext.xml中。
分享到:
评论
1 楼 luoyexian 2011-11-21  
你好:请问web.xml 要怎么配置这两个文件,我将这两个文件放到web-info/spring 这及目录下。我写的配置是这样。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:**/spring/*bean*.xml
</param-value>
</context-param>
<!--
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
-->
<!--  Spring MVC 的Servlet,它将加载WEB-INF/spring/spring-mvc.xml 的 配置文件,以启动Spring MVC模块-->
    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>>
        classpath*:**/spring/*mvc*.xml
        </param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
但报parsing XML document from ServletContext resource的错误。谢谢

相关推荐

    Spring攻略(第二版 中文高清版).part1

    12.5 从项目中删除Spring Roo 500 12.5.1 问题 500 12.5.2 解决方案 500 12.5.3 工作原理 501 12.6 小结 502 第13章 Spring测试 503 13.1 用JUnit and TestNG创建测试 504 13.1.1 问题 504 13.1.2...

    SpringCloud精品屋微服务治理版

    基于精品屋构建的Spring Cloud 微服务技术栈学习型项目,致力于原创文学阅读与写作,提供了爬虫工具用于开发过程中测试数据的采集。采用了时下最新的Spring Boot2 、Spring Cloud Hoxton.SR4、 MyBatis3DynamicSql、...

    Spring攻略(第二版 中文高清版).part2

    12.5 从项目中删除Spring Roo 500 12.5.1 问题 500 12.5.2 解决方案 500 12.5.3 工作原理 501 12.6 小结 502 第13章 Spring测试 503 13.1 用JUnit and TestNG创建测试 504 13.1.1 问题 504 13.1.2...

    搞定J2EE:STRUTS+SPRING+HIBERNATE整合详解与典型案例 (1)

    1.1.3 从J2EE到JavaEE 1.2 J2EE组件 1.2.1 客户端组件 1.2.2 Web组件 1.2.3 业务逻辑组件 1.3 J2EE容器 1.3.1 容器服务 1.3.2 容器类型 1.4 J2EE核心技术 1.4.1 Servlet 1.4.2 JSP(Java服务页面) 1.4.3 EJB(企业...

    搞定J2EE:STRUTS+SPRING+HIBERNATE整合详解与典型案例 (3)

    1.1.3 从J2EE到JavaEE 1.2 J2EE组件 1.2.1 客户端组件 1.2.2 Web组件 1.2.3 业务逻辑组件 1.3 J2EE容器 1.3.1 容器服务 1.3.2 容器类型 1.4 J2EE核心技术 1.4.1 Servlet 1.4.2 JSP(Java服务页面) 1.4.3 EJB(企业...

    Spring面试题

    AOP 的功能完全集成到了 Spring 事务管理、日志和其他各种特性的上下文中。 IOC 容器 Spring 设计的核心是 org.springframework.beans 包,它的设计目标是与 JavaBean 组件一起使用。这个包通常不是由用户直接使用...

    Spring 3 Reference中文

    1.3.2 日志. 16 1.3.2.1 不使用Commons Logging .. 17 1.3.2.2 使用SLF4J 17 1.3.2.3 使用Log4J .. 19 第二部分 Spring 3 的新特性.. 21 第2 章 Spring 3.0 的新特性和增强 21 2.1 ...

    搞定J2EE:STRUTS+SPRING+HIBERNATE整合详解与典型案例 (2)

    1.1.3 从J2EE到JavaEE 1.2 J2EE组件 1.2.1 客户端组件 1.2.2 Web组件 1.2.3 业务逻辑组件 1.3 J2EE容器 1.3.1 容器服务 1.3.2 容器类型 1.4 J2EE核心技术 1.4.1 Servlet 1.4.2 JSP(Java服务页面) 1.4.3 EJB(企业...

    spring3.1中文参考文档

    1.3.2 日志................................................................................................................................................. 17 1.3.2.1 不使用Commons Logging...............

    沙发启动:SOFABoot是一个框架,可增强Spring Boot并与之完全兼容,并提供就绪检查,类隔离等功能。

    沙发靴 SOFABoot是Ant蚁金服开源的基于Spring Boot的研发框架,它在Spring Boot的基础上,提供了诸如Readiness Check,类隔离,日志空间隔离等等能力。在增强了Spring Boot的同时,SOFABoot提供了让用户可以在Spring...

    xmljava系统源码-spring-boot-example:一个高度可复用的SpringBoot示例工程

    IDEA下载时默认集成了SpringBoot的快速启动项目可以直接创建,如果使用Eclipse的同学可以考虑安装SpringBoot插件或者直接从配置并下载SpringBoot快速启动项目,需要注意的是本次环境搭建选择的是Spring

    webx3框架指南PDF教程附学习Demo

    从这个角度看,的确没有特别明显的理由来选择Webx,但也没有明显的理由不选择Webx。 另一方面,由于每一种框架采用不同的设计,必然会有各自的优势。Webx也是如此 —— 它在某些方面有一些独到的设计,超越了同类...

    基于springboot+vue+elementui的办公自动化系统设计,优秀毕业系统,新手必看!

    系统主要功能: 1、统一的信息发布平台:公告栏,公司活动,项目进度,公司周报 ...简略写下启动过程: 后端部分: 1、安装好数据库,运行/doc/sql/oa.sql文件 2、数据库、端口、mybatis配置在 /src/m

    java毕设:办公自动化系统-springboot+vue+element-ui 前后端分离

    基于 springboot+vue+elementui 的办公自动化...简略写下启动过程: 后端部分: 1、安装好数据库,运行/doc/sql/oa.sql文件 2、数据库、端口、mybatis配置在 /src/main/resources/application.yml 下 3、启动OaApplica

    redux日志查看器

    redux日志查看器 入门 要设置redux-log-viewer ,应在您的机器上安装以下软件。 12以上 安装 如果您具备所有先决条件,则可以使用以下... 这将在本地启动redux-log-viewer并在此过程中启动默认的Web浏览器。 如果未

    基于SpringBoot+Shiro+Redis+Jwt+Thymeleaf+MyBatis 开发的后台用户、角色+源代码+文档

    * 为了方便大学家习dubbo的运行机制,本框架将dubbo的provider和customer作了一个整合,将官方demo里的方多应用整合成了一个,即在同一应用内启动消费端和服务端 * 注:如有实际业务需要请将服务端与消费端分离,...

    sql连接器

    SQL连接器的配置提供了两个“字段注入”字段:“ datasourceProperties”用于数据库连接设置,而“ query”用于SQL请求定义怎么跑作为Spring启动应用程序运行。 在IDE中打开项目(例如在Intellij IDEA中),然后运行...

    这是一个用SpringBoot+JPA打造的基于微信服务号平台的点餐系统+源代码+文档说明+数据库sql

    如果是初次使用spring boot,这个过程可能会有点久,需要下载许多依赖的jar包。 4. 为IDEA安装lombok插件。在IDEA里,File-&gt;Settings...-&gt;Plugin,搜索lombok,安装。项目wiki介绍日志时有提到为什么安装这个插件。 ...

    《程序天下:J2EE整合详解与典型案例》光盘源码

    1.1.3 从J2EE到JavaEE 1.2 J2EE组件 1.2.1 客户端组件 1.2.2 Web组件 1.2.3 业务逻辑组件 1.3 J2EE容器 1.3.1 容器服务 1.3.2 容器类型 1.4 J2EE核心技术 1.4.1 Servlet 1.4.2 JSP(Java服务页面) 1.4.3 EJB(企业...

    基于Java开发的派单管理系统demo源码+项目说明+sql数据库(课程大作业).zip

    在使用过程中,如有问题或建议,请及时沟通。 5.期待你能在项目中找到乐趣和灵感,也欢迎你的分享和反馈! 【项目介绍】 基于Java开发的派单管理系统demo源码+项目说明+sql数据库(课程大作业).zip **技术选型:** ...

Global site tag (gtag.js) - Google Analytics