Hi Randall, this is all occurring in the context of JUnit tests
unit test 'startup' code is as follows
engine = new ModeShapeEngine();
engine.start();
RepositoryConfiguration config = RepositoryConfiguration
.read("conf/testConfigAuth1.json");
// Verify the configuration for the repository ...
org.modeshape.common.collection.Problems problems = config.validate();
if (problems.hasErrors()) {
System.err.println("Problems starting the engine.");
System.err.println(problems);
System.exit(-1);
}
javax.jcr.Repository repo = engine.deploy(config);
String repositoryName = config.getName();
log.info("repo name:{}", repositoryName);
IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
SimpleCredentials simpleCredentials = new SimpleCredentials(
irodsAccount.getUserName(), irodsAccount.getPassword()
.toCharArray());
session = repo.login(simpleCredentials, "default");
This attempts to grab a session via our authenticator using a test IRODSAccount. This is the first thing that runs, and the issue seems to occur in startup
At the point of repo.login..
JcrRepository.login() method called
here are the logs at this point
164209 [main] DEBUG org.modeshape.jcr.JcrRepository - Starting 'irodsRepo' repository with configuration:
{ "name" : "irodsRepo" , "workspaces" : { "predefined" : [ "otherWorkspace" ] , "default" : "default" , "allowCreation" : true } , "security" : { "anonymous" : { "roles" : [ "readonly" , "readwrite" , "admin" ] , "useOnFailedLogin" : false } , "providers" : [ { "name" : "iRODS custom provided" , "classname" : "org.irods.jargon.modeshape.connector.IrodsAuthenticationProvider" } ] } , "storage" : { "cacheConfiguration" : "conf/infinispan.xml" , "cacheName" : "persistentRepository" , "binaryStorage" : { "type" : "file" , "directory" : "target/federation_repository/binaries" , "minimumBinarySizeInBytes" : 0 } } , "externalSources" : { "irods" : { "classname" : "org.irods.jargon.modeshape.connector.IRODSWriteableConnector" , "directoryPath" : "/test1/home/test1" , "projections" : [ "default:/irodsGrid => /" ] , "readOnly" : false , "addMimeTypeMixin" : false , "cacheTtlSeconds" : 0 , "exclusionPattern" : ".+[.]tmp$" } } , "query" : { "enabled" : false , "rebuildUponStartup" : "never" } , "node-types" : [ "conf/irods.cnd" ] }
166939 [main] DEBUG org.modeshape.jcr.LocalEnvironment - Starting cache manager using configuration at 'conf/infinispan.xml'
170477 [main] WARN org.modeshape.jcr.RepositoryConfiguration - The field readOnly is not present on org.irods.jargon.modeshape.connector.IRODSWriteableConnector or any of its super types
170508 [main] DEBUG org.modeshape.jcr.JcrRepository - Loading cache 'persistentRepository' from cache container org.infinispan.manager.DefaultCacheManager@61ae717f@Address:null
170555 [main] INFO org.infinispan.factories.GlobalComponentRegistry - ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.7.Final
171021 [main] WARN org.infinispan.transaction.lookup.GenericTransactionManagerLookup - ISPN000104: Falling back to DummyTransactionManager from Infinispan
173594 [main] INFO org.infinispan.jmx.CacheJmxRegistration - ISPN000031: MBeans were successfully registered to the platform MBean server.
174033 [main] DEBUG org.modeshape.common.util.StringURLClassLoader - org.modeshape.extractor.tika is not a valid url
176264 [main] DEBUG org.modeshape.jcr.mimetype.TikaMimeTypeDetector - Initializing the Tika MIME type detectors
176265 [main] DEBUG org.modeshape.jcr.mimetype.TikaMimeTypeDetector - - Found detector: org.gagravarr.tika.OggDetector
176265 [main] DEBUG org.modeshape.jcr.mimetype.TikaMimeTypeDetector - - Found detector: org.apache.tika.parser.microsoft.POIFSContainerDetector
176265 [main] DEBUG org.modeshape.jcr.mimetype.TikaMimeTypeDetector - - Found detector: org.apache.tika.parser.pkg.ZipContainerDetector
176265 [main] DEBUG org.modeshape.jcr.mimetype.TikaMimeTypeDetector - - Found detector: org.apache.tika.mime.MimeTypes
176335 [main] DEBUG org.modeshape.jcr.LocalEnvironment - Starting cache manager using configuration at 'org/modeshape/jcr/default-workspace-cache-config.xml'
177158 [main] DEBUG org.modeshape.jcr.cache.RepositoryCache - Initializing the 'irodsRepo' repository
177799 [main] INFO org.infinispan.jmx.CacheJmxRegistration - ISPN000031: MBeans were successfully registered to the platform MBean server.
177962 [main] DEBUG org.modeshape.jcr.cache.RepositoryCache - System root: Node 9db8771317f1e7/: { "properties" : { "http://www.jcp.org/jcr/1.0" : { "primaryType" : { "$name" : "mode:root" } , "uuid" : "9db8771317f1e7/" } } }
177972 [main] DEBUG org.modeshape.jcr.cache.RepositoryCache - jcr:system child reference: null
177972 [main] DEBUG org.modeshape.jcr.cache.RepositoryCache - System node: null
177973 [main] DEBUG org.modeshape.jcr.cache.RepositoryCache - Creating the 'system' workspace in repository 'irodsRepo'
177985 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
178073 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 15 node(s)
179877 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
184257 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 186 node(s)
184358 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
184362 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 1 node(s)
184388 [main] WARN org.modeshape.jcr.RepositoryConfiguration - The field name is not present on org.irods.jargon.modeshape.connector.IrodsAuthenticationProvider or any of its super types
184406 [main] DEBUG org.modeshape.jcr.JcrRepository - Enabling anonymous authentication and authorization.
184668 [main] DEBUG org.modeshape.jcr.JcrRepository - Queries have been DISABLED for the 'irodsRepo' repository. Nothing will be indexed, and all queries will return empty results.
184669 [main] DEBUG org.modeshape.jcr.JcrRepository - No JNDI found, so not registering 'irodsRepo' repository
186726 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
186740 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 2 node(s)
186768 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
186861 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 7 node(s)
187221 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
187226 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 1 node(s)
187230 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
187237 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 2 node(s)
187431 [main] INFO org.infinispan.jmx.CacheJmxRegistration - ISPN000031: MBeans were successfully registered to the platform MBean server.
187433 [main] DEBUG org.modeshape.jcr.cache.RepositoryCache - Creating 'default' workspace in repository 'irodsRepo'
187446 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Locking nodes in Infinispan
187451 [main] DEBUG org.modeshape.jcr.cache.document.WritableSessionCache - Altered 2 node(s)
187523 [main] INFO org.irods.jargon.modeshape.connector.IRODSWriteableConnector - getting documentMapper
187523 [main] INFO org.irods.jargon.modeshape.connector.IRODSWriteableConnector - initialized
187565 [main] INFO org.irods.jargon.modeshape.connector.IRODSWriteableConnector - fileFor()
187565 [main] INFO org.irods.jargon.modeshape.connector.IRODSWriteableConnector - id:/
I note the curious message 184388 [main] WARN org.modeshape.jcr.RepositoryConfiguration - The field name is not present on org.irods.jargon.modeshape.connector.IrodsAuthenticationProvider or any of its super types. I will dig into this further.
Note that the initialize() method of my connector is called, and fileFor() has been called in my class, which seems to have been called by FederatedDocumentStore.getExternalProjection() via the getDocumentId() method of my connector. That fileFor() method is where I am trying to extract out my IRODS credentials from the security context, yet my authenticate provider has not yet been called.
At this point, the IRODSWriteableConnector has a security context of org.modeshape.jcr.ExecutionContext$NullSecurityContext@3236d036
Prior to this run, I had a kludge in my code where, encountering a NullSecurityContext, I would plug in a hard coded account, and what I found was that the IrodsAuthenticationProvider was being called after this initial start up sequence
I may just be confused, but it does look like Modeshape is trying to access iRODS before the IrodsAuthenticationProvider has provisioned the security context
FWIW the unit test is here, around line 101
https://github.com/DICE-UNC/jargon-modeshape/blob/development/jargon-modeshape/irods-connector/src/test/java/org/irods/jargon/modeshape/connector/IRODSWriteableConnectorRepoTest.java
and the connector is here, with my fileFor being called during initialization around line 250
https://github.com/DICE-UNC/jargon-modeshape/blob/development/jargon-modeshape/irods-connector/src/test/java/org/irods/jargon/modeshape/connector/IRODSWriteableConnectorRepoTest.java
You would find the authentication provider in that same package, but it seems like the provider (not being called yet) isn't at issue.
The json config I'm using is here
https://github.com/DICE-UNC/jargon-modeshape/blob/development/jargon-modeshape/irods-connector/src/test/resources/conf/testConfigAuth1.json
I'm sure some of the above is still a bit naive, but I think indeed there's a sequencing issue?
Cheers
Mike C