PDA

View Full Version : [Solved] Problems Starting ElectroServer 5 in Windows 7



Phil86Blah
10-14-2010, 12:14 PM
Hi again,

I was contemplating editing my previous post in another thread, although I realised that the question that had just arisen was completely different than what was already being discussed in the other thread. Anyway the problem I am facing is actually starting up ES5 in Windows 7.

I have installed ES5 in the Program Files folder and was wondering if there was a way to start up the server without having to uninstall the program and reinstalling it in another location on the hard drive.

I realised that maybe the reason for me being unable to login to the server was because the server wasnt actually running in the first place. There was no icon in the bottom right hand corner or the screen (near the clock) like there was in ES4. I had come to the conclusion that maybe the server wasnt even running.

Sorry for posting so many questions like this. I could really easily revert back to using ES4, but would really like to test out ES5. Thanks again.

tcarr
10-14-2010, 12:43 PM
If you want to move your installation of ES5, you can copy the entire installation folder and paste it elsewhere. The .exe icons won't work, but the batch file method of running ElectroServer works just fine.

In Windows, the easiest way to tell if ES5 is still running seems to be to try to open the server/logs/ElectroServer5.log file. If it complains that the file is being used by somebody else, then ES5 is up. If you can't connect using the ES Admin, then use Task Manager's processes tab and look for java processes and kill all of them.

