PDA

View Full Version : Issue Starting the Server



ryancanulla
12-22-2010, 10:34 PM
Hi there,

I'm running the server from terminal and getting (below). Does this mean it started successfully?

Also, in my server/config/configuration.xml I am on port 8080 but the documentation had me using 9899. I assume that these should match, is that correct?? When I run my hello world I do not get a response from the server.

Thanks in advance!




BOS-RCANULLA:ElectroServer_5_1 staffhome$ ./Start_ElectroServer_5_1
17:22:01,953 [main] INFO DisplayLogger -
_____ _ _ ____
| ____| | ___ ___| |_ _ __ ___ ___ ___ _ ____ _____ _ __ | ___|
| _| | |/ _ \/ __| __| '__/ _ \/ __|/ _ \ '__\ \ / / _ \ '__| |___ \
| |___| | __/ (__| |_| | | (_) \__ \ __/ | \ V / __/ | ___) |
|_____|_|\___|\___|\__|_| \___/|___/\___|_| \_/ \___|_| |____/

Starting ElectroServer 5.1.0
Go to http://www.electrotank.com/ for the latest version.
################################################## #########
Computer Information
Operating System: Mac OS X
Operating System Architecture: x86_64
Processors Available: 4
Memory Available: 881Mb
################################################## #########
Virtual Machine Information
Virtual Machine Vendor: Apple Inc.
Virtual Machine Version: 1.6.0_22


BOS-RCANULLA:ElectroServer_5_1 staffhome$





<settings>
<connection host="127.0.0.1" port="8080" transport="BinaryTCP" serverId="server1" />
</settings>




package {

//Flash imports
import com.electrotank.electroserver5.ElectroServer;
import com.electrotank.electroserver5.api.ConnectionRespo nse;
import com.electrotank.electroserver5.api.LoginRequest;
import com.electrotank.electroserver5.api.LoginResponse;
import com.electrotank.electroserver5.api.MessageType;
import com.electrotank.electroserver5.api.PrivateMessageE vent;
import com.electrotank.electroserver5.api.PrivateMessageR equest;

import flash.display.Sprite;
import flash.text.TextField;

/**
* @author Jobe Makar - jobe@electrotank.com
*/
public class Main extends Sprite {

//ElectroServer class instance
private var _es:ElectroServer;

//text field to show log messages
private var _logField:TextField;

public function Main():void {
initialize();
}

private function initialize():void {
createLogField();

//create new ElectroServer instance for use in communicating with the server
_es = new ElectroServer();

//add listeners
_es.engine.addEventListener(MessageType.Connection Response.name, onConnectionResponse);
_es.engine.addEventListener(MessageType.LoginRespo nse.name, onLoginResponse);
_es.engine.addEventListener(MessageType.PrivateMes sageEvent.name, onPrivateMessageEvent);


//set the connection information
_es.loadAndConnect("../assets/settings.xml");

log("Connecting to 127.0.0.1 on port 9899...");
}

/**
* Creates a log field to show log messages
*/
private function createLogField():void{
_logField = new TextField();
_logField.width = 500;
_logField.height = 250;
_logField.x = 50;
_logField.y = 50;
_logField.border = true;
addChild(_logField);
}

/**
* Event handler used to capture a login response
*/
public function onLoginResponse(e:LoginResponse):void {
if (e.successful) {
log("Login accepted. Logged in as " + e.userName);

//create the request
var pmr:PrivateMessageRequest = new PrivateMessageRequest();
//pmr.userNames([e.userName]);
//pmr.message("Hello World!");

//send it
_es.engine.send(pmr);

log("Sending myself a private message.");
} else {
log("Login failed. Reason: " + e.error.name);
}
}

/**
* Event handler used to capture private messages
*/
public function onPrivateMessageEvent(e:PrivateMessageEvent):void {
log("Private message received from " + e.userName + ". Message: " + e.message);
}

/**
* Event handler used to capture the result of a connection attempt
*/
public function onConnectionResponse(e:ConnectionResponse):void {
if (e.successful) {
log("Connection accepted.");

//build the request
var lr:LoginRequest = new LoginRequest();
lr.userName = "coolman" + Math.round(10000 * Math.random());

//send it
_es.engine.send(lr);

log("Sending login request.");
} else {
log("Connection failed. Reason: " + e.error.name.toString());
}
}

/**
* Logs a message to an on-screen text field
*/
private function log(str:String):void {
_logField.appendText(str + "\n");
}

}

}

tcarr
12-22-2010, 10:44 PM
Port 8080 is the default port for the ES Admin, which has to be a different port than the clients connect to. Configuration.xml specifies the ES Admin settings. After that's set, and ES5 is started, you use the ES Admin (possibly remotely) to make other changes. If ES5 starts successfully, then the server/logs/ElectroServer5.log file will say "started successfully". You can view this log either from the server itself, or using the ES Admin's Server Monitoring, Logs screen.

ryancanulla
12-22-2010, 11:09 PM
My log doesn't have "success". Any chance I need to do this/you have the process documented?

"If you install the VM and the server won't start, you will need to define the environment variable "INSTALL4J_JAVA_HOME" to point to your VM installation folder."

