Unable to run the server

I followed the instruction, and in the “Running the server from Eclipse” page, “Running the server” step
"
To run the examples-simulated server from Eclipse, follow these steps:

Find the class com.opengamma.examples.simulated.tool.ExampleDatabaseCreator (use Ctrl+Shift+T on Windows)
Run it, by right clicking -> Run As -> Java Application, and wait for it to complete
Find the class com.opengamma.examples.simulated.ExamplesSimulatedComponentServerDev
Run it, by right clicking -> Run As -> Java Application
"

I am able to run the com.opengamma.examples.simulated.tool.ExampleDatabaseCreator, but when I run com.opengamma.examples.simulated.ExamplesSimulatedComponentServerDev, it failed. And error report as follow"

“com.opengamma.OpenGammaRuntimeException: Failed to init component factory: ‘activeMQ’ with {factory=com.opengamma.component.factory.SpringActiveMqComponentFactory, springFile=classpath:fullstack/fullstack-examplessimulated-activemq-spring.xml, propertiesFile=MANAGER.PROPERTIES}
at com.opengamma.component.ComponentManager.initComponent(ComponentManager.java:360)
at com.opengamma.component.ComponentManager.initComponents(ComponentManager.java:325)
at com.opengamma.component.ComponentManager.init(ComponentManager.java:300)
at com.opengamma.component.ComponentManager.start(ComponentManager.java:205)
at com.opengamma.component.ComponentManager.start(ComponentManager.java:192)
at com.opengamma.component.OpenGammaComponentServer.run(OpenGammaComponentServer.java:291)
at com.opengamma.component.OpenGammaComponentServer.run(OpenGammaComponentServer.java:158)
at com.opengamma.examples.simulated.ExamplesSimulatedComponentServerDev.main(ExamplesSimulatedComponentServerDev.java:43)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.apache.activemq.xbean.XBeanBrokerService#0’ defined in class path resource [fullstack/fullstack-examplessimulated-activemq-spring.xml]: Invocation of init method failed; nested exception is java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616 due to: java.net.BindException: Address already in use: JVM_Bind
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at com.opengamma.component.factory.AbstractSpringComponentFactory.createApplicationContext(AbstractSpringComponentFactory.java:86)
at com.opengamma.component.factory.SpringActiveMqComponentFactory.init(SpringActiveMqComponentFactory.java:35)
at com.opengamma.component.ComponentManager.initFactory(ComponentManager.java:555)
at com.opengamma.component.ComponentManager.initComponent(ComponentManager.java:358)
… 7 more
Caused by: java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616 due to: java.net.BindException: Address already in use: JVM_Bind
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
at org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1546)
at org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:1958)
at org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:1911)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:471)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
… 20 more
Caused by: java.io.IOException: Failed to bind to server socket: tcp://0.0.0.0:61616 due to: java.net.BindException: Address already in use: JVM_Bind
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:139)
at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
at org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:131)
at org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:304)
at org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:133)
at org.apache.activemq.broker.TransportConnector.asManagedConnector(TransportConnector.java:96)
at org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1541)
… 26 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.(Unknown Source)
at javax.net.DefaultServerSocketFactory.createServerSocket(Unknown Source)
at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
… 32 more
======== OPENGAMMA STARTUP FAILED ========”

Please help me with this.

Right now, my goal is making the program run, and then plug in some portfolio data and calculate the delta and build the vol surface.

Address already in use: JVM_Bind , tcp://0.0.0.0:61616. Looks like something is already running on this port

What code did you download? A 2.1 source bundle or a GitHub clone?

I agree on the JVM bind error. Exiting Eclipse and restarting ought to clear that.

One other possibility is that you have installed OpenGamma as a binary as well. If so, then you’ll need to stop that before starting OpenGamma from source code.

  1. Goto OG-Platform/examples/examples-simulated/target/classes/fullstack/

  2. Open the file called fullstack-examplessimulated.properties

  3. Then look for activemq.port = 61616 and changed it to 61617

  4. (Optional) If you want to change the port from localhost:8080 then also look for jetty.port = 8080 and change it to 8081

I now have three instances of OpenGamma running port 8080, 8081, 8082