-1

while accessing the node i am getting following error:

javax.jcr.RepositoryException: Not a relative path

i am newbie to AEM CQ5.i tried to google it. did not found any description about it.

Thanks in advance!

Mayur Desai
  • 121
  • 1
  • 3
  • 13
  • 1
    Are you trying to access the JCR via java program? Or when you are able to see this error. Can you provide some more details what you are doing? – VAr Sep 18 '16 at 16:58
  • Pls read [how to ask a question](http://stackoverflow.com/help/how-to-ask). – Abhishek Sep 18 '16 at 18:04
  • @VAr yes i am trying to access JCR via java program. i want to upload a image to my DAM from a URL. i am getting this error when i try to access my DAM path "content/DAM/images" – Mayur Desai Sep 19 '16 at 08:11
  • It should be **/content/DAM/images**. Any of the `content/dam/images` or `./content/dam/images` will give _Not an absolute path exception_. A good example can be found at [helpx.adobe.com](https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html) – VAr Sep 19 '16 at 18:49

2 Answers2

1

If you get a Node from the session object you have to use '/'

session.getNode( "/MyFolder" );

But if you use the root node you have to write

session.getRootNode().getNode( "MyFolder" );
Nico
  • 36
  • 5
1

//Remove the first / char - JCR API does not like that

    String newPath = path.replaceFirst("/", "");   

//USE JCR API TO get the Asset Data so we can move it to another JCR location

    Node root = session.getRootNode(); 
    Node fileNode = root.getNode(newPath);