tcarr
12-22-2010, 11:13 PM
Since I'm seeing Virtual Machine Version: 1.6.0_22 in your console, it must have found the VM, so that's not it. I suggest that you uninstall and then reinstall a fresh copy, in case something got garbaged when you downloaded. This section of the manual (http://www.electrotank.com/docs/es5/manual/installation.htm) has advice on the different steps needed for installation and configuration.

tcarr
12-22-2010, 11:15 PM
Further thoughts: exactly what DOES show in your ES5 log? Is there anything showing in the Console.log in the same folder? Sometimes startup errors will show in the Console log.

ryancanulla
12-22-2010, 11:21 PM
My Log:


2010-Dec-22 18:20:20:654 [main] INFO DisplayLogger -
_____ _ _ ____
| ____| | ___ ___| |_ _ __ ___ ___ ___ _ ____ _____ _ __ | ___|
| _| | |/ _ \/ __| __| '__/ _ \/ __|/ _ \ '__\ \ / / _ \ '__| |___ \
| |___| | __/ (__| |_| | | (_) \__ \ __/ | \ V / __/ | ___) |
|_____|_|\___|\___|\__|_| \___/|___/\___|_| \_/ \___|_| |____/

Starting ElectroServer 5.1.0
Go to http://www.electrotank.com/ for the latest version.
################################################## #########
Computer Information
Operating System: Mac OS X
Operating System Architecture: x86_64
Processors Available: 4
Memory Available: 881Mb
################################################## #########
Virtual Machine Information
Virtual Machine Vendor: Apple Inc.
Virtual Machine Version: 1.6.0_22


Console Log:


java.lang.RuntimeException: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at com.electrotank.electroserver5.servers.db.dao.Regi strySettingsDaoImpl.load(RegistrySettingsDaoImpl.j ava:20)
at com.electrotank.electroserver5.Main.processCommand LineResults(Main.java:238)
at com.electrotank.electroserver5.Main.invoke(Main.ja va:211)
at com.electrotank.electroserver5.bootstrap.Main.star t(Main.java:70)
at com.electrotank.electroserver5.bootstrap.Main.main (Main.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unkno wn Source)
Caused by: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.g etSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLExcepti on(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLExcepti on(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLExcep tion(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLE xception(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDat abase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnecti on(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unkno wn Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unk nown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:582)
at java.sql.DriverManager.getConnection(DriverManager .java:185)
at com.ibatis.common.jdbc.SimpleDataSource.popConnect ion(SimpleDataSource.java:580)
at com.ibatis.common.jdbc.SimpleDataSource.getConnect ion(SimpleDataSource.java:222)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTran saction.init(JdbcTransaction.java:48)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTran saction.getConnection(JdbcTransaction.java:89)
at com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeQueryForObject(GeneralStatement.j ava:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.queryForObject(SqlMapExecutorDelegate.java:566)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.queryForObject(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.qu eryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.qu eryForObject(SqlMapSessionImpl.java:110)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.que ryForObject(SqlMapClientImpl.java:87)
at com.electrotank.electroserver5.servers.db.dao.Regi strySettingsDaoImpl.load(RegistrySettingsDaoImpl.j ava:18)
... 10 more
Caused by: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.get SQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.w rapArgsForTransportAcrossDRDA(Unknown Source)
... 35 more
java.lang.Error: java.lang.RuntimeException: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at com.electrotank.electroserver5.Main.processCommand LineResults(Main.java:256)
at com.electrotank.electroserver5.Main.invoke(Main.ja va:211)
at com.electrotank.electroserver5.bootstrap.Main.star t(Main.java:70)
at com.electrotank.electroserver5.bootstrap.Main.main (Main.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unkno wn Source)
Caused by: java.lang.RuntimeException: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at com.electrotank.electroserver5.servers.db.dao.Regi strySettingsDaoImpl.load(RegistrySettingsDaoImpl.j ava:20)
at com.electrotank.electroserver5.Main.processCommand LineResults(Main.java:238)
... 9 more
Caused by: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.g etSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLExcepti on(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLExcepti on(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLExcep tion(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLE xception(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDat abase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnecti on(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unkno wn Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unk nown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:582)
at java.sql.DriverManager.getConnection(DriverManager .java:185)
at com.ibatis.common.jdbc.SimpleDataSource.popConnect ion(SimpleDataSource.java:580)
at com.ibatis.common.jdbc.SimpleDataSource.getConnect ion(SimpleDataSource.java:222)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTran saction.init(JdbcTransaction.java:48)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTran saction.getConnection(JdbcTransaction.java:89)
at com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeQueryForObject(GeneralStatement.j ava:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.queryForObject(SqlMapExecutorDelegate.java:566)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.queryForObject(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.qu eryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.qu eryForObject(SqlMapSessionImpl.java:110)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.que ryForObject(SqlMapClientImpl.java:87)
at com.electrotank.electroserver5.servers.db.dao.Regi strySettingsDaoImpl.load(RegistrySettingsDaoImpl.j ava:18)
... 10 more
Caused by: java.sql.SQLException: Failed to start database 'db', see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.get SQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.w rapArgsForTransportAcrossDRDA(Unknown Source)
... 35 more

tcarr
12-22-2010, 11:57 PM
That happens if you have more than one instance of ElectroServer running. Try "ps -ef | grep java" and kill -9 any pid that mentions ElectroServer5. Then try starting again. Or just restart your Mac.

ryancanulla
12-23-2010, 12:08 AM
I got it running when I installed with the tar.gz. My previous errors were from a DMG installation.

tcarr
12-23-2010, 12:55 AM
Glad you got it working!