spring boot配置log4j 报内存溢出异常,怎么解决 5C

Exception in thread "main" java.lang.StackOverflowError
at java.base/java.lang.String.equals(String.java:1020)
at org.apache.logging.log4j.util.StackLocator.lambda$getCallerClass$1(StackLocator.java:48)
at java.base/java.util.stream.WhileOps$1Op$1OpSink.accept(WhileOps.java:376)
at java.base/java.util.stream.WhileOps$1Op$1OpSink.accept(WhileOps.java:386)
at java.base/java.lang.StackStreamFactory$StackFrameTraverser.tryAdvance(StackStreamFactory.java:595)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:476)
at org.apache.logging.log4j.util.StackLocator.lambda$getCallerClass$3(StackLocator.java:49)
at java.base/java.lang.StackStreamFactory$StackFrameTraverser.consumeFrames(StackStreamFactory.java:534)
at java.base/java.lang.StackStreamFactory$AbstractStackWalker.doStackWalk(StackStreamFactory.java:306)
at java.base/java.lang.StackStreamFactory$AbstractStackWalker.callStackWalk(Native Method)
at java.base/java.lang.StackStreamFactory$AbstractStackWalker.beginStackWalk(StackStreamFactory.java:370)
at java.base/java.lang.StackStreamFactory$AbstractStackWalker.walk(StackStreamFactory.java:243)
at java.base/java.lang.StackWalker.walk(StackWalker.java:453)
at org.apache.logging.log4j.util.StackLocator.getCallerClass(StackLocator.java:47)
at org.apache.logging.log4j.util.StackLocatorUtil.getCallerClass(StackLocatorUtil.java:55)
at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:42)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)

6个回答

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions><!-- 去掉默认配置 -->
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    因为SpringBoot的logging与log4j有冲突,所以需要制定忽略其中一个,这里忽略了SpringBoot自带的
y515789
T_初晴 已解决,就是jar包冲突了。之前我还遇到过忘了。
11 个月之前 回复

你看下程序里是不是有死循环或者是递归没有退出递归的情况,log4j引入一下jar包就可以使用了,然后在需要输出日志的类中添加
protected static final Logger logger= LoggerFactory.getLogger(类名.class);
就可以使用了

感觉死循环了, 你用jstack调试下

如果不是程序本身的问题,就增加内存

你先清除原先的log文件,然后重新启动apache,看看文件增加情况;然后增加内存,观察是不是随着时间log文件一直都在飞速增加;如果以上成立。
基本上就是安装的程序没有安装正确,导致重复询问启动不存在的插件或者进入死循环,我的建议是重新安装程序,一般都可以解决。

