Tushar Pareek | 22 Jul 16:22 2014

Jackrabbit-2.8 .war not running on tomcat 8.0

Hi,

 

We are using jackrabbit 2.8 .war in our application. But when I try to deploy it on tomcat 8.0 server

Things runs fine initially but at the time of  creating repository , it says servlet error ie  “HTTP status 500- only one repository startup servlet allowed per web-app”.

 

Request you to help on this.

 

With Regards,

 

Tushar Pareek

 

t:  +91 80 42200595 |  m: 96209 00963
e-mail:  
tushar.p <at> cloudjetlabs.com

w: www.cloudjetlabs.com

CONFIDENTIALITY & DISCLAIMER NOTICE This message from tushar.p <at> cloudjetlabs.com and any attachments contain specific, confidential or proprietary information for exclusive use by the intended email recipient and others authorised to receive it. If you are not the intended recipient kindly notify the sender immediately. Any unauthorised use or dissemination of the contents of this message is prohibited. Any views and/or opinions expressed by the sender do not necessarily represent those ofCloudJet Labs. CloudJet Labs does not accept liability or legal responsibility for the contents of this message nor any errors in or omissions to the content of electronically generated communications, or any loss or damages howsoever caused, arising as a result of reliance on the contents or unauthorised use thereof. Although steps have been taken by CloudJet Labs to ensure the message is free from computer viruses, this form of communication is not secure and therefore CloudJet Labs cannot warrant this, nor that it has been intercepted and tampered with, CloudJet Labs therefore does not accept any liability for damages howsoever arising in this regard. The responsibility of detection and prevention of computer viruses lies solely with the recipient.

 

 

 

Marcel Reutegger | 22 Jul 10:17 2014
Picon

[ANNOUNCE] Apache Jackrabbit Oak 1.0.2 released

The Apache Jackrabbit community is pleased to announce the release of
Apache Jackrabbit Oak 1.0.2. The release is available for download at:

    http://jackrabbit.apache.org/downloads.html

See the full release notes below for details about this release.

Release Notes -- Apache Jackrabbit Oak -- Version 1.0.2

Introduction
------------

Jackrabbit Oak is a scalable, high-performance hierarchical content
repository designed for use as the foundation of modern world-class
web sites and other demanding content applications.

Apache Jackrabbit Oak 1.0.2 is a patch release that contains fixes and
improvements over Oak 1.0. Jackrabbit Oak 1.0.x releases are considered
stable and targeted for production use.

The Oak effort is a part of the Apache Jackrabbit project.
Apache Jackrabbit is a project of the Apache Software Foundation.

Changes in Oak 1.0.2
--------------------

Improvements

  [OAK-1645] Route find queries to Mongo secondary in MongoDocumentStore
  [OAK-1861] Limit memory usage of DocumentNodeStore.readChildren()
  [OAK-1934] Optimize MutableTree.orderBefore for the common case
  [OAK-1937] Add progress logs to MarkSweepGarbageCollector

Bug fixes

  [OAK-1462] - Aggregate Index isn't usable in an osgi environment
  [OAK-1703] - Improve warning logged on concurrent Session access
  [OAK-1807] - ConstraintViolationException seen with multiple Oak/Mongo
...
  [OAK-1890] - Concurrent System Login: slowdown for high concurrency
levels
  [OAK-1894] - PropertyIndex only considers the cost of a single indexed
...
  [OAK-1895] - ClassCastException can occur if the TraversalIndex is ...
  [OAK-1897] - Stale documents in MongoDocumentStore cache
  [OAK-1898] - Query: Incorrect cost calculation for traversal
  [OAK-1899] - Ordered index fails with old index content
  [OAK-1902] - NodeTypeIndex is not conversative enough about its cost
  [OAK-1903] - PropertyIndex applies 10x penalty to is not null queries ...
  [OAK-1916] - NodeStoreKernel doesn't handle array properties correctly
  [OAK-1917] - FileNotFoundException during TarMK GC
  [OAK-1921] - Backup: "Attempt to read external blob" error
  [OAK-1927] - TarMK compaction delays journal updates
  [OAK-1931] - MicroKernel.read() returns negative value
  [OAK-1932] - TarMK compaction can create mixed segments
  [OAK-1936] - TarMK compaction map check should switch comparison sides
  [OAK-1958] - Session.logout performance poor
  [OAK-1959] - AsyncIndexUpdate unable to cope with missing checkpoint ref

