Skip navigation

CQ5

Currently Being Moderated

trying to access crx.default repository through jcr api

Jul 30, 2012 4:44 AM

Hi,

 

I am not able to login to the crx.default workspace using following code:

 

Repository rep = JcrUtils.getRepository();

 

SimpleCredentials creds = new SimpleCredentials(userid, pwd.toCharArray());

    javax.jcr.Session sess = rep.login(creds,"crx.default");

 

It is giving me following exception:

 

javax.jcr.NoSuchWorkspaceException: crx.default

at org.apache.jackrabbit.core.RepositoryImpl.getWorkspaceInfo(Repository Impl.java:778)

at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1 482)

at org.apache.jackrabbit.core.TransientRepository.login(TransientReposit ory.java:360)

at DayDataProvider.createJCRNodeSecurity(DayDataProvider.java:682)

at DayDataProvider.main(DayDataProvider.java:136)

 

Thanks in advance!

 

Regards,

sug1981

 
Replies
  • Justin Edelson
    250 posts
    Nov 24, 2010
    Currently Being Moderated
    Jul 30, 2012 12:47 PM   in reply to sug1981

    By default, getRepository() will create an instance of Jackrabbit's TransientRepository. Assuming this code is running outside of CRX/CQ, you probably want to connect via DavEx which you would do by supplying a URL to getRepository(). See http://dev.day.com/docs/en/crx/current/developing/accessing_the_crx.ht ml#Accessing%20a%20Repository%20via%20JCR%20Remoting%20based%20on%20We bDAV

     
    |
    Mark as:
  • Justin Edelson
    250 posts
    Nov 24, 2010
    Currently Being Moderated
    Jul 31, 2012 6:41 AM   in reply to sug1981

    Hi Sugeet,

    The JCR API is just that, an API. It needs an implementation to work. If you are connecting to CRX from an external webapp, DavEx is the most performant way to do so. RMI is also an option, but may not be supported depending upon the CRX/CQ version you are using.

     

    That said, I don't know if Access Control Management works via remote access: https://issues.apache.org/jira/browse/JCR-2113

     

    One option would be to install the Sling Jackrabbit AccessManager bundle: http://sling.apache.org/site/managing-permissions-jackrabbitaccessmana ger.html

     

    Regards,

    Justin

     
    |
    Mark as:
  • Justin Edelson
    250 posts
    Nov 24, 2010
    Currently Being Moderated
    Aug 1, 2012 6:23 AM   in reply to sug1981

    Hi Sugeet,

    To install OSGi bundles in CQ, you can use the JCR Installer feature by placing bundles in /apps/[yourappname]/install. See http://dev.day.com/docs/en/cq/5-4/deploying/configuring_osgi.html#Best %20Practices%20for%20Managing%20OSGi%20Bundles for details.

     

    As I understand it, you are trying to build an external CQ management tool in C#. To do this, I'd recommend using HTTP-based services deployed inside CQ to expose the various management operations you need. Some of this may be provided by pre-existing solutions, e.g. the Sling POST servlet for content maniuplation, the Sling Jackrabbit AccessManager bundle for ACL management, etc.

     

    Justin

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2013 9:39 PM   in reply to sug1981

    For information about building an OSGi bundle that can query and manipulate the Adobe CQ JCR (using the JCR API), see http://scottsdigitalcommunity.blogspot.ca/2013/02/querying-adobe-exper ience-manager-data.html.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points