java.net.URISyntaxException: Illegal character in hostname at index 5: ws://****:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600
jvm 1 | at java.net.URI$Parser.fail(Unknown Source)[:1.8.0_121]
jvm 1 | at java.net.URI$Parser.parseHostname(Unknown Source)[:1.8.0_121]
jvm 1 | at java.net.URI$Parser.parseServer(Unknown Source)[:1.8.0_121]
jvm 1 | at java.net.URI$Parser.parseAuthority(Unknown Source)[:1.8.0_121]
jvm 1 | at java.net.URI$Parser.parseHierarchical(Unknown Source)[:1.8.0_121]
jvm 1 | at java.net.URI$Parser.parse(Unknown Source)[:1.8.0_121]
jvm 1 | at java.net.URI.<init>(Unknown Source)[:1.8.0_121]
jvm 1 | at org.apache.activemq.transport.WebTransportServerSupport.bind(WebTransportServerSupport.java:73)[activemq-http-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.transport.ws.WSTransportServer.doStart(WSTransportServer.java:67)[activemq-http-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)[activemq-client-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:251)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2747)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2640)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:771)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:733)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerService.start(BrokerService.java:636)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.15.4.jar:5.15.4]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1763)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1700)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-4.2.jar:4.2]
jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-4.2.jar:4.2]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.4.jar:5.15.4]
jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.15.4.jar:5.15.4]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.15.4]
jvm 1 | at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.15.4]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_121]
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)[wrapper.jar:3.2.3]
jvm 1 | at java.lang.Thread.run(Unknown Source)[:1.8.0_121]
解决办法如下:
修改 conf->activemq.xml 配置文件
把其中的
<transportConnectors> <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
修改为
<transportConnectors> <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> <transportConnector name="openwire" uri="tcp://127.0.0.1:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="amqp" uri="amqp://127.0.0.1:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="stomp" uri="stomp://127.0.0.1:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="mqtt" uri="mqtt://127.0.0.1:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="ws" uri="ws://127.0.0.1:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
即可,就是把这一大段xml里的0.0.0.0替换为127.0.0.1
注:亲测有效!!!