Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Cannot use external sql subject source

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Cannot use external sql subject source


Chronological Thread 
  • From: Tornóci László <>
  • To: "" <>
  • Subject: Re: [grouper-users] Cannot use external sql subject source
  • Date: Sun, 30 Dec 2018 10:46:14 +0100
  • Ironport-phdr: 9a23:dCLCJh9tRbDYXP9uRHKM819IXTAuvvDOBiVQ1KB20+gcTK2v8tzYMVDF4r011RmVBdWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+557ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRgL2hicJNzA382/ZhcJ/g61ZvB2vqAdyw5LXbYyPKPZyYq3QcNEcSGFcXshRTStBAoakYoURCOoBJ+BYt4rhqFsPsBCwAwurBPjuyz9MhWf9wKo30/gmEQHc2AwvBckOsXXPodT6KqgSV+G1w7PSwTXYaPNWxSny5JLIchA8uPyBW697f8TWyUkqDQzFj1OQpJTqPzOP0eQNrnCb4PR6Ve61kWEnsxlxriCuxscqlonGmJgVylba+iVl3oo5P8O3R1NmYdK8C5tQsDyaN5FqTcw8WGFnpjs6xqcHuZGmZCQK05MnxwPFa/ObbYeI+QzsVPuLLTd+nn1lfaywihCv+kaj0u3xTtS43VJEoyZfk9TArG4B2wHP5sSdRfZw8V+t1DWS2wzJ9+1JIk45mbDGJ5MjxrM8jIQfvVjHEyLwhU74lrWZdl8+9eit8+nnYqvpppubN4JshQDxLKIums2lDugiKQgOWHSb9vqm2L3j4E31WLRKjvsonanFqJ3WOMAWq6CjDwJUyIov9QuzAyu83NkXknQLNFdFdwiGj4jtNVHOOvf4DfKnjlSwlzdr3fTGMaf6ApTMNXXCn6nufbB860FG0gYz1tdf545KBb0bIPLzR1f9tMbEAR8hLwy03+HnBc1y1oMEXmKPH7eZP73IsVOR++IvOPeDZJUOuDvmL/gl5uXujWMimVMDZ6Wp3J0XaGymEfR8JUWWf2bsjskbHWgUowU+Ub+itFrXGzFJYGuqUrh5+yo2EpmODIHfS5qrjaDbmiq3A9ceMm9cDU2UHG2tap6JQewkaSSOL9VnnyBeE7WtVtly+wupsVrGzKBhteHVsgmRroDnT5Ah++rJkRgp5xRkAsKc2ieWSH152GMVEWxllJtjqFBwnw/QmZNzhOZVQIRe

Hi Chris,

thank you for your answer.

On 12/30/18 4:01 AM, Hyzer, Chris wrote:
Please review this example:

https://spaces.at.internet2.edu/display/Grouper/Penn+subject+source+JDBC2+example

That's exactly what I did, however, I had the problem described in my original message.

And please run the subject api diagnostics under misc in the UI
I can build the UI successfully, however tomcat gives me 404 if I include my additional subject source definition in subject.properties, so there no way to see what the subject api diagnostics would say. That's why I tried to start gsh, but that gives me the stack trace posted in my original message. It works fine with the vanilla subject.properties, so the problem must be my addition.

Let me know if you need further help.

I am sure it is something trivial, but I really don't know what is my mistake. I installed grouper using grouperInstaller.jar on a Fedora29 system. The credentials to access mariadb are correct. I even tried putting subject-2.1.3.jar to grouper.apiBinary-2.4.0/lib/custom to make sure C3p0JdbcConnectionProvider.class is available, but that didn't make any difference. Any suggestions?

Yours: Laszlo


Thanks
Chris

-----Original Message-----
From:


<>
On Behalf Of Tornóci László
Sent: Friday, December 28, 2018 4:07 PM
To:

Subject: [grouper-users] Cannot use external sql subject source

Hi,

