PDA

View Full Version : Bind Error


jamesclinton
03-06-2007, 04:37 PM
Hello

I have executed tests and demo apps within the LS servlet container successfully. I am now moving this into my own container but get the flollowing error:

"ER Bind, unable to find Engine"

Is this error related to:

(1) lsengine.html file in ls directory OR
(2) to the lsengine_config.js ?

Thank You.

jamesclinton
03-06-2007, 05:12 PM
Fixed above error.

Next problem is:

"ER LS_getConfiguredEngineName The engine is not bound. Check the ../lsengine_config.js configuration file."

AFAIK my config file is congfigured correctly:

var ls = new LightstreamerEngine();
ls.context.setDomain("patsystems.com");
ls.connection.setLSHost("lonpc-011861.patsystems.com");
ls.connection.setStreamPort(8085);
ls.connection.setControlPort(8085);
ls.connection.setAdapterName("GUIDISPLAYMONITOR");
ls.bind();

Any thoughts?

Mone
03-06-2007, 06:05 PM
Hi,

Are you talking about the framed version or the single frame version?

The lsengine_config.js seems correct, is the url of your lsengine_config.js file - relatively to the library folder - equals to "../lsengine_config.js"?

Do you see any errors in the javascript console of your browser?

PS: you can now substitute the port calls (setStreamPort (http://www.lightstreamer.com/docs/client_web_jsdoc/Connection.html#setStreamPort) & setControlPort (http://www.lightstreamer.com/docs/client_web_jsdoc/Connection.html#setControlPort)) with the new setLSPort (http://www.lightstreamer.com/docs/client_web_jsdoc/Connection.html#setLSPort)

jamesclinton
03-06-2007, 10:55 PM
Are you talking about the framed version or the single frame version?
Single framed version.

The lsengine_config.js seems correct, is the url of your lsengine_config.js file - relatively to the library folder - equals to "../lsengine_config.js"?
Yes

Do you see any errors in the javascript console of your browser?
No errors

We have a feeling this is related to the domain configuration (maybe todo with JBoss) - we are going to look in this further tomorrow and hope if we find a problem that thisl resolves the issues with the engine configuration....will post back soon.

Does lightstreamer have support for JSF?

jamesclinton
03-07-2007, 12:15 PM
OK. We now have the domain/lsPage.bind working without error.

var lsPage = new PushPage();
lsPage.context.setDomain("PATSYSTEMS.COM");
lsPage.bind();
lsPage.loadEngine("../ls/lsengine.html?config=../lsengine_config.js");

However, we still have problems when loading the lsengine_config. An alert jumps out stating "Engine not bound check lsengine_config.js".

An alert follows that stating 'ER Bind unable to find engine. Please check configuration".

The javascript error is:
----------------------------
Error: Object doesn't support this property or method
URL: http://mypc.patsystems.com:8080/websara/ls/lsengine.html?config=../lsengine_config.js

Any ideas?

jamesclinton
03-07-2007, 02:41 PM
The reason for all the headache is becuase we used SiteMesh (similar to Tiles) to manage our pages. The sitemesh filter is breaking the lightstreamer magic.

Can you recommend a templating technology which works with the web client api?

Thanks

Alessandro
03-08-2007, 06:24 PM
James,

I know some partners have successfully used Struts+Tiles together with Lightstreamer.

Cheers

aps2007
03-21-2007, 10:44 AM
Hi,

Im facign a similar problem when i try to run the demo stocklist application externally using tomcat.Whn i try to access the index page i get an alert 'ER Bind unable to find engine.Check configurations.The same same page works fine with Firefox. Has anyone encountered a similar problem? Please reply if yes.

Cheers,

AN

Mone
03-21-2007, 12:34 PM
Hi,

Which browser shows you the error?
Are you talking about the framed version or the single frame version?
Did you follow the "external deployment" section of the README.TXT located under /Lightstreamer/DOCS-SDKs/sdk_client_web/examples/StockListDemo ?

aps2007
03-21-2007, 12:50 PM
Hi,

I'm getting ther error in Internet Explorer 7. I did follow the instructions given under external deployment.I'm using the single framed version.

Mone
03-21-2007, 01:17 PM
Hi,

could you check this demo: http://app.lightstreamer.com/_StockListDemoExample/index.html with your IE7?

Is this working?
Do you see some javascript exceptions?

aps2007
03-21-2007, 01:22 PM
Hi,
I can access the url given in IE7.
Is it some configuration problem with my code
var lsPage = new PushPage();
//lsPage.context.setDebugAlertsOnClientError(false);
lsPage.context.setDomain("mycomp.co.in");
lsPage.onEngineCreation = startEngine;
lsPage.bind();
alert('create engine');
lsPage.createEngine("SLEngine", "ls/");
//starting subscribing first 15 stocks
changePage(1);

function startEngine(eng) {
eng.context.setDebugAlertsOnClientError(true);
eng.policy.setMaxBandwidth(30);
eng.policy.setIdleTimeout(30000);
eng.policy.setPollingInterval(1000);
eng.connection.setLSHost("mycomp.co.in");
eng.connection.setLSPort(9990);
eng.connection.setAdapterName("STOCKLISTDEMO");
eng.changeStatus("STREAMING");

Mone
03-21-2007, 02:13 PM
Hi,

you are in a particular case where the domain set is equal to Lightstreamer host.
Please take a look at the documentation of the setDomain (http://www.lightstreamer.com/docs/client_web_jsdoc/Context.html#setDomain) method, you will find some info there.

NOTE: I've deleted the application at http://app.lightstreamer.com/_StockL...ple/index.html (http://app.lightstreamer.com/_StockListDemoExample/index.html)

aps2007
03-21-2007, 03:04 PM
Hi,

Changed the domain name to null.It works fine now.
Thanks

Mone
03-26-2007, 05:28 PM
If you can you should change the hostname or the domain in a way that they look different.

eg:
domain - lightstreamer.com
LSHost - push.lightstreamer.com

this way you will see your app running on both IE and FX

rd2008
09-30-2008, 09:45 AM
but in that case it says that domain and hosts are inconsistent. actually wht's meant by this domain and host. it confuses many times. specially in the case of deploying in two servers as external web server and light stream server. Can you please make a simple but detailed description of these two. Also can you please tell us how to create these host/domain in developer environment and production environment?

DarioCrivelli
10-01-2008, 12:31 PM
The setting of "domain names" on the pages is imposed by the browsers, any time you need to allow pages coming from different hosts to see each other.
See http://en.wikipedia.org/wiki/Same_origin_policy, for instance.

Lightstreamer must cope with this limitation, because production front-ends based on Lightstreamer take pages from both a web server and Lightstreamer Server
and the Web Client Library just wraps the domain name setting through the "setDomain" method.

The general rule is that you must supply to "setDomain" a domain name such that both the web server host name and Lightstreamer Server host name are compatible with the chosen domain name, where:

The web server host name is the one contained in the url by which you recall the pages.
Lightstreamer Server host name is the name you supply to "setLSHost".

Obviously, if no domain name ensures compatibility with the required web server and Lightstreamer Server host names, then the front-end can't push.

The compatibility rules depend on the browsers.
I have no link to the complete rule; I hope someone who has could contribute. The most common case is that the xxx.yyy.zzz host name is compatible with the yyy.zzz domain name, but many special cases are also covered.
The web client library performs a preliminary check on the names supplied.
In your case, if you used a domain name and a LSHost which are consistent (as in the example by Simone), you might incur in an inconsistency between the domain name and the web server host name you used to recall your page from the browser.

There are no different rules for production and development environments.
However, there are cases that are not suitable for production but may be adopted for development if development environment limitations leave them as the only possible resort.
For instance in your development environment, the web server, Lightstreamer Server and test browser may all be on the same PC and no name of the form xxx.yyy.zzz may be available to access it, but only "localhost".
In this case, we suggest that you play with your "hosts" file in order to set dummy names for your PC;
but it turned out that you might also use "localhost" as LSHost and also recall the pages from "localhost", provided that you
either issue setDomain(null) and see the pages on an IE browser,
or issue setDomain("localhost") and see the pages on a FF browser.

ctranfd
02-13-2009, 07:30 AM
Hello,

I've been reading some of the posts regarding bind errors - mostly around setting hostnames and domain names.

I've set up an web server + lightstreamer server on the same machine with:

web server domain name: mysite.com
lightstreamer server: lightstreamer.mysite.com
lightstreamer server port: 8090

I've managed to have a page served from the web server working on Firefox and Chrome, but I'm having trouble with IE6 and IE7 - I get the following error "ER bind Unable to find the Engine. Retrying. If the problem persists, please check your configuration."

This is what I've set up:


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>mysite.com</title>
<script language="JavaScript" src="ls/lscommons.js"></script>
<script language="JavaScript" src="ls/lspushpage.js"></script>
</head>
<body>

<div class="fieldA" source="lightstreamer" table="mytable" item="theItem" field="fieldA">
LOADING...
</div>

<div class="fieldB"source="lightstreamer" table="mytable" item="theItem" field="fieldB">
LOADING...
</div>

<script type="text/javascript">

var page = new PushPage();
page.context.setDomain("mysite.com");
page.onEngineCreation = function(engine) {
engine.context.setDebugAlertsOnClientError(true);

engine.connection.setLSHost("lightstreamer.mysite.com");
engine.connection.setLSPort(8090);
engine.connection.setAdapterName("MYSITE");
engine.changeStatus("STREAMING");
}
page.bind();
page.createEngine("MySiteApp", "ls", "SHARE_SESSION");

var pushtable = new OverwriteTable(null, null, "MERGE");
pushtable.setPushedHtmlEnabled(true);
pushtable.setSnapshotRequired(true);
page.addTable(pushtable, "mytable");
</script>

</body>
</html>


From the JS API (http://www.lightstreamer.com/docs/client_web_jsdoc/Context.html#setDomain) - I've set the domain to be null for IE, but with no luck.

Just wondering if I'm missing something?

Many Thanks,

C

Mone
02-13-2009, 10:01 AM
hi,

the problem with IE is that your web server is equal to your domain name.
you should extend your web server name to let the application run on IE:

web server: web.mysite.com
domain name: mysite.com
lightstreamer server: lightstreamer.mysite.com
lightstreamer server port: 8090

Hope that helps

ctranfd
02-16-2009, 11:42 PM
Thanks! It worked :D

Just a note if anyone is testing this locally, I updated my hosts file with the 3 domains mentioned below.

127.0.0.1 mysite.com
127.0.0.1 web.mysite.com
127.0.0.1 lightstreamer.mysite.com

ctranfd
03-22-2009, 03:20 AM
Hi again,

I'm now trying to work on the real example on my machine and am coming across the same problem when I add the "environment" to the URL (local, uat, stage... etc).

The set up is as follows:

Domain: local.mysite.com
Web: local.www.mysite.com
Port: 8071
Lighstreamer: local.lightstreamer.mysite.com
Lightstreamer Port: 8090

However I have a feeling that the entries in my host file conflicts with how the domain is being interpreted.

127.0.0.1 local.mysite.com.au
127.0.0.1 local.www.mysite.com.au
127.0.0.1 local.lightstreamer.mysite.com.au
127.0.0.1 local.www.lightstreamer.mysite.com.au

This is what I have on the client side:

<script language="JavaScript" src="http://local.www.mysite.com.au:8071/lightstreamer/js/lscommons.js"></script>
<script language="JavaScript" src="http://local.www.mysite.com.au:8071/lightstreamer/js/lspushpage.js"></script>

<div table="hellotable" item="item-test" field="field1">
loading...
</div>

<script>
var page = new PushPage();
page.context.setDomain("local.www.mysite.com.au");
page.onEngineCreation = function(engine) {
engine.context.setDebugAlertsOnClientError(true);
engine.connection.setLSHost("local.www.lightstreamer.mysite.com.au");
engine.connection.setLSPort(8090);
engine.connection.setAdapterName("PROXY_HELLOWORLD_SOCKETS");
engine.changeStatus("STREAMING");
}
page.bind();
page.createEngine("HelloWorldApp", "lightstreamer/js", "SHARE_SESSION");

var pushtable = new OverwriteTable(null, null, "MERGE");
pushtable.setPushedHtmlEnabled(true);
pushtable.setSnapshotRequired(true);
page.addTable(pushtable, "hellotable");
</script>

I also noticed that I needed to specifically put the "www" in the page domain and lightstreamer host.

Many Thanks,

C

Mone
03-23-2009, 10:30 AM
given that your web server is reached throug local.www.mysite.com (http://www.mysite.com) and that your lightstreamer server is reached through local.lightstreamer.mysite.com, you can't use local.mysite.com as domain as it doesn't match neither host.

Hosts and domain must respect the "same origin policy (https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript)".
So you should use as domain only mysite.com.

If you prefer/need a longer domain, another possibility is the following:
Web Server: www.local.mysite.com (http://www.local.mysite.com)
Lightstreamer Server: lightstreamer.local.mysite.com
Domain: local.mysite.com

Hope that helps.

Note that Opera poses further limits to this policy. Check these thread for details: http://www.lightstreamer.com/vb/showthread.php?t=28 and http://www.lightstreamer.com/vb/showthread.php?t=96

ctranfd
03-24-2009, 02:15 AM
Hi Mone,

Thanks for your reply. Unfortunately, we're unable to change the way the URL is constructed for our web app. I don't envisage the domain issue to be a problem when we go live, but we would require users to test on the UAT and Stage environments before we go live.

Is there another way in which we could keep the subdomain "www" in the URL (local.www.mysite.com)?

I've also tried:

domain: local.www.mysite.com, local.mysite.com
web: web.local.www.mysite.com, web.local.mysite.com
lightstreamer: lighstreamer.local.www.mysite.com, lighstreamer.local.mysite.com

Many Many Thanks,

C

DarioCrivelli
03-24-2009, 10:40 AM
I can't understand why sometimes you use host/domain names that end with ".com.au" and sometimes you use names that end with ".com".
May you also clarify which constraints your application server imposes you on the names you can use? Does it also affect the generation of javascript code?

Referring to the above client code, setting
page.context.setDomain("mysite.com.au");
should work.
Moreover, as the domain is only a pattern, you don't need a hosts file entry for the domain name.

ctranfd
03-24-2009, 11:35 PM
Hi Dario,

Sorry that was just a typo - I was removing the name of actual site that I'm working on. So for this case, I've tried to keep it generic to mysite.com.
Just to clarify, I use the hosts file for testing locally (as the site is currently live, but without the new functionality I'm currently working on).

When we go live with the new functionality, there shouldn't be a problem with using:

Site: mysite.com
Web: www.mysite.com
Lightstreamer: lightstreamer.mysite.com

The problem arises when we include the environment (local, uat, stage) and "www" in the URL, such as local.www.mysite.com.

Is there something else I need to do for this to work?

Many Thanks,

C

DarioCrivelli
03-25-2009, 09:39 AM
Setting the domain to "mysite.com" should work also with longer hostnames, provided that all of them end in "mysite.com".
Did you try it and find any problems?
Or is the "mysite.com" domain name unacceptable in your testing environment?

The name combinations that you reported should work as well.
I Refer to:
domain: local.www.mysite.com
web: web.local.www.mysite.com
lightstreamer: lighstreamer.local.www.mysite.com

domain: local.mysite.com
web: web.local.mysite.com
lightstreamer: lighstreamer.local.mysite.com

If you had them not working, then the problem may no longer be related to domain name choice.
Please concentrate on one of the above cases and provide us with more detais.

ctranfd
03-29-2009, 03:30 AM
Hello,

I managed to get it working with the following:

domain: mysite.com
web: local.www.mysite.com
lightstreamer: lightstreamer.mysite.com

The site that I work on dynamically builds the location of files that are placed in a "static" file directory to be in the site root directory (i.e. mysite.com/).
The problem turned out the html files in the ls directory (mysite.com/ls) were not getting resolved properly (ie. not resolved to be in mysite.com/ls).

Thanks for all your help :)

gmotodd
04-28-2009, 05:39 PM
Hi.

I've read this thread and a couple more regarding "Unable to find the engine", but I still have a problem. I have LS and an IIS 6 webserver on the same machine. LS is under the default 8080 port. My Data Adapter is a C# adapter successfully opening the TCP ports specified in adapters.xml when started.

These are my configs:

Hosts file:
127.0.0.1 localhost
127.0.0.1 archtst1.test.alaskaair.com
127.0.0.1 push.archtst1.test.alaskaair.com

Client script:

<script type="text/javascript">
var page = new PushPage();
page.context.setDomain("archtst1.test.alaskaair.com");
page.onEngineCreation = startEngine;
page.bind();
page.createEngine("CBOFlightPublisher", "JSLib", "SHARE_SESSION");

function startEngine(engine)
{
engine.connection.setAdapterName("LSADAPTERDEMO");
engine.changeStatus("STREAMING");
engine.connection.setLSHost("push.archtst1.test.alaskaair.com");
engine.connection.setLSPort("8080");
}

var pushtable = new OverwriteTable(null, null, "MERGE");
page.addTable(pushtable, "EventTargetTable");
</script>

Any feedback will be most appreciated.
-Guillermo

Mone
04-29-2009, 11:03 AM
hi Guillermo, please see my reply in the other thread (http://www.lightstreamer.com/vb/showpost.php?p=1801&postcount=4).

ctranfd
04-30-2009, 02:37 AM
Hi Guillermo,

Try putting these host entries:
127.0.0.1 localhost
127.0.0.1 alaskaair.com
127.0.0.1 test.alaskaair.com
127.0.0.1 archtst1.test.alaskaair.com
127.0.0.1 push.alaskaair.com

If it helps, this was what I had:

127.0.0.1 local.mysite.com
127.0.0.1 local.www.mysite.com
127.0.0.1 lightstreamer.mysite.com
127.0.0.1 lightstreamer.www.mysite.com

And the javascript was set up like this:

var page = new PushPage();
page.context.setDomain("mysite.com"); //for you, try: alaskaair.com

//create the engine
page.onEngineCreation = function(engine) {
engine.context.setDebugAlertsOnClientError(true);
engine.connection.setLSHost("lightstreamer.mysite.com"); //for your case try: push.alaskaair.com
engine.connection.setLSPort(8090); //for your case 8080
engine.connection.setAdapterName("MyAdapter"); //change to your required adapter
engine.changeStatus("STREAMING");
}
page.bind();
page.createEngine("MyApp", "http://local.www.mysite.com/LS", "SHARE_SESSION"); //for your case, http://archtst1.test.alaskaair.com/JSLib or move the JS files to http://archtst1.test.alaskaair.com/LS

Hope that helps!

C