Connect to postgre db

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
nikolaiko
Posts: 13
Joined: 30 Mar 2011, 10:40

Connect to postgre db

Post by nikolaiko »

Hi everyone,
I have smartfoxpro 1.6 demo version. And trying to connect to postgre database, I created my own zone and room, added extension to this zone. And then added Database manager tag:

Code: Select all

<DatabaseManager active="true">
       <Driver>org.postgresql.Driver</Driver>				   <ConnectionString>jdbc:postgresql://localhost:5432/db_name</ConnectionString>
	<UserName>name</UserName>
	<Password>pass</Password>

	<TestSQL><![CDATA[SELECT COUNT(*) FROM Users]]></TestSQL>
	
	<OnExhaustedPool>fail</OnExhaustedPool>
	<BlockTime>5000</BlockTime>	
</DatabaseManager>						
And restarted server. But now server is failing to start. If I remove this sector server working fine again. I tryed different combinations of Driver and ConnectionString tags...still doesn't work. In logs server write: Error in configuration files...I checked new section all tags are closed...
I don't know it is con.string wrong or driver...
can anyone help?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Can you please include the entire error code with your next reply.
Smartfox's forum is my daily newspaper.
nikolaiko
Posts: 13
Joined: 30 Mar 2011, 10:40

Post by nikolaiko »

BigFish, thanks for the answer.
Where I can find full error code?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

In your server log file.
Smartfox's forum is my daily newspaper.
nikolaiko
Posts: 13
Joined: 30 Mar 2011, 10:40

Post by nikolaiko »

INFO | jvm 1 | 2011/03/30 20:59:00 | Zone: openspace
INFO | jvm 1 | 2011/03/30 20:59:00 |
INFO | jvm 1 | 2011/03/30 20:59:00 | Ranch (inside) (id: 34, max: 50, pass:N)
INFO | jvm 1 | 2011/03/30 20:59:00 | Ranch (outside) (id: 35, max: 50, pass:N)
INFO | jvm 1 | 2011/03/30 20:59:00 | Slopes area (id: 36, max: 50, pass:N)
INFO | jvm 1 | 2011/03/30 20:59:00 |
INFO | jvm 1 | 2011/03/30 20:59:00 | java.lang.NullPointerException
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer.java:1795)
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigReader.java:806)
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:174)
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)
INFO | jvm 1 | 2011/03/30 20:59:00 | Problems in config file: null
INFO | jvm 1 | 2011/03/30 20:59:00 | it.gotoandplay.smartfoxserver.exceptions.ConfigurationException
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigReader.java:199)
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFoxServer.java:339)
INFO | jvm 1 | 2011/03/30 20:59:00 | at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:607)
INFO | jvm 1 | 2011/03/30 20:59:00 |
INFO | jvm 1 | 2011/03/30 20:59:00 | Errors found in configuration files.
INFO | jvm 1 | 2011/03/30 20:59:00 | Unable to start the server.
INFO | jvm 1 | 2011/03/30 20:59:00 |
INFO | jvm 1 | 2011/03/30 20:59:00 |
INFO | jvm 1 | 2011/03/30 20:59:00 | Shutting down server...
INFO | jvm 1 | 2011/03/30 20:59:00 |
STATUS | wrapper | 2011/03/30 20:59:02 | <-- Wrapper Stopped

It is last record it wrapper_20110330.txt. You asking about this logs? Or not. I see that zone before my - openspace is installed well, but then it goes to my section I have some exceptions.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

It looks like there's a problem parsing your zone. If you like, you can PM me the zone data or send me the config.xml file for me to have a look at.
Smartfox's forum is my daily newspaper.
nikolaiko
Posts: 13
Joined: 30 Mar 2011, 10:40

Post by nikolaiko »

ok I PM config.xml to you.
Thanks, man.
nikolaiko
Posts: 13
Joined: 30 Mar 2011, 10:40

Post by nikolaiko »

BigFIsh Did you get my message with link to file?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Replied.
Smartfox's forum is my daily newspaper.
nikolaiko
Posts: 13
Joined: 30 Mar 2011, 10:40

Post by nikolaiko »

Thanks, problem solved. :D
Post Reply