I am just starting to learn grouper. So I installed 2.4 with all the
latest patches using mariadb for SQL backend. The UI works fine with the
test data. I was trying to set up my own SQL subject source as described
here:
https://spaces.at.internet2.edu/display/Grouper/Penn+subject+source+JDBC2+example

gsh works with the vanilla subject.properties containing the "Example
JDBC Source Adapter". However, gsh won't start if I add this section to
subject.properties:

#########################################
## Configuration for source id: sourceSeu
## Source configName: sourceSeu
#########################################
subjectApi.source.sourceSeu.id = sourceSeu

# this is a friendly name for the source
subjectApi.source.sourceSeu.name = SE people

# type is not used all that much. Can have multiple types, comma
separate. Can be person, group, application
subjectApi.source.sourceSeu.types = person

# the adapter class implements the interface:
edu.internet2.middleware.subject.Source
subjectApi.source.sourceSeu.adapterClass =
edu.internet2.middleware.grouper.subj.GrouperJdbcSourceAdapter2

subjectApi.source.sourceSeu.param.jdbcConnectionProvider.value =
edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider

subjectApi.source.sourceSeu.param.dbUrl.value =
jdbc:mysql://localhost:3306/grouper_testdata

# username when connecting to the database
subjectApi.source.sourceSeu.param.dbUser.value = grouperuser

# password when connecting to the database (or file with encrypted
password inside)
subjectApi.source.sourceSeu.param.dbPwd.value = password_here

# maximum number of results from a search, generally no need to get more
than 1000
subjectApi.source.sourceSeu.param.maxResults.value = 100

# the table or view to query results from. Note, could prefix with a
schema name
subjectApi.source.sourceSeu.param.dbTableOrView.value = person_source

# the column name to get the subjectId from
subjectApi.source.sourceSeu.param.subjectIdCol.value = uid

# the column name to get the name from
subjectApi.source.sourceSeu.param.nameCol.value = name

subjectApi.source.sourceSeu.param.descriptionCol.value = description

# search col where general searches take place, lower case
subjectApi.source.sourceSeu.param.lowerSearchCol.value = description_lower

# optional col if you want the search results sorted in the API (note,
UI might override)
subjectApi.source.sourceSeu.param.defaultSortCol.value = description

# you can count up from 0 to N of columns to search by identifier (which
might also include by id)
subjectApi.source.sourceSeu.param.subjectIdentifierCol0.value = sapid

# now you can count up from 0 to N of attributes for various cols. The
name is how to reference in subject.getAttribute()
subjectApi.source.sourceSeu.param.subjectAttributeCol0.value = email

The same setup works fine, if I copy the data to the database that
grouper itself uses and I set GrouperJdbcConnectionProvider instead of
GrouperJdbcSourceAdapter2 as an adapterClass.

I don't know what I'm doing wrong. Thank you for your help:

Laszlo

