I am using following code to connect my JAVA web application to Light Streamer

Code:
public native static void init(String username, String password)
	/*-{
		$wnd.user_name = username;		
		var divTag = document.createElement("div");
		divTag.id = "list";

		divTag.setAttribute("class","ClassName");
		divTag.setAttribute("source","lightstreamer");
		divTag.setAttribute("table","TableName");
		divTag.setAttribute("item",username+"#TableName");
		divTag.setAttribute("field","FieldName");
		divTag.style.display = 'none'; 
		document.body.appendChild(divTag);

		$wnd.page = new $wnd.PushPage();
		$wnd.page.context.setDomain("chellasoftapp.com"); 
		$wnd.page.onEngineCreation = function(engine) {
			$wnd.lsEngine = engine;

			engine.connection.setLSHost("domainName.com"); 
			engine.connection.setLSPort("port"); 
			
			engine.connection.setAdapterName("AdapterName");						

			engine.connection.setUserName(username);
			engine.connection.setPassword(password);

			engine.changeStatus("STREAMING");
		}

		$wnd.page.bind();		
		$wnd.page.createEngine("AdapterName", "LS", "SHARE_SESSION", true);

		var itemName = username+"#iTableName";
		$wnd.pushtable = new $wnd.NonVisualTable(itemName, new Array("TableName"), "DISTINCT");
		$wnd.chellaSoft = this;
		$wnd.pushtable.onItemUpdate = function (item, updateInfo) {
			$wnd.jsonUpdatedStaticJS(updateInfo.getNewValue("FieldName"));
		}

		$wnd.page.addTable($wnd.pushtable, "TableName");
	}-*/;
I had called this method, once the user submit his/her user name and password.
On first time suppose user type mistype his password. And this methord will called and create the engine without any issue. But, then he type the correct password and submit the details it throws the following error.

“3: 18:0:18,438 ER createEngine createEngine() has already been called” .

please advise me how to overcome to this error? Or give me any other suggestions.