频道栏目
首页 > 网络 > 云计算 > 正文

启动ActiveMQ服务报错Illegalcharacterinhostname

2018-01-02 14:41:48         来源:Vincent  
收藏   我要投稿

启动ActiveMQ服务报错Illegalcharacterinhostname。
WARN | Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call ‘refresh’ before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory1@39aeed2f:startupdate[SatDec3019:08:28CST2017];rootofcontexthierarchyatorg.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:427)[spring?context?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:999)[spring?context?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:958)[spring?context?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)[activemq?spring?5.15.2.jar:5.15.2]atorg.apache.activemq.broker.BrokerService.stop(BrokerService.java:903)[activemq?broker?5.15.2.jar:5.15.2]atorg.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)[activemq?spring?5.15.2.jar:5.15.2]atorg.apache.activemq.broker.BrokerService.start(BrokerService.java:642)[activemq?broker?5.15.2.jar:5.15.2]atorg.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq?spring?5.15.2.jar:5.15.2]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)[:1.8.091]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.091]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.091]atjava.lang.reflect.Method.invoke(Method.java:498)[:1.8.091]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1758)[spring?beans?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1695)[spring?beans?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)[spring?beans?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)[spring?beans?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)[spring?beans?4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)[xbean-spring-4.2.jar:4.2]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)[xbean-spring-4.2.jar:4.2]
at org.apache.activemq.xbean.XBeanBrokerFactory1.(XBeanBrokerFactory.java:104)[activemq-spring-5.15.2.jar:5.15.2]
atorg.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.15.2.jar:5.15.2]
atorg.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.15.2.jar:5.15.2]
atorg.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.15.2.jar:5.15.2]
atorg.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.15.2.jar:5.15.2]
atorg.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.15.2.jar:5.15.2]
atorg.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.2.jar:5.15.2]
atorg.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.15.2.jar:5.15.2]
atorg.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.2.jar:5.15.2]
atorg.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.15.2.jar:5.15.2]
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)[:1.8.0_91]
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_91]
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_91]
atjava.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_91]
atorg.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.15.2]
atorg.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.15.2]
WARN|Exceptionencounteredduringcontextinitialization-cancellingrefreshattempt:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname‘org.apache.activemq.xb
ean.XBeanBrokerService#0’definedinclasspathresource[activemq.xml]:Invocationofinitmethodfailed;nestedexceptionisjava.net.URISyntaxException:Illegalcharacterinhostnameatindex13:w
s://PengRong_M:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600
ERROR:java.lang.RuntimeException:Failedtoexecutestarttask.Reason:java.lang.IllegalStateException:BeanFactorynotinitializedoralreadyclosed-call‘refresh’beforeaccessingbeansviathe
ApplicationContext
java.lang.RuntimeException:Failedtoexecutestarttask.Reason:java.lang.IllegalStateException:BeanFactorynotinitializedoralreadyclosed-call‘refresh’beforeaccessingbeansviatheApplica
tionContext
atorg.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
atorg.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
atorg.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
atorg.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
atorg.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
atjava.lang.reflect.Method.invoke(Method.java:498)
atorg.apache.activemq.console.Main.runTaskClass(Main.java:262)
atorg.apache.activemq.console.Main.main(Main.java:115)
Causedby:java.lang.IllegalStateException:BeanFactorynotinitializedoralreadyclosed-call‘refresh’beforeaccessingbeansviatheApplicationContext
atorg.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
atorg.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030)
atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)
atorg.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
atorg.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
atorg.apache.activemq.xbean.XBeanBrokerFactory1.(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
… 10 more
ERROR: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call ‘refresh’ before accessing beans via the ApplicationContext
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call ‘refresh’ before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)
at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
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.activemq.console.Main.runTaskClass(Main.java:262)
at org.apache.activemq.console.Main.main(Main.java:115)
D:\Dev\ActiveMQ\apache-activemq-5.15.2\bin>

其中报错的核心信息

Invocation of init method failed; nested exception is java.net.URISyntaxException: Illegal character in hostname at
index 13: ws://xxxxx_M
是因为主机名有下划线造成的。

系统主机名把下划线去除后可以正常启动">对应window使用如下方案修复系统主机名把下划线去除后可以正常启动

\
然后重启系统后在启动ActiveMQ即可
\
这是一个简单有效的方法

Linux 系统

解决方案1(网上百度出的方案):

1.修改/etc/sysconfig/network
修改 hostname=xxx, 不能有下划线
2.修改/etc/hosts
添加刚刚 修改hostname的名字.
3.reboot 重启
4.重新启动active

上一篇:windows下载ActiveMQ并启动服务详细教程
下一篇:hadoop2.x集群安装配置详细教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站