Hi Robert,

I'm not too familiar with the upgrade module, but I think it
doesn't support security configuration via JAAS. The NPE also
indicates your repository.xml does not have security manager
set. Can you try to set your SecurityManager in the repository.xml?

See also: http://jackrabbit.apache.org/jcr/jackrabbit-configuration.html#security-configuration

Though, it would probably be better to fix the RepositoryUpgrade
code because the SecurityManager element is actually optional.

Regards
 Marcel

On 20/09/16 16:40, Robert Haycock wrote:
Hi,

I have a jackrabbit repository (2.6.4) and I want to migrate to oak.

I tried...
Java -jar oak-upgrade-1.4.7.jar <path to JCR repo> <path to repo xml> 
mongodb://localhost:27017/oak

It complained about the mysql driver missing. So I copied the oak-upgrade 
project and added the mysql dependency. Then it couldn't find my custom search 
index class, so I commented it out of the xml. Then it couldn't find the 
security manager class configured in my JAAS config so I created one, a blank 
implementation where all methods returned true.

Just as I thought it was doing something I ran into this....
C:\work\MyCompToOakUpgrader>java 
-Djava.security.auth.login.config=c:/work/MyComp/MyComp-backend/jaas.config  -jar 
target/MyComp-to-oak-upgrader-1.4.7.jar  c://work/MyComp-repository  
c://work/MyComp/MyComp-backend/MyComp-repository.xml  mongodb://localhost:27017/oak
20.09.2016 15:36:10.936 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions - DataStore needs 
to be shared with new repository
20.09.2016 15:36:10.937 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions - copyVersions 
parameter set to 1970-01-01
20.09.2016 15:36:10.940 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions - 
copyOrphanedVersions parameter set to 1970-01-01
20.09.2016 15:36:10.941 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions - Cache size: 256 
MB
20.09.2016 15:36:10.952 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.cli.parser.StoreArguments - Source: 
JCR2_DIR_XML[c://work/MyComp-repository, 
c://work/MyComp/MyComp-backend/MyComp-repository.xml]
20.09.2016 15:36:10.954 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.cli.parser.StoreArguments - Destination: 
MONGO[mongodb://localhost:27017/oak]
20.09.2016 15:36:11.042 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - Starting repository...
20.09.2016 15:36:11.482 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - initializing workspace 'default'...
20.09.2016 15:36:11.550 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - workspace 'default' initialized
20.09.2016 15:36:11.552 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - SecurityManager = class 
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager
20.09.2016 15:36:11.560 [main] *INFO*  
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager - init: using 
JAAS LoginModule configuration for MyCompManagerLoginModule
20.09.2016 15:36:11.565 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - Repository started (523ms)
20.09.2016 15:36:11.842 [main] *INFO*  
org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentStore - Configuration 
maxReplicationLagMillis 21600000, maxDeltaForModTimeIdxSecs 60, disableIndexHint false, 
WriteConcern { "getlasterror" : 1} / (Continue on error? false)
20.09.2016 15:36:12.136 [main] *INFO*  
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore - Initialized 
DocumentNodeStore with clusterNodeId: 1 (id: 1, startTime: 1474382172101, 
machineId: mac:00ff1377ebc4, instanceId: C:\work\MyCompToOakUpgrader, pid: 
7212, uuid: a8599b2e-f2c1-48d7-8804-113d11275191, readWriteMode: null, state: 
NONE, revLock: NONE, oakVersion: 1.4.7)
20.09.2016 15:36:12.154 [main] *INFO*  
org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade - Copying repository 
content from c:\work\MyComp-repository to Oak
20.09.2016 15:36:12.167 [main] *INFO*  
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore - Starting 
disposal of DocumentNodeStore with clusterNodeId: 1 (id: 1, startTime: 
1474382172101, machineId: mac:00ff1377ebc4, instanceId: 
C:\work\MyCompToOakUpgrader, pid: 7212, uuid: 
a8599b2e-f2c1-48d7-8804-113d11275191, readWriteMode: null, state: NONE, 
revLock: NONE, oakVersion: 1.4.7)
20.09.2016 15:36:12.171 [main] *INFO*  
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore - Disposed 
DocumentNodeStore with clusterNodeId: 1
20.09.2016 15:36:12.171 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - Shutting down repository...
20.09.2016 15:36:12.174 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - shutting down workspace 'default'...
20.09.2016 15:36:12.174 [main] *INFO*  
org.apache.jackrabbit.core.observation.ObservationDispatcher - Notification of 
EventListeners stopped.
20.09.2016 15:36:12.178 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - workspace 'default' has been 
shutdown
20.09.2016 15:36:12.182 [main] *INFO*  
org.apache.jackrabbit.core.RepositoryImpl - Repository has been shutdown
Exception in thread "main" java.lang.RuntimeException: 
javax.jcr.RepositoryException: Failed to copy content
        at com.google.common.io.Closer.rethrow(Closer.java:149)
        at 
org.apache.jackrabbit.oak.upgrade.cli.OakUpgrade.migrate(OakUpgrade.java:58)
        at 
org.apache.jackrabbit.oak.upgrade.cli.OakUpgrade.main(OakUpgrade.java:42)
Caused by: javax.jcr.RepositoryException: Failed to copy content
        at 
org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade.copy(RepositoryUpgrade.java:525)
        at 
org.apache.jackrabbit.oak.upgrade.cli.OakUpgrade.upgrade(OakUpgrade.java:65)
        at 
org.apache.jackrabbit.oak.upgrade.cli.OakUpgrade.migrate(OakUpgrade.java:53)
        ... 1 more
Caused by: java.lang.NullPointerException
        at 
org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade.mapSecurityConfig(RepositoryUpgrade.java:615)
        at 
org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade.copy(RepositoryUpgrade.java:388)
        ... 3 more

Is there any way to get oak-upgrade to work? Or is there any other method of 
migrating?

Thanks,
Rob.

Reply via email to