DataSources are not properly configured in labkey.xml.

Installation Forum (Inactive)
DataSources are not properly configured in labkey.xml. naldis  2014-05-20 13:05
Status: Closed
 
Hello,

I'm having issues with postgresql working with labkey. When I run tomcat7 and postgresql I get a page for labkey but I'm given an error page. I've attached what I see as a pdf. Do I just need to create a user in postgresql and a database that the user can edit? So if my user in the labkey.xml file is "labkey" with the password "mypassword" then I'd set up a user on postgresql that has the same username and password?
I hope this is the write forum to ask this. Thanks for your help. I'm quite new to this.

Thanks for your time,
Nathan
 
 
adam responded:  2014-05-21 06:41
You need to properly configure a DataSource <Resource> element with the name "jdbc/labkeyDataSource". The Windows installer should create this file in the correct location (under Tomcat); with a manual install, you need to substitute a few values in the template labkey.xml file provided (in the root of the distribution) and copy the file into Tomcat. This is discussed in section 5 of this page: https://www.labkey.org/wiki/home/Documentation/page.view?name=configTomcat

Here's an example <Resource> element for PostgreSQL:

    <Resource name="jdbc/labkeyDataSource" auth="Container"
        type="javax.sql.DataSource"
        username="labkey"
        password="mypassword"
        driverClassName="org.postgresql.Driver"
        url="jdbc:postgresql://localhost:5432/labkey"
        maxActive="20"
        maxIdle="10"
        accessToUnderlyingConnectionAllowed="true"
        validationQuery="SELECT 1"
        />

You should adjust the url, username, and password to match your PostgreSQL installation. The user must be an administrator on your PostgreSQL server.

Adam
 
naldis responded:  2014-05-21 07:12
Hello Adam,

I should have clarified. I'm using ubuntu 14.04 lts. I've already gone through a made the substitutions listed for the labkey.xml. For simplicity, I'm just using the postgres user. I've attached my code. Is there a simple command to create a DataSource element?

Thanks,
Nathan
 
naldis responded:  2014-05-21 09:35
There was a small error that I fixed.

Thank you for your help,
Nathan
 
adam responded:  2014-05-21 09:46
Glad to hear you're up and running. Out of curiosity, what was the issue? I tried the <Resource> element you posted and it seemed to work fine.

Adam
 
naldis responded:  2014-05-21 09:50
I checked my tomcat log and apparently I had the wrong password for the user. After trying a few passwords I fixed the problem.

Nathan
 
adam responded:  2014-05-21 10:24
Interesting... I would have expected the original message to clearly state that as the problem, i.e.:

   FATAL: password authentication failed for user "postgres"

But the cause in your PDF was listed as:

   You must have a DataSource named "labkeyDataSource" defined in labkey.xml.

That's why I thought you didn't have the DataSource configured. Regardless, glad it's all working now.

Adam