In addition to the above-mentioned changes, this release contains
all the changes included up to the Apache Jackrabbit Oak 1.0.0 release.

For more detailed information about all the changes in this and other
Oak releases, please see the Oak issue tracker at

  https://issues.apache.org/jira/browse/OAK

Release Contents
----------------

This release consists of a single source archive packaged as a zip file.
The archive can be unpacked with the jar tool from your JDK installation.
See the README.md file for instructions on how to build this release.

The source archive is accompanied by SHA1 and MD5 checksums and a PGP
signature that you can use to verify the authenticity of your download.
The public key used for the PGP signature can be found at
https://svn.apache.org/repos/asf/jackrabbit/dist/KEYS.

About Apache Jackrabbit Oak
---------------------------

Jackrabbit Oak is a scalable, high-performance hierarchical content
repository designed for use as the foundation of modern world-class
web sites and other demanding content applications.

The Oak effort is a part of the Apache Jackrabbit project.
Apache Jackrabbit is a project of the Apache Software Foundation.

For more information, visit http://jackrabbit.apache.org/oak

About The Apache Software Foundation
------------------------------------

Established in 1999, The Apache Software Foundation provides
organizational,
legal, and financial support for more than 140 freely-available,
collaboratively-developed Open Source projects. The pragmatic Apache
License
enables individual and commercial users to easily deploy Apache software;
the Foundation's intellectual property framework limits the legal exposure
of its 3,800+ contributors.

For more information, visit http://www.apache.org/

Hsu, David | 22 Jul 01:39 2014

Large index merge loop

Hi, our app is based on Drools Guvnor and our repository is currently about 20GB. Every once in a while, we
will build up enough indexes that it has a to do a very big merge (around 4GB). However, at a certain point the
TransientRepository shuts down for whatever reason (I'm new to Jackrabbit and haven't been able to track
down why...I am still logged into the app when this occurs) and tries to stop the IndexMerger. When the
IndexMerger finally does finish, it says merging has been canceled and that it is deleting the index, but
looking at the index directory I can see that the folder is still present. Then the TransientRepository
starts up again it retries and starts the whole cycle over again, resulting in a bunch of leftover 4GB index
folders and eventually a full hard drive.

We initially encountered this problem on Jackrabbit 1.4.5 (came with Guvnor when this project was
started) and have recently upgraded to 2.8.0 thinking it would help, but we were still able to reproduce
the issue. Is this known and/or expected behavior with the TransientRepository? Is there anything in
Jackrabbit itself that causes all Sessions to spontaneously close and shut down the repository? If so how
do we work around this?

Below is an excerpt from our most recent run on 2.8.0. I forgot to enable debug statements on
TransientRepository, but if needed I can provide the 1.4.5 logs that have them.

2014-07-16 16:00:38,890 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] requesting
merge for [_10w6:99896, _10ze:99781, _115x:99915, _11qc:99849, _12kx:99861, _13mh:43521,
_14ha:34129, _15c5:34256, _1672:34254, _16ur:29993]
2014-07-16 16:00:38,891 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] # of busy
merge workers: 1
2014-07-16 16:00:54,095 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:00:54,097 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set
2014-07-16 16:06:25,673 INFO  [org.apache.jackrabbit.core.query.lucene.IndexMerger] merged
675455 documents in 344310 ms into _16uy.
2014-07-16 16:06:25,674 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] index
merging canceled
2014-07-16 16:06:25,675 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] deleting
index _16uy
2014-07-16 16:06:25,675 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger]
IndexMerger.Worker thread stopped
2014-07-16 16:06:25,676 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] Worker finished
2014-07-16 16:06:26,539 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:06:26,540 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set

