Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Help debugging new jdbc subject adapter

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Help debugging new jdbc subject adapter


Chronological Thread 
  • From: Keith Hazelton <>
  • To:
  • Subject: [grouper-users] Help debugging new jdbc subject adapter
  • Date: Thu, 10 Jan 2013 14:04:58 -0600
  • Priority: normal

I'm creating an alternative subject source for the Project Bamboo instance of
Grouper. I've gotten the database and a subject table created and populated
(see first snippet below) and I modified the sources.xml file to point to
that database and table and do the proper searches (see second snippet). I
bounced the Tomcat instance hosting Grouper on arche.metazome.info and tried
to add a subject to a group. I typed in a name, hit search and got "Error:
Unable to connect to to an entity database".


Looking for advice on how to troubleshoot this. I didn't see anything in the
tomcat or grouper logs.


----------
postgres=# create database bbsubjectdb;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE bbsubjectdb TO grouper;
GRANT
postgres=# \c bbsubjectdb
psql (8.4.13, server 8.4.12)
You are now connected to database "bbsubjectdb".


bbsubjectdb=# CREATE TABLE bbsubject (
bbsubjectdb(# BPId character varying (40) PRIMARY KEY,
bbsubjectdb(# name character varying (255) NOT NULL,
bbsubjectdb(# description character varying (255) );
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"bbsubject_pkey" for table "bbsubject"
CREATE TABLE


bbsubjectdb=# insert into bbsubject(BPId, name, description)
bbsubjectdb-# values ('04574969-e851-4fbf-8535-0b81b9b3f2f3', 'earnest
adams', 'Ernie from the Voronoi Project');
INSERT 0 1
bbsubjectdb=# insert into bbsubject(BPId, name, description)
bbsubjectdb-# values ('c00f294d-651b-495b-9633-a900dd1a7418', 'fred farkle',
'Freddie from the Voronoi Project');
INSERT 0 1
bbsubjectdb=# select * from bbsubject;
bpid | name | description
--------------------------------------+---------------+----------------------------------
04574969-e851-4fbf-8535-0b81b9b3f2f3 | earnest adams | Ernie from the
Voronoi Project
c00f294d-651b-495b-9633-a900dd1a7418 | fred farkle | Freddie from the
Voronoi Project
(2 rows)


bbsubjectdb=# select name, description FROM bbsubject WHERE name ILIKE
'%earnest%';
name | description
---------------+--------------------------------
earnest adams | Ernie from the Voronoi Project
(1 row)


----------
<?xml version="1.0" encoding="utf-8"?>


<!--
Grouper's subject resolver configuration
$Id: sources.example.xml,v 1.8 2009-08-11 20:18:09 mchyzer Exp $
-->


<sources>


<!-- Group Subject Resolver -->

...<snip>...


<!-- khazelton 2013-01-10 Alternative Entity Subject Resolver for Bamboo -->


<source
adapterClass="edu.internet2.middleware.grouper.subj.GrouperJdbcSourceAdapter">
<id>postgresSubjectSource</id>
<name>Subject JDBC Source Adapter</name>
<type>person</type>
<init-param>
<param-name>jdbcConnectionProvider</param-name>

<param-value>edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider</param-value>
</init-param>
<init-param>
<param-name>maxActive</param-name>
<param-value>16</param-value>
</init-param>
<init-param>
<param-name>maxIdle</param-name>
<param-value>16</param-value>
</init-param>
<init-param>
<param-name>maxWait</param-name>
<param-value>-1</param-value>
</init-param>

<init-param>
<param-name>dbDriver</param-name>
<param-value>org.postgresql.Driver</param-value>
</init-param>
<init-param>
<param-name>dbUrl</param-name>
<param-value>jdbc:postgresql://localhost:5432/bbsubjectdb</param-value>
</init-param>
<init-param>
<param-name>dbUser</param-name>
<param-value>xxxxxx</param-value>
</init-param>
<init-param>
<param-name>dbPwd</param-name>
<param-value>yyyyyyyy</param-value>
</init-param>

<init-param>
<param-name>SubjectID_AttributeType</param-name>
<param-value>bpid</param-value>
</init-param>
<init-param>
<param-name>Name_AttributeType</param-name>
<param-value>name</param-value>
</init-param>
<init-param>
<param-name>Description_AttributeType</param-name>
<param-value>description</param-value>
</init-param>

<search>
<searchType>searchSubject</searchType>
<param>
<param-name>sql</param-name>
<param-value>
select name, description FROM bbsubject WHERE name = ?
</param-value>
</param>
</search>
<search>
<searchType>searchSubjectByIdentifier</searchType>
<param>
<param-name>sql</param-name>
<param-value>
select name, description FROM bbsubject WHERE bpid = ?
</param-value>
</param>
</search>
<search>
<searchType>search</searchType>
<param>
<param-name>sql</param-name>
<param-value>
select name, description FROM bbsubject WHERE name ILIKE '%' || ? || '%'
</param-value>
</param>
</search>
</source>
<!-- end khazelton insert 10-Jan-2013 -->


</sources>


----------
begin:vcard
n:HAZELTON;KEITH;;;
fn:KEITH D HAZELTON
tel;work:608 262-0771
org:University of Wisconsin-Madison;DoIT
adr:;;1210 W. Dayton St.;Madison;WI;53706;US
email;work;internet:
title:Sr. IT Architect
version:2.1
end:vcard



Archive powered by MHonArc 2.6.16.

Top of Page