我在openshift的應用程序中運行嵌入式activemq消息服務器。根據this,您只能在15000 - 35530
上綁定。我試着做了以下,但它是一個嚴重的錯誤。可能是什麼問題?無法綁定到Openshift上的端口
我正在使用彈簧。這是部分在我applicationContext.xml
<amq:broker brokerName="tentacle-broker" start="true">
<amq:persistenceAdapter>
<amq:amqPersistenceAdapter directory="/var/lib/openshift/username/jbossews-2.0/jbossews-2.0/activemq2" maxFileLength="32mb"/>
</amq:persistenceAdapter>
<amq:transportConnectors>
<amq:transportConnector uri="tcp://127.10.180.129:15001"/>
</amq:transportConnectors>
</amq:broker>
這是我遇到
WARNING: could not generate unique stub
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:128)
at org.apache.activemq.util.IdGenerator.<clinit>(IdGenerator.java:54)
at org.apache.activemq.broker.region.RegionBroker.<clinit>(RegionBroker.java:81)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1830)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1824)
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1781)
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:766)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:497)
at org.apache.activemq.broker.BrokerService.autoStart(BrokerService.java:463)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProces
r.java:293)
va:130)
ava:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1405)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
:
該端口可能正在使用中,您用於執行OpenShift的用戶沒有足夠的權限來打開新的端口,或者有另一個應用程序阻止您打開該端口。 –
@LuiggiMendoza根據Openshift文檔,我可以在我的應用程序中自由綁定該端口。在端口'15001'上沒有其他綁定。我仍然困惑爲什麼不允許。 –
同樣,這不是OpenShift問題,它是阻止OpenShift打開新端口的用戶/外部應用程序問題。例如,出於安全目的,防火牆可以阻止您的應用綁定新的端口。通過了解這一點,您的問題甚至不與編程直接相關。 –