2014-07-16 16:06:34,731 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] requesting
merge for [_10w6:99896, _10ze:99781, _115x:99915, _11qc:99849, _12kx:99861, _13mh:43521,
_14ha:34129, _15c5:34256, _1672:34254, _16ur:29993]
2014-07-16 16:06:34,732 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] # of busy
merge workers: 1
2014-07-16 16:06:54,192 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:06:54,193 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set
2014-07-16 16:12:28,267 INFO  [org.apache.jackrabbit.core.query.lucene.IndexMerger] merged
675455 documents in 352127 ms into _16uz.
2014-07-16 16:12:28,270 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] index
merging canceled
2014-07-16 16:12:28,270 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] deleting
index _16uz
2014-07-16 16:12:28,271 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] Worker finished
2014-07-16 16:12:28,271 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger]
IndexMerger.Worker thread stopped
2014-07-16 16:12:28,607 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:12:28,608 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set

2014-07-16 16:12:34,629 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] requesting
merge for [_10w6:99896, _10ze:99781, _115x:99915, _11qc:99849, _12kx:99861, _13mh:43521,
_14ha:34129, _15c5:34256, _1672:34254, _16ur:29993]
2014-07-16 16:12:34,631 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] # of busy
merge workers: 1
2014-07-16 16:12:54,220 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:12:54,221 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set
2014-07-16 16:18:23,807 INFO  [org.apache.jackrabbit.core.query.lucene.IndexMerger] merged
675455 documents in 348109 ms into _16v0.
2014-07-16 16:18:23,810 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] index
merging canceled
2014-07-16 16:18:23,810 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] deleting
index _16v0
2014-07-16 16:18:23,810 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger]
IndexMerger.Worker thread stopped
2014-07-16 16:18:23,812 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] Worker finished
2014-07-16 16:18:24,165 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:18:24,166 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set

2014-07-16 16:18:31,090 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] requesting
merge for [_10w6:99896, _10ze:99781, _115x:99915, _11qc:99849, _12kx:99861, _13mh:43521,
_14ha:34129, _15c5:34256, _1672:34254, _16ur:29993]
2014-07-16 16:18:31,091 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] # of busy
merge workers: 1
2014-07-16 16:18:54,236 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:18:54,238 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set
2014-07-16 16:22:07,872 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] deleting
index _16v1
2014-07-16 16:22:08,545 ERROR [org.apache.jackrabbit.core.query.lucene.IndexMerger] Error while
merging indexes:
java.io.IOException: There is not enough space on the disk
               at java.io.RandomAccessFile.setLength(Native Method)
               at org.apache.lucene.store.FSDirectory$FSIndexOutput.setLength(FSDirectory.java:489)
               at org.apache.lucene.index.CompoundFileWriter.close(CompoundFileWriter.java:195)
               at org.apache.lucene.index.SegmentMerger.createCompoundFile(SegmentMerger.java:137)
               at org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:3219)
               at org.apache.jackrabbit.core.query.lucene.PersistentIndex.addIndexes(PersistentIndex.java:114)
               at org.apache.jackrabbit.core.query.lucene.IndexMerger$Worker.run(IndexMerger.java:526)
               at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
               at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
               at java.util.concurrent.FutureTask.run(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
2014-07-16 16:22:08,551 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] Worker finished
2014-07-16 16:22:08,552 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger]
IndexMerger.Worker thread stopped
2014-07-16 16:22:08,890 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] dispose IndexMerger
2014-07-16 16:22:08,891 DEBUG [org.apache.jackrabbit.core.query.lucene.IndexMerger] quit flag set

Any help would be greatly appreciated.

Thanks,

David Hsu
Torgeir Veimo | 16 Jul 19:32 2014
Picon

getSize() == -1 with oak

What's the correct approach to getting a total count from a query
result with apache oak?

Using 'order by  <at> jcr:score' doesn't seem to work as it does with Jackrabbit.

--

-- 
-Tor

techie2k | 16 Jul 13:05 2014
Picon

Getting list of nodes for user

Hi,

I have many 'nt:folder' types created and upon each folder creation,
permissions has been granted to different set of users. Now I need to get
list of nodes based on user(with read and write) persmissions.

