• Welcome to KonaKart Community Forum. Please login or sign up.
 

Unable to connect to the Database called null

Started by franklinr, November 06, 2013, 10:09:48 pm

Previous topic - Next topic

franklinr


Caused by: com.konakart.app.KKException: Unable to connect to the Database called null. Ensure that the database is running and if so, check the database connection parameters in the konakart.properties file under WEB-INF/classes.

torque.database.store1.adapter              = mysql
torque.dsfactory.store1.connection.driver   = com.mysql.jdbc.Driver
torque.dsfactory.store1.connection.url      = jdbc:mysql://<some ip>:3306/konakart?zeroDateTimeBehavior=convertToNull
torque.dsfactory.store1.connection.user     = user
torque.dsfactory.store1.connection.password = password


I'm getting this exception when trying to connect in a Java application from my local machine to a remote server.  Changing <some ip> to localhost and connecting to my local mysql works fine.  Using mysql workbench and connecting to <some ip> using the above credentials works fine as well.  Connecting to the database server from a different remote server in a konakart web application using the same credentials works fine. 

I would believe my local ip is getting rejected by security except that I can connect from here using mysql workbench. 

Is there some other property I'm missing that needs to be set to ensure the database name is configured properly?  I would just like to understand the exception message better.

Thanks.

ming

Are you sure your properties file is complete?   Check yours with a good one from a default installation.

Perhaps you are missing:

torque.database.default                     = store1

or

torque.dsfactory.store1.pool.validationQuery=SELECT 1

sirth

@ming I have the same issue (getting "Unable to connect to the Database called null" while starting the application) and the properties you mentioned in [konakart_home]/webapps/konakart/WEB-INF/classes/konakart.properties are available.
Is there another file where konakart reads database from?
Regards,
sirth

ming

if you use the installer you wouldn't get any of these problems since at installation time the DB connection is tested and all the necessary properties are automatically set in all properties files.

have you checked the properties files in the other webapps?  konakartadmin.properties for example.

sirth

ming, thanks for the response.

The following properties are available in [konakart_home]/webapps/konakartadmin/WEB-INF/classes/konakartadmin.properties:
torque.database.default                         = store1

torque.database.store1.adapter              = mysql
torque.dsfactory.store1.connection.driver   = com.mysql.jdbc.Driver
torque.dsfactory.store1.connection.url      = jdbc:mysql://localhost:3306/konakart?zeroDateTimeBehavior=convertToNull
torque.dsfactory.store1.connection.user     = konakart
torque.dsfactory.store1.connection.password = konakart

torque.dsfactory.store1.pool.validationQuery=SELECT 1


I cannot use the GUI installer since I am accessing the remote ubuntu server through putty.
"at installation time the DB connection is tested"
As I mentioned I already tested it with mysql workbench - everything seems to be working.

Any other idea?



ming

I didn't say the GUI installer.... although that is easier if you can use it....  the silent mode command line installer sets up the properties files in the same way as the GUI installer.    Refer to the User Guide for details.

I'm just warning against using the zip installations unless you really have no choice.

sirth

From http://www.konakart.com/docs/KonaKart_User_Guide.pdf :
QuoteNote that if the GUI or silent installers do not work on your platform you should download the zip version
of KonaKart and follow the manual installation instructions.

As I understand I am using the silent installer from http://www.konakart.com/downloads/community_edition.  I downloaded the installer that is assigned to "64′ Linux/Unix".

So, since the silent installer is better than the zip (guessing it's the "Multi-platform zip package" from http://www.konakart.com/downloads/community_edition), why isn't it working? How can I check what is wrong with it?

sirth

@ming,
I forgot to mention that this happened http://www.konakart.com/forum/index.php/topic,1921.0.html when installing silently, and I had to manually run the /database/mysql/konakart_demo.sql .

ming

sounds to me that there is some kind of problem connecting to your database from the installer.   You could try to investigate what's wrong by writing a tiny jdbc program to see if you can get any clues as to why java cannot connect to your mysql db (and create tables) using those credentials.

you should not have to run that script manually - the silent installer should do that.

we install hundreds of times per day using the silent installer to 5 different databases - including mysql.