# License File Not Specified  & com.apama.EngineException: Failed to connect to engine..

**URL:** <https://community.cumulocity.com/t/license-file-not-specified-com-apama-engineexception-failed-to-connect-to-engine/1451>\
**Category:** Forum\
**Tags:** Streaming-Analytics-Apama\
**Created:** [February 29, 2016, 1:47pm UTC](https://community.cumulocity.com/t/license-file-not-specified-com-apama-engineexception-failed-to-connect-to-engine/1451 "2016-02-29T13:47:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkata\_Reddy\_K](https://avatars.discourse-cdn.com/v4/letter/v/d9b06d/32.png) [@Venkata\_Reddy\_K](https://community.cumulocity.com/u/Venkata_Reddy_K)\
**Post date:** [February 29, 2016, 1:47pm UTC](https://community.cumulocity.com/t/license-file-not-specified-com-apama-engineexception-failed-to-connect-to-engine/1451/1 "2016-02-29T13:47:36Z")

</div>

Hi All,

Hope everyone is doing well.

I am running a java application which is internally pushing some message to Apama. I am facing two issues as below

1. License File Not Specified : Though I have copied a valid license file under the Apama work folder as below

2. Second error is something like below:

Weight45.0  
WARN : EngineClientBean failed to create EngineManagement interface: Failed to connect to engine; root exception is: Connection refused: connect  
ERROR : Event sending failed:  
com.apama.EngineException: Failed to connect to engine; root exception is: Connection refused: connect  
at com.apama.engine.EngineManagementFactory.connectToEngineViaTCP(EngineManagementFactory.java:169)  
at com.apama.engine.EngineManagementFactory.connectToEngineViaTCP(EngineManagementFactory.java:120)  
at com.apama.engine.EngineManagementFactory.connectToEngine(EngineManagementFactory.java:56)  
at com.apama.engine.beans.EngineClientBean.connect(EngineClientBean.java:1318)  
at com.apama.engine.beans.EngineClientBean.getEngineManagement(EngineClientBean.java:285)  
at com.apama.engine.beans.EngineClientBean.sendEvents(EngineClientBean.java:1808)  
at com.apama.services.event.internal.EventService.sendEvent(EventService.java:414)  
at com.twitter.TwitterWatch.(TwitterWatch.java:47)  
at com.twitter.MyScheduler1.getData(TwitterWatch.java:129)  
at com.twitter.TwitterWatch.main(TwitterWatch.java:71)  
Caused by: com.apama.message.MessagingException: Connection refused: connect  
at com.apama.transport.rpc.ControlConnection.transformExceptionStatic(ControlConnection.java:500)  
at com.apama.transport.rpc.ControlConnection.getConnection(ControlConnection.java:1038)  
at com.apama.correlator.corba.CorrelatorManagement\_TCP.(CorrelatorManagement\_TCP.java:253)  
at com.apama.engine.EngineManagementFactory.connectToEngineViaTCP(EngineManagementFactory.java:157)  
… 9 more  
Caused by: java.net.ConnectException: Connection refused: connect  
at java.net.DualStackPlainSocketImpl.connect0(Native Method)  
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)  
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)  
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)  
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)  
at java.net.PlainSocketImpl.connect(Unknown Source)  
at java.net.SocksSocketImpl.connect(Unknown Source)  
at java.net.Socket.connect(Unknown Source)  
at java.net.Socket.connect(Unknown Source)  
at java.net.Socket.(Unknown Source)  
at java.net.Socket.(Unknown Source)  
at com.apama.transport.rpc.Connection.(Connection.java:98)  
at com.apama.transport.rpc.ControlConnection.(ControlConnection.java:124)  
at com.apama.transport.rpc.ControlConnection.getConnection(ControlConnection.java:1030)  
… 11 more

Please help me to get rid of this error at the earliest.

Regards,  
Venkat.

---

<div class="post-metadata">

**Author:** ![Ben\_Spiller](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/ben_spiller/32/30392_2.png) [@Ben\_Spiller](https://community.cumulocity.com/u/Ben_Spiller)\
**Post date:** [February 29, 2016, 3:53pm UTC](https://community.cumulocity.com/t/license-file-not-specified-com-apama-engineexception-failed-to-connect-to-engine/1451/2 "2016-02-29T15:53:21Z")

</div>

In 5.3 it’s necessary to explicitly pass the location of the license file to the correlator when starting it (using the --license option; from designer see the option in Apama section of preferences)

This probably also explains the second problem you’re seeing, as without a license you would not be able to connect to the correlator from a different machine. If that doesn’t help, then you should check the host/port information you’re using for your client matches the correlator’s and that there is no firewall interfering. The “Connection refused” error you’re getting is from the OS sockets layer and simply means there is nothing to connect to on the specific host and port.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [April 2, 2021, 3:35pm UTC](https://community.cumulocity.com/t/license-file-not-specified-com-apama-engineexception-failed-to-connect-to-engine/1451/3 "2021-04-02T15:35:30Z")

</div>