Using jackrabbit 2.6.0

Partial snippet of user creation and assigning privilege
*User creation:*

UserManager userManager = ((JackrabbitSession) session).getUserManager();
org.apache.jackrabbit.api.security.user.User user =
(org.apache.jackrabbit.api.security.user.User)userManager.getAuthorizable(userName);

*// Add entry*
javax.jcr.security.Privilege[] privileges = new
javax.jcr.security.Privilege[] {
accessControlManager.privilegeFromName(javax.jcr.security.Privilege.JCR_WRITE)
};
//Temporary folder access
Map<String, Value> restrictions = new HashMap<String, Value>();
restrictions.put("rep:nodePath",
valueFactory.createValue(userDbInstance.getUserFilePath(),
PropertyType.PATH));
restrictions.put("rep:glob", valueFactory.createValue("*"));
accessControlList.addEntry(userPrincipal, privileges, true  /*allow or deny
*/, restrictions);

//Adding Node

public Node addNode(String parent, String name, ETNodeTypes type) throws
JCRServiceException {
	checkSession();
	try {
		name = Text.escapeIllegalJcrChars(name);
		logger.debug("Adding Node: " + parent + "  type: " + type + " 
name(escaped):" + name);
		Node node = session.getNode(parent).addNode(name, type.getName());
		node.addMixin("rep:AccessControllable");
		logger.debug("Node added: " + node.getPath());
		return node;
	} catch (RepositoryException e) {
		e.printStackTrace();
		throw new JCRServiceException(e,e.getMessage(),"Unable to create");
		}
	}

Thanks.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Getting-list-of-nodes-for-user-tp4661092.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Dolan, Kelly | 15 Jul 16:05 2014

Reindexing Jackrabbit

I found this wiki page (http://wiki.apache.org/jackrabbit/Search#Rebuilding_the_Index) that
basically states if an index becomes inconsistent, delete it and restart JR and it will be rebuilt. We have
customers with a ton of data in the repository which can take hours/days to rebuild. This is unacceptable
for those who insist on downtimes of no more than an hour or two.

What are options we can pursue? Is there another way to fix the index, or re-index only a subset?

We are currently using JR 2.6.3 but are considering the possibility of upgrading to Oak. Are more options
available if we do that?  Our current configuration is below...

<?xml version="1.0" encoding="UTF-8"?>
<Workspace name="default">
        <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
...
        </FileSystem>
        <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
...
        </PersistenceManager>
        <SearchIndex class="com.inmedius.horizon.jackrabbit.core.query.lucene.ExtendedSearchIndex">
          <param name="path" value="${wsp.home}/index"/>
          <param name="useCompoundFile" value="true"/>
          <param name="minMergeDocs" value="100"/>
          <param name="volatileIdleTime" value="3"/>
          <param name="maxMergeDocs" value="100000"/>
          <param name="mergeFactor" value="10"/>
          <param name="maxFieldLength" value="10000"/>
          <param name="bufferSize" value="10"/>
          <param name="cacheSize" value="1000"/>
          <param name="forceConsistencyCheck" value="false"/>
          <param name="autoRepair" value="true"/>
          <param name="analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
          <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl"/>
          <param name="respectDocumentOrder" value="true"/>
          <param name="resultFetchSize" value="2147483647"/>
          <param name="extractorPoolSize" value="5"/>
          <param name="extractorTimeout" value="5000"/>
          <param name="extractorBackLogSize" value="100"/>
                                  <param name="textFilterClasses" value=""/>
        </SearchIndex>
    </Workspace>

Thanks,
Kelly

--
Kelly E. Dolan, Software Architect
Inmedius, a Boeing Company | www.inmedius.com<http://www.inmedius.com>
P: 412-459-0310 x211 | F: 412-459-0311

Torgeir Veimo | 15 Jul 00:21 2014
Picon

oak: setting up indexes

I' seeing logs like

00:11:55,702 DEBUG jackrabbit.JackrabbitQuery.getQueryString() - line
242 [127.0.0.1] - queryString:
/jcr:root/nen:content/pages-en//element(*,nen:resource)[ <at> nen:type =
'0']

00:11:55,706 WARN
strategy.ContentMirrorStoreStrategy$PathIterator.fetchNextPossiblyDuplicate()
- line 278 [127.0.0.1] - Traversed 1000 nodes using index
jcr:mixinTypes with filter Filter(query=select [jcr:path],
[jcr:score], * from [nen:resource] as a where [nen:type] = '0' and
isdescendantnode(a, '/nen:content/pages-en') /* xpath:
/jcr:root/nen:content/pages-en//element(*,nen:resource)[ <at> nen:type =
'0'] */, path=/nen:content/pages-en//*, property=[nen:type=0])
[...]

which I guess indicates that I need an index here (on jcr:path)?

I've currently set up indexes in an RepositoryInitializer class with

IndexUtils.createIndexDefinition(index, "nen:resourceid", true, false,
org.elasticsearch.common.collect.ImmutableList.of("nen:resourceid"),
null);
IndexUtils.createIndexDefinition(index, "nen:type", true, false,
org.elasticsearch.common.collect.ImmutableList.of("nen:type"), null);
IndexUtils.createIndexDefinition(index, "nen:name", true, false,
org.elasticsearch.common.collect.ImmutableList.of("nen:name"), null);

My /oak:index node contains index definitions for

nen:type, acPrincipalName, uuid, nen:resourceid,nen:name, nodetype,
reference, principalName, lucene, authorizableId.

--

-- 
-Tor

Torgeir Veimo | 13 Jul 13:09 2014
Picon

OakRepositoryFactory / non-osgi setting

I'm trying to instantiate an oak repository without any OSGi
environment. It looks like OakRepositoryFactory ignores any parameters
passed to it, just calling the empty Jcr() constructor, which results
in an in-memory repository.

Are there any examples on how to configure eg a tarmk repository
outside of an OSGi environment?

--

-- 
-Tor

Torgeir Veimo | 11 Jul 17:54 2014
Picon

oak-run upgrade

Am getting

Exception in thread "main" javax.jcr.RepositoryException: Failed to copy content

at org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade.copy(RepositoryUpgrade.java:307)

at org.apache.jackrabbit.oak.run.Main.upgrade(Main.java:342)

at org.apache.jackrabbit.oak.run.Main.main(Main.java:113)

Caused by: java.lang.IllegalArgumentException: Invalid name:

at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.checkValidName(AbstractNodeState.java:61)

when I try to upgrade a jackrabbit 2.8.0 repository. Is there any way
to specify a verbosity parameter or trace log in order to see which
node has an invalid name?

Also, it looks like the README.md file for oak run has swapped the
order of the parameters for repository directory and repository.xml
file in the example?

--

-- 
-Tor

Ron Wheeler | 9 Jul 19:52 2014

Specifying Repository Home Directory and Repository configuration file location.

On page http://jackrabbit.apache.org/jackrabbit-configuration.html
it say "Apache Jackrabbit needs two pieces of information to set up a 
runtime content repository instance:".
These are *Repository home directory*and *Repository configuration file*.
It goes on to say "These two configuration parameters are passed either 
directly to Jackrabbit when creating a repository instance or indirectly 
through settings for a JNDI object factory or some other component 
management system."

It fails to have a link about how to do this.

We have built a batch program that uses Jackrabbit as its temporary 
storage system.
In a Windows environment, I want to have the immutable parts of the 
program stored under "Program Files" and the mutable parts somewhere 
else. I want to have the repository in a folder specfied at install time 
so I do not want to specify this location in the repository.xml file 
which is created during development.

At the moment, Jackrabbit can not find the repository.xml file although 
I have been able to tell it where the Repository Home directory is found.
It copies the default repository.xml 
(/org/apache/jackrabbit/core/repository.xml)file into the Repository 
Home that I specified.
This overwrites mine.

DEBUG [main] (RepositoryFactoryImpl.java:24) - Calling init on the repository

DEBUG [main] (RepositoryImpl.java:36) - Starting repository create with configDir = 'file:///ADTransformTest/repository'.

DEBUG [main] (TransientRepository.java:279) - Initializing transient repository

  INFO [main] (RepositoryConfig.java:197) - Creating repository directory file:\ADTransformTest\repository

  INFO [main] (RepositoryConfig.java:202) - Copying configuration from
jar:file:/C:/adtransformpf/bin/adtransform-core-jcr-1.0-SNAPSHOT.jar!/org/apache/jackrabbit/core/repository.xml
to file:\ADTransformTest\repository\repository.xml

ERROR [main] (RepositoryImpl.java:42) - Error logging into JackrabbitAutomatic repository
configuration failed

Ideally, I would like this specified in a properties file that is read
by Spring and fed to the main program where it could be used by the main program while creating the repository.

Can I specify both the folder and the config file?
I don't mind if the config file is in the immutable folder (classpath 
for jar files) or in the repository data folder.

--

-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler <at> artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

techie2k | 6 Jul 13:33 2014
Picon

Unable to set policy

Hi,
I'm using Jackrabbit 2.6.0 with JCR 2.0. Trying to create new users and
assign some privileges to them.When I try to get AccessControlPolicy from
AccessControlManager(from root node), it always gives null.Entry in
repository.xml,*   	      	     				 		 			    **Relevant java code to set
privileges(tried all possible combinations) *		Session session =
repository.login(new SimpleCredentials(userName, password.toCharArray())); 		
UserManager um = ((JackrabbitSession) session).getUserManager(); 		
org.apache.jackrabbit.api.security.user.User user =
um.createUser(loggedInUserName, loggedInUserPassword); 		
AccessControlManager acm = session.getAccessControlManager();     					
String rootNode = "/1";						AccessControlPolicyIterator
applicablePolicyIterator = acm.getApplicablePolicies(rootNode); 					
AccessControlPolicy[] acpEffective =  acm.getEffectivePolicies(rootNode);		
Iterator effectivePolicyIterator = Arrays.asList(acpEffective).iterator();					
AccessControlPolicy[] acpWhole = acm.getPolicies(rootNode);			Iterator
policyIterator = Arrays.asList(acpWhole).iterator();					
if(applicablePolicyIterator != null && applicablePolicyIterator.getSize() >
0) {				while (applicablePolicyIterator.hasNext()) { 				   
AccessControlPolicy acp =
applicablePolicyIterator.nextAccessControlPolicy(); 				   
javax.jcr.security.Privilege[] privileges =
new
javax.jcr.security.Privilege[]{acm.privilegeFromName(javax.jcr.security.Privilege.JCR_WRITE)};
				   
((AccessControlList)acp).addAccessControlEntry(new
PrincipalImpl(user.getID()), privileges); 				    acm.setPolicy(rootNode,
acp); 				} 			} else if(effectivePolicyIterator != null &&
effectivePolicyIterator.hasNext()) {			
while(effectivePolicyIterator.hasNext()) {					AccessControlPolicy acp =
effectivePolicyIterator.next(); 				    javax.jcr.security.Privilege[]
privileges =
new
javax.jcr.security.Privilege[]{acm.privilegeFromName(javax.jcr.security.Privilege.JCR_WRITE)};
				   
((AccessControlList)acp).addAccessControlEntry(new
PrincipalImpl(user.getID()), privileges); 				    acm.setPolicy(rootNode,
acp); 				}			} else if(policyIterator != null && policyIterator.hasNext())
{				while(policyIterator.hasNext()) {					AccessControlPolicy acp =
policyIterator.next(); 				    javax.jcr.security.Privilege[] privileges
=
new
javax.jcr.security.Privilege[]{acm.privilegeFromName(javax.jcr.security.Privilege.JCR_WRITE)};
				   
((AccessControlList)acp).addAccessControlEntry(new
PrincipalImpl(user.getID()), privileges); 				    acm.setPolicy(rootNode,
acp); 				}			}but to no avail. Kindly hint me on how to access the
privileges.
Thanks

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Unable-to-set-policy-tp4661051.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Gmane