PLEASE note that if you have ES4 running on the same box, you will need to make sure that the Configuration.xml file for ES5 uses a different port than ES4 uses for anything (including the port mentioned in ES4's ES4Configuration.xml file). ES5 can't start if the admin port isn't available.

vldbrb
10-25-2010, 10:45 PM
Hi Teresa,

I have a similar problem with ES5, but somehow different. I'll describe it to you:
- Workstation: Win7 Ultimate, 64bit (6Gb RAM)
- ES4 installed as a stopped service, runs mannualy (if I want to)
- New ES5 installation for migrating my app (modifying with net beans)
- the "old" ES4 extension.xml

With that "configuration" my ES5 works fine, it starts fine and the electroserver.log is ok

These are my problems:
1. Sometimes, for "clearing results" i have to delete the electroserver's logs, but even if the ES5 is stopped i can't do it...neither replace an .jar in the server/lib folder (I presume it's still running?)
- How can I install ES5 as a windows service - for quick restarting or emergency stopping?
- How can I kill ES5 process without kill java.exe? My java.exe is used by another VMs...
- How can I know how many ES5 instances are running?
2. My first problem resolution is "vital-like" for debuging the second problem:
- I have an error that says:


2010-ott-25 23:30:23:865 [main] WARN snaq.db.ConnectionPoolManager.unknown0 - unknown0: maxconn property has been deprecated; use maxsize instead
2010-ott-25 23:30:23:868 [main] WARN snaq.db.ConnectionPoolManager.unknown0 - unknown0: expiry property has been deprecated; use idleTimeout instead
2010-ott-25 23:30:23:882 [main] ERROR com.electrotank.electroserver5.servers.registry.Re gistryServer - Error occurred during init: Extension MyExtension failed to start [org/apache/commons/pool/impl/GenericObjectPool]
com.electrotank.electroserver5.entities.exceptions .ExtensionStartupException: Extension VirtualCity failed to start [org/apache/commons/pool/impl/GenericObjectPool]
...and continues...


I've used the ConnectionPoolManager example from ES5 examples. The change that I make was in update to DBPool-5.0.jar for snaq.db

I can't restart my pc 5 times any hour to "release" the ES5 server process... Can you help me?

EDIT: if I try to kill java.exe then I cannot start anymore ES5... I must reinstall the server... My actual configuration (VMs enabled) runs fine with ES4 without errors

tcarr
10-25-2010, 11:14 PM
ES5 does not install as a windows service yet. The easiest way to shut it down is to use the ES Admin - Server Management - Restart and Shutdown. Sometimes if an extension fails to load properly, the ES Admin's Restart doesn't shut down properly either (although usually the Shutdown does work). If you suspect that it hasn't shut down completely, use Task Manager. Click View, Select Columns, then check the Command line and OK. Now look at the processes tab and find your various java.exe processes. You will need to resize the Command line column, but the ES5 one include in the middle of the command line ElectroServer5 or ElectroServer_5 or something similar (exactly what it shows will depend on how you started ES5).

For database examples see code_examples\DatabaseWithJDBC\ and code_examples\DatabaseWithJDBI. Perhaps one of those two will shed some light.

vldbrb
10-25-2010, 11:52 PM
The strange thig is that I can't start ES5 even if I restart the whole workstation. In this case it's obvious that I can't see an ES5 process even if I'm looking at the command line column in task manager... Each time I'm constrained to do a clean reinstall to make it start.

Wich file remains "incomplete" due to unproperly shut down of ES5? Maybe I can "delete" it to permit the properly restart. It's frustrating that I must clean-reinstall the whole server...

It's a strange behavior but I'm not sure if there is a ES5 bug or my pc config... Anyway, to make clear my config if hepls, I'm usig ES5 64bit version on 64bit Win7 Ultimate, 64 bit AMD Phenom II 965BE procesor and 6Gb RAM (triple channel) as harware and software like jdk 1.6.0.20, jre 6, tomcat 6 and Apache 2.2 webserver with MySQL db and separately two VMWare virtual machines (one CentOS, one WinXP)

tcarr
10-26-2010, 12:20 AM
I haven't seen that problem myself, but next time why don't you try using the ES Admin's Server Extensions screen and deleting the extension before you try to shut down ES5. Let me know if that helps. I would also advise you to install ES5 somewhere other than the C:\Program Files directory, because that can sometimes cause trouble. Another thing that might help is to start using the safemode exe, which leaves ES5 running in a command window that you can kill by just clicking the X in the corner - and that should definitely kill the process completely.

Another idea: after you do a clean install but before you start ES5, copy the server/db folder somewhere safe. Then after you use the ES Admin's shut down because the ES5 is hosed again, delete the server/db folder and empty the server/extensions folder. Copy in your saved server/db folder. This should start you clean without any extensions and without needing to uninstall/reinstall.

The strange error is caused by something your extension is doing on startup. I assume that it's the ConnectionPool. I have a lot more confidence that the two database examples work correctly than that the ConnectionPool one does, because I was able to test the two database ones. There isn't anything that the ConnectionPool actually does that I can test.

vldbrb
10-26-2010, 01:01 AM
I don't want to procure any headache to you... ;) I won't post if you think that's coming (tell me)!

My install is on "D:\Electroserver_5_0_1", as any other important installations. Il try the trick with the database copy/replace.

While you're writing i maked the n-th reinstall and copyied the whole ES5 folder to another "safe" location for back-up. I've done the "trick" with the java.exe process that has as command electroserver.exe and works for emergency stopping (THANKS A LOT!!! I haven't know that command column trick...shame on me!)

But the issue of db connection persists... Now I will list the error and my extension.xml and the error that's drive me crazy:

Even if the server starts, I can't login to the admin pannel. If i go to localhost:8080 jetty responds fine, but the flash admin says that credentials are wrong (the same as ever:administator/password)

The error is:



2010-ott-26 02:15:52:932 [main] INFO DisplayLogger -
_____ _ _ ____
| ____| | ___ ___| |_ _ __ ___ ___ ___ _ ____ _____ _ __ | ___|
| _| | |/ _ \/ __| __| '__/ _ \/ __|/ _ \ '__\ \ / / _ \ '__| |___ \
| |___| | __/ (__| |_| | | (_) \__ \ __/ | \ V / __/ | ___) |
|_____|_|\___|\___|\__|_| \___/|___/\___|_| \_/ \___|_| |____/

Starting ElectroServer 5.0.1
Go to http://www.electro-server.com/ for the newest version.
################################################## #########
Computer Information
Operating System: Windows 7
Operating System Architecture: amd64
Processors Available: 4
Memory Available: 61Mb
################################################## #########
Virtual Machine Information
Virtual Machine Vendor: Sun Microsystems Inc.
Virtual Machine Version: 1.6.0_21


2010-ott-26 02:15:55:070 [main] ERROR com.electrotank.electroserver5.servers.registry.Re gistryServer - Error occurred during init: Extension VirtualCity failed to start [org/apache/commons/pool/impl/GenericObjectPool]
com.electrotank.electroserver5.entities.exceptions .ExtensionStartupException: Extension VirtualCity failed to start [org/apache/commons/pool/impl/GenericObjectPool]
at com.electrotank.electroserver5.entities.managers.D efaultExtensionManager.startExtension(DefaultExten sionManager.java:485)
at com.electrotank.electroserver5.entities.managers.D efaultExtensionManager.startExtensions(DefaultExte nsionManager.java:452)
at com.electrotank.electroserver5.entities.managers.D efaultExtensionManager.loadExtensions(DefaultExten sionManager.java:162)
at com.electrotank.electroserver5.servers.registry.Re gistryServer.init(RegistryServer.java:145)
at com.electrotank.electroserver5.servers.adapters.Se rverComponentAdapter.newInstance(ServerComponentAd apter.java:32)
at org.picocontainer.defaults.ConstructorInjectionCom ponentAdapter$1.run(ConstructorInjectionComponentA dapter.java:220)
at org.picocontainer.defaults.ThreadLocalCyclicDepend encyGuard.observe(ThreadLocalCyclicDependencyGuard .java:53)
at org.picocontainer.defaults.ConstructorInjectionCom ponentAdapter.getComponentInstance(ConstructorInje ctionComponentAdapter.java:248)
at org.picocontainer.defaults.DecoratingComponentAdap ter.getComponentInstance(DecoratingComponentAdapte r.java:60)
at org.picocontainer.defaults.CachingComponentAdapter .getComponentInstance(CachingComponentAdapter.java :58)
at org.picocontainer.defaults.DefaultPicoContainer.ge tInstance(DefaultPicoContainer.java:393)
at org.picocontainer.defaults.DefaultPicoContainer.ge tComponentInstance(DefaultPicoContainer.java:374)
at org.picocontainer.defaults.BasicComponentParameter .resolveInstance(BasicComponentParameter.java:77)
at org.picocontainer.defaults.ComponentParameter.reso lveInstance(ComponentParameter.java:114)
at org.picocontainer.defaults.ConstructorInjectionCom ponentAdapter.getConstructorArguments(ConstructorI njectionComponentAdapter.java:257)
at org.picocontainer.defaults.ConstructorInjectionCom ponentAdapter$1.run(ConstructorInjectionComponentA dapter.java:217)
at org.picocontainer.defaults.ThreadLocalCyclicDepend encyGuard.observe(ThreadLocalCyclicDependencyGuard .java:53)
at org.picocontainer.defaults.ConstructorInjectionCom ponentAdapter.getComponentInstance(ConstructorInje ctionComponentAdapter.java:248)
at org.picocontainer.defaults.DecoratingComponentAdap ter.getComponentInstance(DecoratingComponentAdapte r.java:60)
at org.picocontainer.defaults.CachingComponentAdapter .getComponentInstance(CachingComponentAdapter.java :58)
at org.picocontainer.defaults.DefaultPicoContainer$Or deredComponentAdapterLifecycleManager.start(Defaul tPicoContainer.java:644)
at org.picocontainer.defaults.DefaultPicoContainer.st art(DefaultPicoContainer.java:456)
at org.picocontainer.defaults.DefaultPicoContainer.st art(DefaultPicoContainer.java:461)
at com.electrotank.electroserver5.servers.standalone. StandaloneContainerFactory.start(StandaloneContain erFactory.java:56)
at com.electrotank.electroserver5.Main.startUp(Main.j ava:133)
at com.electrotank.electroserver5.Main.processCommand LineResults(Main.java:332)
at com.electrotank.electroserver5.Main.invoke(Main.ja va:249)
at com.electrotank.electroserver5.bootstrap.Main.star t(Main.java:70)
at com.electrotank.electroserver5.bootstrap.Main.main (Main.java:41)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
at org.apache.commons.dbcp.BasicDataSourceFactory.cre ateDataSource(BasicDataSourceFactory.java:156)
at com.vbstudio.world.Controller.newDataSource(Contro ller.java:46)
at com.vbstudio.world.Controller.<init>(Controller.java:31)
at com.vbstudio.world.ControllerFactory.init(Controll erFactory.java:44)
at com.electrotank.electroserver5.entities.ManagedObj ectFactoryBridge$3.call(ManagedObjectFactoryBridge .java:69)
at com.electrotank.electroserver5.entities.BaseBridge .withLockAndClassloader(BaseBridge.java:192)
at com.electrotank.electroserver5.entities.ManagedObj ectFactoryBridge.withLockAndClassloader(ManagedObj ectFactoryBridge.java:102)
at com.electrotank.electroserver5.entities.ManagedObj ectFactoryBridge.initializeFactory(ManagedObjectFa ctoryBridge.java:67)
at com.electrotank.electroserver5.entities.Extension. init(Extension.java:132)
at com.electrotank.electroserver5.entities.managers.D efaultExtensionManager.startExtension(DefaultExten sionManager.java:472)
... 28 more



an here's the extension.xml:


<?xml version="1.0" encoding="utf-8" ?>
<Extension>
<Name>VirtualCity</Name>

<!-- This is used to load data at server start-up and provide it to callers as needed -->
<ManagedObjects>
<ManagedObject>
<Handle>ControllerFactory</Handle>
<Type>Java</Type>
<Path>com.vbstudio.world.ControllerFactory</Path>
</ManagedObject>
<ManagedObject>
<Handle>ManagedConnectionPool</Handle>
<Type>Java</Type>
<Path>com.vbstudio.util.ConnectionPool</Path>
<Variables>
<!-- drivers is a comma separated list of JDBC drivers -->
<Variable name="drivers" type="string">com.mysql.jdbc.Driver</Variable>
<Variable name="logfile" type="string">dbpool.log</Variable>

<!-- Create an array of EsObjects. One object represents a connection pool. -->
<Variable name="pools" type="EsObject">
<Entry>
<Variable name="poolname" type="string">mysqlpool</Variable>
<Variable name="url" type="string">jdbc:mysql://localhost:3306/virtualworld</Variable>
<Variable name="user" type="string">db_user</Variable>
<Variable name="password" type="string">db_password</Variable>
<Variable name="timeout" type="integer">5000</Variable>
</Entry>
</Variable>
</Variables>
</ManagedObject>
</ManagedObjects>

<!-- This handles the process of loading and unloading information about a user when they log in/out. -->
<EventHandlers>
<LoginHandlers>
<LoginHandler>
<Handle>LoginEventHandler</Handle>
<Type>Java</Type>
<Path>com.vbstudio.world.LoginLogoutHandler</Path>
</LoginHandler>
</LoginHandlers>
<LogoutHandlers>
<LogoutHandler>
<Handle>LogoutEventHandler</Handle>
<Type>Java</Type>
<Path>com.vbstudio.world.LoginLogoutHandler</Path>
</LogoutHandler>
</LogoutHandlers>
</EventHandlers>
<Plugins>
<Plugin>
<Handle>WorldPlugin</Handle>
<Type>Java</Type>
<Path>com.vbstudio.world.WorldPlugin</Path>
</Plugin>
<Plugin>
<Handle>AreaPlugin</Handle>
<Type>Java</Type>
<Path>com.vbstudio.world.AreaPlugin</Path>
</Plugin>
<Plugin>
<Handle>TimeStampPlugin</Handle>
<Type>Java</Type>
<Path>com.vbstudio.util.TimeStampPlugin</Path>
</Plugin>
<Plugin>
<Handle>GMSInitializer</Handle>
<Type>Java</Type>
<Path>com.vbstudio.gamemanager.GMSInitializer</Path>
</Plugin>
</Plugins>
</Extension>


I'm using in electroserver/lib:
slf4j-api-1.6.0.jar
jdbi-2.4.7.jar
commons-logging-1.1.1.jar
commons-dbcp-1.2.2.jar
DBPool_v4.8.3.jar
derby.jar
derbyclient.jar
mysql-connector-java-5.0.4-bin.jar
...I know that's some of them are practically the same thing, but not all of them are used...


The "com.vbstudio.util.ConnectionPool" is the same identically DatabaseWithJDBC example included with the ES5 but compiled as part of VirtualCity.jar for "speeding" the app...is that the wrong part? (obviously, the copyright part of your example is intact because I don't want to be trialed). The MySQL database is up and running (phpMyAdmin says ok)

EDIT: the dbpool.log says:
mar ott 26 03:07:24.789 +0200 2010: Registered JDBC driver com.mysql.jdbc.Driver
mar ott 26 03:07:24.789 +0200 2010: Invalid dateformat string specified: null
mar ott 26 03:07:24.789 +0200 2010: Initialized pool mysqlpool (pool=0,max=0,expiry=none)

tcarr
10-26-2010, 01:24 AM
I don't know if the invalid dateformat string will cause a problem. I'm concerned by the java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool. That usually means that you are missing a needed jar file in the lib folder of your extension. Check to make sure that you put your jars into server/extensions/VirtualCity/lib - I've lost count of the number of times I've accidentally copied them to server/lib instead when I wasn't paying close enough attention. Make sure that you have one of the jars listed here (http://www.findjar.com/class/org/apache/commons/pool/impl/GenericObjectPool.html)in your extension's lib folder with the rest of them.

We won't sue you if you use one of our code examples as the basis for your own project. That's what they are there for. I'm not sure what the copyright is on the art assets, but the server side code can definitely be used as long as you don't try to sell it as your code.

vldbrb
10-26-2010, 01:31 PM
Thank You, Teresa!

Indeed, I've copied some jars in the server/lib folder because i was thinking that will be the server that will start them for decrease the memory assigned to the extension. I was thining that I can put only the extension's jar in the extension/lib folder and the rest of dependencies on server/lib to minimise the temp folder size and obviously the memory assigned to the extension...now I presume that approach is wrong.

The invalid dateformat string was present also in the ES4 version of my game, but all works just fine...maybe is caused because my db server uses Y-m-d and not m-d-Y date format

After I have copied the jars in the extension's lib folder, seems that is quite ok, even if the error is changed in "Error occurred during init: Extension VirtualCity failed to start [null]" but I presume the problem may be the getApi() statement in my extension jar. Now I'm investigating for that problem in my WorldPlugin and GMSInitialiser

All right for the code inclusion, I'm not thinking to sell my code at all!!! Anyway, in all the "external" sources included in my jar remains intact the original copyright or author comments.

tcarr
10-26-2010, 01:40 PM
What I would do is scatter logging lines in the init method of each of your server level components and managed objects, to see how far the extension gets before it crashes. The value for getApi() is injected into a plugin, event handler, or managed object factory right before that class's init method is run. I've also seen problems when a typo is made in the Extension.xml file (and those are often quite hard to spot unless you are GOOD at proofreading).

vldbrb
10-26-2010, 04:23 PM
Ok, I've made one single change: I've replaced the jdbi-2.4.7.jar with jdbi-2.2.1.jar...I must investigate why it's doesn't work with the updated version of jdbi...

Now the server starts ok. One single question: It is normal that's the admin interface shows me one single plugin for adding as a extension component? If added, restarted server, shows me the next component...add, restart and so on. It doesn't show me the last two components for adding, even if I restarted many times...I nedd to ad the GMSInitialiser and the TimeStampPlugin.... (yes, the extension.xml is the same as above)

tcarr
10-26-2010, 04:34 PM
That isn't normal, no. Try closing ES Admin entirely and getting back in - that usually fixes any problems with populating the comboboxes. What I see on my ES Admin's Server Extensions screen is a combox box with all the extensions. I pick one, click Create, pick one of the plugins in the combobox to make server level, click Save, then can click Create again to pick the next one from the combobox. After adding all of the ones I want to add, then I restart ES5.

And yes, most ES5 applications will just put everything into a single extension.

vldbrb
10-26-2010, 04:53 PM
Oh, yes!!!! Huzzahhh!!! It's working now!!! Thank You! Thank You! Thank You!!! I'm in debt with you for a yummy pizza ;)

tcarr
10-26-2010, 05:04 PM
Wooo hoooo!!!!!!!

vldbrb
10-27-2010, 02:40 PM
Hi Teresa, me again (unfortunately)...

I'm rewriting the AS3 code of my app, but I can't find anywhere in the examples or ES5 manual how to replace that type of code:


public function onLoginResponse(e:LoginResponse):void {
if (e.successful) {

var esob:EsObject = e.getEsObject(); // Here's the error and I can't figure out how to change for ES5

syncClocks();

parseClothing(esob.getEsObjectArray(PluginConstant s.AVATAR_CLOTHING));
parseFurnitureItems(esob.getEsObjectArray(PluginCo nstants.FURNITURE));
_myAvatar = parseAvatar(esob.getEsObject(PluginConstants.AVATA R));

loadBuddies();

createAvatarCustomizationScreen();
}
else
{
//.....
}
}



How can I change that line?

tcarr
10-27-2010, 04:12 PM
ES4 code

var esob:EsObject = e.getEsObject();

ES5 uses implicit getters instead of explicit ones, so try this:

var esob:EsObject = e.esObject;

vldbrb
10-27-2010, 04:29 PM
It was the first thing I tried, but I get:


Error: Implicit coercion of a value with static type com.electrotank.electroserver5.api:EsObjectRO to a possibly unrelated type com.electrotank.electroserver5.api:EsObject.
var esob:EsObject = e.esObject;
^
Build halted with errors (fcsh).


I've tried to trace out the e.esObject and the result is just fine, it contains all the data relative to the user... I just cannot understand this error (it's all day that trying and trying)

tcarr
10-27-2010, 04:37 PM
Ah, if it thinks that e.esObject is an EsObjectRO, then this should work:

var esobRO:EsObjectRO = e.esObject;
var esob:EsObject = new EsObject();
esob.addAll(esobRO);

That's about the way I'd do it from Java at any rate. You might be able to use new EsObject(esobRO). If you are just using getters on your esob, then you could even just do this:

var esob:EsObjectRO = e.esObject;


You will need to import EsObjectRO either way.

edit: An EsObjectRO is just a read-only version of EsObject.

vldbrb
10-27-2010, 04:58 PM
You're always right!!! The statement "var esob:EsObjectRO = e.esObject;" works just fine! Thank You very much!

Question: If any other problem occurs, can I post in this thread or may I create new threads? I don't wanna be seen like a "thread consumer"...

tcarr
10-27-2010, 05:08 PM
Start a new thread when you have a new question, please. If I need info from an existing thread in order to understand the context, then it goes into that thread, but if I don't, it's easier if the threads are kept short.

vldbrb
10-27-2010, 05:19 PM
Ok, understood. Initially i've seen this thread as similar to my problem... I'm really sorry for being off-topic with the second part... :(

PS: as admin, you can break this thread in two for make it readable and feel free to delete or modify my messages for coherency ;)

tcarr
10-27-2010, 05:20 PM
I can do that yes, but it doesn't bother me enough to have a long thread that I want to. Close enough.