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 18:21:46 +0100
  • Ironport-phdr: 9a23:3fqynBF7kvdAu+D9cV1ct51GYnF86YWxBRYc798ds5kLTJ78r8qwAkXT6L1XgUPTWs2DsrQY07qQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDmwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KOSMn/mHZisJ+j6xVrxyuqBN934Hab5qYNOZ9c67HYd8WWWRMU8RXWidcAo28dYwPD+8ZMOhGqIn9vV0OtRiiCgmtGejhzD1PhmT33K0+0PwqDAbL3BAnH9IUtHTbts71NaYJXOG60qbIyzTDYOlM1Tfm74jIbg4ureuMXbJtaMfcz1QkGQ3CjlWVs4PlPjWV2/wMs2id8+pvS/ivi2g5pAFtvDSj3NkjhZTUho8T11vK9j15zZ4oKdC8RkN3e9+pHIFOuy2HK4d6WMwvTm5wtConzrALt4S3cSkQxJg52hLTd+aLfoaI7x/lSe2fOy13hGh/d7K6nxuy8Vavyun7VsSs31dFsCxFktjWuXwXzBzT7dSHReVn8kehxDaDzwHT6udaLkAojafXNposz7AqmpcSq0jPADL6lFnsgKKZeUgo4u2o5P7mYrXiqJ+cLYh0igTmP6Qyncy/G+A4PRIVX2ma4um926Ps/Uv4QLpQlPE2ia7ZsIzEKsgBpq65HhdZ0pw/5BanEzemzNMYkGEILFJffxKHkpDpNE/UIPzhEPe/mEqjkC1wx/3dOr3hA47NLmTYkLv/Z7p96khcyBYtwtBF4ZJbFK0BLOzpVkDvqdPYE0xxDwvhzPzgFc1wzMYDQm+VGYeYNr/fq1mF+rhpLuWRN6EPvzOoF/8/4WXljDcdEEQPeTLhiYcQcnSxBeZOM0ifYHOqmdAdHCEKo1xtH6TRlFSeXGsLND6JVKUm62RjBQ==

Hi Chad,

On 12/30/18 4:30 PM, Redman, Chad wrote:
Szia László,

If you add this parameter, it may be what is missing.

subjectApi.source.sourceSeu.param.dbDriver.value = com.mysql.jdbc.Driver

that fixed the problem. Thanks a lot!

For C3p0, you can also define properties for (showing defaults):

(max pool size) subjectApi.source.sourceSeu.param.maxActive.value = 2
(max wait seconds for timeout)
subjectApi.source.sourceSeu.param.maxWait.value = 5


I will create a new issue to update the documentation for this. Also, the
code should check for the driver parameter being defined and give a warning
if not, rather than a null pointer exception. In fact, the driver isn't
really necessary if it's already loaded. The parameter just forces it to be
loaded if it's not.

That'll be very helpful for grouper newbies like me :-)

Laszlo

-Chad



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


[mailto:]
On Behalf Of Tornóci László
Sent: Sunday, December 30, 2018 4:46 AM
To:

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

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