格式化一下就可以不溢出异常了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring Boot配置log4j记录日志
转载请注明出处:Spring Boot配置log4j记录日志 我们在老的项目框架ssh,springMVC中都使用过log4j日志模块。 例如:java日志功能log4j模块的使用方法 Spring Boot框架也能很好的快速集成log4j,本篇文章记录如何在Spring Boot框架中使用log4j。 引入log4j依赖 在创建Spring Boot工程时,我们引入了spring-boot-st...
spring boot 服务启动 log4j日志异常
2016-07-26 15:52:01,088 main WARN Could not instantiate FastDateFormat with pattern YYYYMMddHHmmss java.lang.IllegalArgumentException: Illegal pattern component: YYYYn at org.apache.logging.log4j.core.util.datetime.FastDatePrinter.parsePattern(FastDatePrinter.java:264)n at org.apache.logging.log4j.core.util.datetime.FastDatePrinter.init(FastDatePrinter.java:124)n at org.apache.logging.log4j.core.util.datetime.FastDatePrinter.(FastDatePrinter.java:115)n at org.apache.logging.log4j.core.util.datetime.FastDateFormat.(FastDateFormat.java:100)n at org.apache.logging.log4j.core.util.datetime.FastDateFormat.(FastDateFormat.java:81)n at org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:61)n at org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:58)n at org.apache.logging.log4j.core.util.datetime.FormatCache.getInstance(FormatCache.java:82)n at org.apache.logging.log4j.core.util.datetime.FastDateFormat.getInstance(FastDateFormat.java:140)n at org.apache.logging.log4j.core.pattern.DatePatternConverter.createFormatter(DatePatternConverter.java:176)n at org.apache.logging.log4j.core.pattern.DatePatternConverter.(DatePatternConverter.java:132)n at org.apache.logging.log4j.core.pattern.DatePatternConverter.newInstance(DatePatternConverter.java:144)n at org.apache.logging.log4j.core.pattern.FileDatePatternConverter.newInstance(FileDatePatternConverter.java:49)n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)n at java.lang.reflect.Method.invoke(Method.java:606)n at org.apache.logging.log4j.core.pattern.PatternParser.createConverter(PatternParser.java:548)n at org.apache.logging.log4j.core.pattern.PatternParser.finalizeConverter(PatternParser.java:601)n at org.apache.logging.log4j.core.pattern.PatternParser.parse(PatternParser.java:385)n at org.apache.logging.log4j.core.appender.rolling.PatternProcessor.(PatternProcessor.java:69)n at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.(RollingFileManager.java:58)n at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:326)n at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:291)n at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:71)n at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:61)n at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:79)n at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:193)n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)n at java.lang.reflect.Method.invoke(Method.java:606)n at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:136)n at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:813)n at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:753)n at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:745)n at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:389)n at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:169)n at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:181)n at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:446)n at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:520)n at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:536)n at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:214)n at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:146)n at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)n at org.apache.logging.log4j.LogManager.getContext(LogManager.java:185)n at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)n at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)n at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)n at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)n at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)n at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)n at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)n at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)n at org.springframework.boot.SpringApplication.(SpringApplication.java:190)n at com.wjcard.ApplicationRun.main(ApplicationRun.java:25) 怀疑jar包问题 不过jar包和之前无变化 继续排查
Spring Boot集成Log4J
Spring Boot是现在很热门的一个微服务框架,作为一名Java Web 开发工程师,是必须要掌握它的。本系列课程会一步一步教大家如何使用Spring Boot,以及Spring Boot如何整合其它技术。
spring boot初探(二)——springboot配置log4j
spring-boot-starter中默认依赖了spring-boot-starter-logging而他实现的日志组件是Lockback。 事实上官方文档已经讲的非常清楚了,并且提供了两种日志实现的配置Logback和Log4j。具体的官方地址请看:http://docs.spring.io/spring-boot/docs/current/reference/html/howto-log
Spring boot 数据源未配置异常
问题在使Springboot自动生成的项目框架时如果选择了数据源,比如选择了mysql,生成项目之后,启动会报一下异常:Description:Cannot determine embedded database driver class for database type NONEAction:If you want an embedded database please put a suppor
Spring Boot自定义log4j日志输出
Java EE 目录:https://blog.csdn.net/dkbnull/article/details/87932809 Spring Boot 专栏:https://blog.csdn.net/dkbnull/column/info/26341 Spring Cloud 专栏:https://blog.csdn.net/dkbnull/column/info/36820 l...
spring boot 文件上传异常
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryRAYPKeHKTYSNdzc1;charset=UTF-8' not supported   文件上传出现的异常.   原始代码 测试报...
Restful API返回对象封装
1、Resultimport java.io.Serializable;public class Result implements Serializable { private static final long serialVersionUID = -5372450875750675775L; /** * 编码 */ private Integer code; /** * 消息 */ ...
Spring boot 事务回滚异常
spring boot 事务的使用: 可以在类上加注解: 也就是启动 类上加: @EnableTransactionManagement 事务需要回滚的方法上加注解: @Transactional 如果事务不回滚,可以手动回滚  也就是在 catch 里面加入代码完成手动回滚: TransactionAspectSupport.currentTransactionStatus(...
spring boot 全局异常
直接代码 /** * 1、新建一个Class,这里取名为GlobalDefaultExceptionHandler * 2、在class上添加注解,@ControllerAdvice; * 3、在class中添加一个方法 * 4、在方法上添加@ExcetionHandler拦截相应的异常信息; * 5、如果返回的是View -- 方法的返回值是ModelAndView; * 6、如果返回
配置spring MVC的时候,启动报异常?
[code=java]2013-4-2 16:54:25 org.apache.coyote.http11.Http11Protocol initrn信息: Initializing Coyote HTTP/1.1 on http-8080rn2013-4-2 16:54:25 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 716 msrn2013-4-2 16:54:25 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2013-4-2 16:54:25 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/5.0.28rn2013-4-2 16:54:25 org.apache.catalina.core.StandardHost startrn信息: XML validation disabledrn2013-4-2 16:54:25 org.springframework.web.servlet.FrameworkServlet initServletBeanrn信息: FrameworkServlet 'test': initialization startedrn2013-4-2 16:54:26 org.springframework.context.support.AbstractApplicationContext prepareRefreshrn信息: Refreshing WebApplicationContext for namespace 'test-servlet': startup date [Tue Apr 02 16:54:26 CST 2013]; root of context hierarchyrn2013-4-2 16:54:26 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/test-servlet.xml]rn2013-4-2 16:54:26 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletonsrn信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@53a9d5: defining beans [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,startController]; root of factory hierarchyrn2013-4-2 16:54:26 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandlerrn信息: Mapped URL path [/start.test] onto handler [test.StartController@33c3e6]rn2013-4-2 16:54:26 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletonsrn信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@53a9d5: defining beans [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,startController]; root of factory hierarchyrn2013-4-2 16:54:26 org.springframework.web.servlet.FrameworkServlet initServletBeanrn严重: Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]: Constructor threw exception; nested exception is javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not foundrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:946)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:892)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:286)rn at org.springframework.web.servlet.DispatcherServlet.createDefaultStrategy(DispatcherServlet.java:679)rn at org.springframework.web.servlet.DispatcherServlet.getDefaultStrategies(DispatcherServlet.java:648)rn at org.springframework.web.servlet.DispatcherServlet.initHandlerAdapters(DispatcherServlet.java:479)rn at org.springframework.web.servlet.DispatcherServlet.initStrategies(DispatcherServlet.java:337)rn at org.springframework.web.servlet.DispatcherServlet.onRefresh(DispatcherServlet.java:325)rn at org.springframework.web.servlet.FrameworkServlet.onApplicationEvent(FrameworkServlet.java:526)rn at org.springframework.web.servlet.FrameworkServlet.onApplicationEvent(FrameworkServlet.java:1)rn at org.springframework.context.event.GenericApplicationListenerAdapter.onApplicationEvent(GenericApplicationListenerAdapter.java:51)rn at org.springframework.context.event.SourceFilteringListener.onApplicationEventInternal(SourceFilteringListener.java:97)rn at org.springframework.context.event.SourceFilteringListener.onApplicationEvent(SourceFilteringListener.java:68)rn at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)rn at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:301)rn at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:887)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:426)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)rn at javax.servlet.GenericServlet.init(GenericServlet.java:211)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)rn at org.apache.catalina.core.StandardService.start(StandardService.java:480)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:556)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)rnCaused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]: Constructor threw exception; nested exception is javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not foundrn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:939)rn ... 41 morernCaused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not foundrn at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)rn at org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter.(AbstractXmlHttpMessageConverter.java:47)rn at org.springframework.http.converter.xml.SourceHttpMessageConverter.(SourceHttpMessageConverter.java:45)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.(AnnotationMethodHandlerAdapter.java:171)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)rn ... 43 morern2013-4-2 16:54:26 org.apache.catalina.core.StandardHost getDeployerrn信息: Create Host deployer for direct deployment ( non-jmx ) rn2013-4-2 16:54:26 org.apache.coyote.http11.Http11Protocol startrn信息: Starting Coyote HTTP/1.1 on http-8080rn2013-4-2 16:54:27 org.apache.jk.common.ChannelSocket initrn信息: JK2: ajp13 listening on /0.0.0.0:8009rn2013-4-2 16:54:27 org.apache.jk.server.JkMain startrn信息: Jk running ID=0 time=0/70 config=nullrn2013-4-2 16:54:27 org.apache.catalina.startup.Catalina startrn信息: Server startup in 1630 msrn[/code]
Spring搭建:log4j的配置
在spring搭建项目时,一般都是需要使用log4j。此时,需要在web.xml中配置好log4j,或者log4j.xml中进行路径配置,此时就需要进行log4j的配置了解。web.xml中的配置在spring中,使用log4j时,主要2点。一是web.xml中配置log4j;二是项目的webapp下配置log4j.xml。首先是web.xml中配置。如下: <context-param>
log4j与spring的详细配置。
Log4j+API帮助文档,log4j详细配置。log4j与spring的详细配置。
Spring Boot学习笔记(二)Spring Boot配置
一、配置文件 SpringBoot使用一个全局的配置文件,放在src/main/resources目录或者类路径/config下,配置文件名是固定的: application.properties application.yaml Spring Boot配置文件的作用是用来修改SpringBoot自动配置的默认值。Spring Boot在底层都为我们自动配置好了默认的配置,如果需要改变就在配置...
解决eclipse报PermGen space内存溢出异常的问题
异常问题如下所示: 1.点击Eclipse-&gt;Window-&gt;Preferences,如下所示: 2.点击Server-&gt;Runtime Environments,选择Apache Tomcat v7.0,点击Edit按钮,如下图所示: 3.选择运行的JRE,点击Installed JRES,如下图所示: 4.选中jdk1.7.0_67,点击
内存溢出配置,内存溢出配置
内存溢出配置,内存溢出配置内存溢出配置内存溢出配置
Spring项目中怎么配置log4j
在spring项目中配置log4j http://blogger.org.cn/blog/more.asp?name=lhwork&amp;amp;id=17174 其实我们只要查看spring的sample示例就知道怎么做。 首先创建好集成了spring的web项目。 下面配置: 一、在web.xml中加入下面内容 &amp;lt;context-param&amp;gt; &amp;lt;param-nam...
Spring Boot 配置 CORS 解决请求跨域问题
1、使用@CrossOrigin 注解实现 #如果想要对某一接口配置 CORS,可以在方法上添加 @CrossOrigin 注解 : @CrossOrigin(origins = {&quot;http://localhost:9000&quot;, &quot;null&quot;}) @RequestMapping(value = &quot;/test&quot;, method = RequestMethod.GET) public Stri...
spring boot完整配置
spring boot配置文件详解带注释的+++++++++++++++++++
spring boot多环境配置
spring boot多环境配置 通过多环境配置,可以实现生产环境和测试环境灵活切换。 主配置文件加载生产环境配置文件语法: spring.profiles.active=pro 注意一旦pro被激活有冲突配置采用被激活的 ...
spring boot 自动配置
1.Spring boot 自动配置 spring boot 通过@springbootapplication来启动项目,使用@springbootapplication标记过的类证明是这个类的主程序,程序通过运行这个类的main方法来启动这个程序 @SpringBootApplication public class SpringBootTestApp { public static...
Spring boot的配置类
@Configuration 指明当前类是一个配置类 来替代之前的Spring配置文件 Spring boot的配置类 相当于Spring的配置文件 容器添加组件 Spring,通过配置文件添加组件 Spring boot,通过配置类的方式添加组件 @Bean 将方法的返回值添加到容器中 容器中,这个组件默认的id,就是方法名 package com.atguigu.sp...
Spring Boot 属性配置
常规属性配置 类型安全的属性配置 常规属性配置在Spring-Boot中,我们在application.properties文件中定义属性,直接使用@Value注入即可。这个定义属性的配置文件在/src/main/resources/目录下。下面是一个例子: 首先我们在application.properties配置文件中增加属性:book.author=yubuyun book.name=spr
spring boot多任务配置
@SpringBootApplication @EnableScheduling public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } @Configuration @ImportR
Spring Boot的自动配置
Spring Boot的自动配置的原理 Spring Boot在进行SpringApplication对象实例化时会加载META-INF/spring.factories文件,将该配置文件中的配置载入到Spring容器。 Maven下载源码 通过 dependency:sources 该命令可以下载该项目中所有的依赖的包的源码。 源码分析 org.springframework.
Spring Boot 配置加载顺序
1. 在命令行中传入的参数。 2. SPRING_APPLICATION_JSON中的属性。SPRING_APPLICATION_JSON是以JSON格式配置在系统环境变量中的内容。 3. java:comp/env中的JNDI属性 4. java的系统属性,可以通过System.getProperties()获得的内容。 5. 操作系统的环境变量。 6. 通过random.*配置的随机属性。 7.
spring boot 配置分离
Spring Boot默认为我们提供了一个配置之地!只要按照指定的名称创建属性文件,并放置在指定位置,Spring Boot会自动解析其内容。 关于Spring Boot的常用的配置分离主要有以下几种方式: 1、命令行参数 2、通过jar外部的application-{profile}.properties激活对应系统环境的配置生效 3、通过spring.config.lo
spring boot 配置静态资源
SpringBoot对静态资源的支持以及很重要的一个类WebMvcConfigurerAdapter。正文前面章节我们也有简单介绍过SpringBoot中对静态资源的默认支持,今天详细的来介绍下默认的支持,以及自定义扩展如何实现。默认资源映射Spring Boot 默认为我们提供了静态资源处理,使用 WebMvcAutoConfiguration 中的配置各种属性。建议大家使用Spring Boot
Spring Boot配置方式
Spring提供了xml、注解、Java配置、groovy配置实现Bean的创建和注入。 配置元数据  无论xml配置、注解配置还是Java配置,都被称为配置元数据,所谓元数据即描述数据的数据。元数据本身不具备任何可执行的能力,只能通过外界代码对这些元数据进行解析后进行一些有意义操作。Spring容器解析这些配置元数据进行Bean初始化、配置和管理依赖。准备工作本文代码测试均在《Spring Boo
Spring Boot五(配置)
Spring Boot—参数配置 一.概述 为了让应用适应不同的环境,Spring Boot可以通过properties文件,YAML文件,环境变量和命令行来设置系统参数。下面我们分别对这几种方式作出详细的说明。 二.命令行参数 默认情况下,SpringApplication会将命令行参数(如–server.port=9000)的property添加到Spring Boot的E...
spring boot 自定义配置
文章目录覆盖配置自定义安全配置通过属性文件配置微调自动配置bean属性外置基于Profile配置属性文件自定义错误页面 覆盖配置 spring boot加载应用级配置,之后在考虑自动配置类。 ConditionalOnMissingBean 注解是覆盖自动配置的关键。 例如SpringBootWebSecurityConfiguration只有在用户未自定义WebSecurityConfigu...
Spring boot自动配置
@EnableAutoConfiguration 开启自动配置功能 不需要我们配置,Spring boot开启自动配置 @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfiguration @EnableAutoConfiguratio...
Spring Boot 配置文件解析
Spring Boot使用了一个全局的配置文件application.properties。   --- 自定义属性 --- application.properties提供自定义属性的支持,这样我们就可以把一些常量配置在这里: com.example.name=\u674E\u96F7 com.example.want=\u6765\u4E00\u676FSpring 然后,直接...
Spring Boot 多数据源配置
Spring Boot 多数据源配置 本文主要介绍了,SpringBoot框架下集成mybatis的多数据源配置,一下展示了mysql和sqlserver两种数据库的链接方式。 1、添加SpringBoot多数据源的配置文件,以下链接了mysql和sqlserver两个数据源。 spring.datasource.druid.driver-class-name=com.mysql.jdbc...
Spring Boot自定义配置
开发配置: IntelliJ Idea JDK 1.8.0.131 64-bit spring boot 1.5.8 1.新建自定义配置文件student: name: Jack age: 16 score: math: 90 english: 802.新建配置文件对应的类package com.example.demo.config;impo
spring boot 配置拦截器
package com.gkyt.ywgk.modular.filter;import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;im...
spring boot框架配置
pom文件的代码如下: &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt; &amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://ma
spring boot 配置说明
最近在看项目里的springboot的配置  因为项目不是我搭的所以对配置不是很清楚  百度了一部分  看到一份比较齐全的配置说明  特地保存一下  留着下次自己看 http://lib.csdn.net/article/java/65363?knId=1400 https://segmentfault.com/a/1190000004315890   就这2篇博客 留着自己看...
Spring boot配置数据源
以下是我通过自己试验得出的结论,不敢保证准确性,如有错误希望指出,谢谢! 1、如果启动类没有禁用数据库自动配置,则只需要在allpication.properties进行数据库配置就可以了,我认为这时应该使用的是默认的数据源: @EnableSwagger2 @SpringBootApplication public class DemoApplication { public stat...
Spring Boot 配置入门
传统的三大框架SSH编程模式存在很多弊端,新兴的SSI框架编程模式以其使用简单、运行速度快的优势正在成为主流!n本课程全部采用的是案例教学模式----不是知识点教学模式,可以使学员掌握实际项目应用中需要掌握的重要知识,与将来的实际项目开发进行无缝衔接n声明:学习此套课程之前,需要了解JDBC+Servlet的实现方法,还需要了解SSH实现方案,否则可能导致思路不连贯,学习不顺畅
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法