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: "Redman, Chad" <>
  • To: Tornóci László <>, "" <>
  • Cc: mchyzerpenn <>
  • Subject: RE: [grouper-users] Cannot use external sql subject source
  • Date: Sun, 30 Dec 2018 15:30:00 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is ) ;
  • Ironport-phdr: 9a23:va+dTB2RlfMUmyXEsmDT+DRfVm0co7zxezQtwd8ZsesWKvvxwZ3uMQTl6Ol3ixeRBMOHs6IC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwZFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QKsqUjq+8ahkVB7oiD8GNzEn9mHXltdwh79frB64uhBz35LYbISTOfFjfK3SYMkaSHJBUMhPSiJBHo2yYYgBD+UDPOZXs4bzqFQVoBuiHgagGP/jxiNUinL026AxzuQvERvB3AwlB98Cvmjao8voO6cXS++1yrHExijdYvNWwzjy9YbEeQ0mrP6QXbJ/a9fexlE1Fwzbk1qQrJbqPzWO2+QQtWiU8/BsWvyyhG46sgx8pCWkyMkrionMnI0Vy1bE+D14wIYzOd23VlR7Ydi6H5tMqS2WLZV5Td4/Q2xupS00yaUGtIa0cSQW0pgr2gLTZv6df4WJ4R/vTuacLDhgiH9nZb6znRe//Ey6xuD9VcS4yktGoy5Kn9XUuHACyR/e5tSCR/Z4/Uqs1jSC2B7W5+5ZI005lKXWJpsvz7EtlpcfrUHOEyzol0j4gqKbcFgv9PKy5OT9eLrmo4eRN49qhQH6NaQjgtSxDPg/PAQSUGWX4Pmx2qXt8EHgR7VFleM5nrPesJDHOcQUvam5AxJT0ok+8Rq/Fy2m0NMEnXYZMF1FZBOHj4/vO13UJ/D4EOu/g1CrkDdsxPDKJKHuApLILnTbkbfhe6hy61JExQc80dxT/Y9YBq0DLf7pW0L8t8bUAx82PgCsxuboEtR91ocQWWKVBa+ZNbvfvkOI5u01PuaDfJUVtyjgJPgg/fHui2Q0mUIbfaa1x5cYdm23Hul+L0WDfXXsmssBEXsNvgcmQ+zqklqCUSNLZ3msRaIw/yw7CJm4AofZXYCgm7iB3CagHp1KfWBKFEqAEXbud4WYRfgMciSSLdF9kjAaT7SuVZIu1Qz9/DP9noZgNOxP8SxQkRv4xtzur7nPkgs2/CdmJ9SQ1WCECXpzgm5ORyJgmOg1rlZ610+Oy+1lmPFCDvRS4e9ESAE3KcSawuBnQZimVRjGY8+EUhO7Wdi8GhkwSM482dkDfxw7Ftm/2EPtxS2vVvUvmrCODZpwuonc1nS7b5J2y3/K47Msg1wvRONSM2bgi6JioVuAT7XVmlmUwv75PZ8X2zTAoSLalTLU5hNRTRJwXKPZXHsWekrRq5Hj61jfS6O1V+51KRNPnMiFLKYCKsbki1lLXr/CAJzfeCrw/gX4HhOU3vWJZYvudX8a2XDWCEEIpBoe8XOPMyAjACznrm7DX3Rj
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Szia László,

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

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

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.

-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