Here is the stack trace of gsh:
./gsh.sh
Detected Grouper directory structure 'api' (valid is api or webapp)
Using GROUPER_HOME:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0
Using GROUPER_CONF:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/conf
Using JAVA: /etc/alternatives/java_sdk/bin/java
Using CLASSPATH:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/conf:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/dist/lib/grouper.jar:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/lib/grouper/*:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/lib/custom/*:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/lib/jdbcSamples/*:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/lib/ant/*:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/lib/test/*:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/dist/lib/test/*:/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/src/resources
using MEMORY: 64m-750m
log4j:WARN No such property [maxBackupIndex] in
org.apache.log4j.DailyRollingFileAppender.
Grouper starting up: version: 2.4.0, build date: 2018/08/23 07:48:38,
env: <no label configured>
grouperPatchStatus read from:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/grouperPatchStatus.properties
api patches installed: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
pspng patches installed: 0, 1
grouper.properties read from:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/conf/grouper.properties
Grouper current directory is:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/bin
log4j.properties read from:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/conf/log4j.properties
Grouper is logging to file:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/logs/grouper_error.log,
at min level WARN for package: edu.internet2.middleware.grouper, based
on log4j.properties
grouper.hibernate.properties:
/home/torlasz/src/grouper24/app/test/grouper.apiBinary-2.4.0/conf/grouper.hibernate.properties
grouper.hibernate.properties:
grouperuser@jdbc:mysql://localhost:3306/grouper_test?CharSet=utf8&useUnicode=true&characterEncoding=utf8
problem with sources
Couldnt startup grouper: Error initializing SourceManager
java.lang.RuntimeException: Error initializing SourceManager
at
edu.internet2.middleware.subject.provider.SourceManager.init(SourceManager.java:326)
at
edu.internet2.middleware.subject.provider.SourceManager.<init>(SourceManager.java:256)
at
edu.internet2.middleware.subject.provider.SourceManager.getInstance(SourceManager.java:266)
at
edu.internet2.middleware.grouper.misc.GrouperStartup.startup(GrouperStartup.java:284)
at
edu.internet2.middleware.grouper.app.gsh.GrouperShell.main(GrouperShell.java:165)
at
edu.internet2.middleware.grouper.app.gsh.GrouperShellWrapper.main(GrouperShellWrapper.java:31)
Caused by: edu.internet2.middleware.subject.SourceUnavailableException:
Unable to init subject.properties JDBC source, source: sourceSeu
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.init(JDBCSourceAdapter.java:815)
at
edu.internet2.middleware.subject.provider.SourceManager.loadSource(SourceManager.java:351)
at
edu.internet2.middleware.subject.provider.SourceManager.parseConfig(SourceManager.java:365)
at
edu.internet2.middleware.subject.provider.SourceManager.init(SourceManager.java:323)
... 5 more
Caused by: edu.internet2.middleware.subject.SourceUnavailableException:
Error loading subject.properties JDBC driver: null, source: sourceSeu
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.loadDriver(JDBCSourceAdapter.java:831)
at
edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider.init(C3p0JdbcConnectionProvider.java:129)
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter2.setupDataSource(JDBCSourceAdapter2.java:649)
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.init(JDBCSourceAdapter.java:759)
... 8 more
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.loadDriver(JDBCSourceAdapter.java:828)
... 11 more
Exception in thread "main" java.lang.RuntimeException: Error
initializing SourceManager
at
edu.internet2.middleware.subject.provider.SourceManager.init(SourceManager.java:326)
at
edu.internet2.middleware.subject.provider.SourceManager.<init>(SourceManager.java:256)
at
edu.internet2.middleware.subject.provider.SourceManager.getInstance(SourceManager.java:266)
at
edu.internet2.middleware.grouper.misc.GrouperStartup.startup(GrouperStartup.java:284)
at
edu.internet2.middleware.grouper.app.gsh.GrouperShell.main(GrouperShell.java:165)
at
edu.internet2.middleware.grouper.app.gsh.GrouperShellWrapper.main(GrouperShellWrapper.java:31)
Caused by: edu.internet2.middleware.subject.SourceUnavailableException:
Unable to init subject.properties JDBC source, source: sourceSeu
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.init(JDBCSourceAdapter.java:815)
at
edu.internet2.middleware.subject.provider.SourceManager.loadSource(SourceManager.java:351)
at
edu.internet2.middleware.subject.provider.SourceManager.parseConfig(SourceManager.java:365)
at
edu.internet2.middleware.subject.provider.SourceManager.init(SourceManager.java:323)
... 5 more
Caused by: edu.internet2.middleware.subject.SourceUnavailableException:
Error loading subject.properties JDBC driver: null, source: sourceSeu
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.loadDriver(JDBCSourceAdapter.java:831)
at
edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider.init(C3p0JdbcConnectionProvider.java:129)
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter2.setupDataSource(JDBCSourceAdapter2.java:649)
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.init(JDBCSourceAdapter.java:759)
... 8 more
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at
edu.internet2.middleware.subject.provider.JDBCSourceAdapter.loadDriver(JDBCSourceAdapter.java:828)
... 11 more




Archive powered by MHonArc 2.6.19.

Top of Page