07b26166f3483fb7ca977493712ab015.jpg

2019-04-26 09:51:18,249 | WARN  | Exception encountered during context initialization - cancelling refresh attempt | org.apache.activemq.xbean.XBeanBrokerFactory1 | main
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory1.getObject(AbstractBeanFactory.java:293)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)[spring-beans-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)[spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE]
    at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.18.jar:3.18]
    at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.18.jar:3.18]
    at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.11.1.jar:5.11.1]
    at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.11.1.jar:5.11.1]
    at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.11.1.jar:5.11.1]
    at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.11.1.jar:5.11.1]
    at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.11.1.jar:5.11.1]
    at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.11.1.jar:5.11.1]
    at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.11.1.jar:5.11.1]
    at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)[activemq-console-5.11.1.jar:5.11.1]
    at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.11.1.jar:5.11.1]
    at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.11.1.jar:5.11.1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_67]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_67]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_67]
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_67]
    at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.11.1]
    at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.11.1]

在apache-activemq-5.11.1/bin/linux-x86-64/wrapper.conf中增加一行

wrapper.java.additional.12=-Xms2048M -Xmx5120M

注释wrapper.java.initmemorywrapper.java.maxmemory
若不生效,检查下apache-activemq-5.11.1/bin下有没有env独立配置。
wrapper.java.maxmemory=4096

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code