Code used for storing report: private void createContentNode(URI uri, Map contentMap, Session session) throws RepositoryException { String path = uri2xpath(uri); Node root = session.getRootNode(); LOGGER.info("storeContent: adding content for path="+path); String[] nodes = path.split("/"); //test each node for creation Node base = root; for (String node : nodes) { if (!base.hasNode(node)) { // the node does not exist create it. LOGGER.debug("storeContent: adding node="+node); base.addNode(node); } base = base.getNode(node); } //The new node is the latest added node Node newNode = base; //here we declare all needed mixin newNode.addMixin(NodeType.MIX_CREATED); newNode.addMixin(NodeType.MIX_LAST_MODIFIED); LOGGER.debug("storeContent: defining mixin for the new node: "+NodeType.MIX_CREATED+" "+NodeType.MIX_LAST_MODIFIED); if (contentMap != null) { for (Map.Entry entry : contentMap.entrySet()) { Value[] v = parseValue(session, entry.getValue()); LOGGER.debug("storeContent: adding value to the new node value="+v); newNode.setProperty(entry.getKey(), v); } } } Retrieval Code: @Override public InputStream retrieveReportAsStream(Session readOnlySession, URI reportUri) throws RepositoryException { try { String path = getJcrContentRepository().uri2xpath(reportUri); Node root = readOnlySession.getRootNode(); Node reportNode = root.getNode(path); Node fileNode = reportNode.getNode(JCRContentRepository.FILE_NODE); Node contentNode = fileNode.getNode(Node.JCR_CONTENT); Property p = contentNode.getProperty(Property.JCR_DATA); if (p.getType() == PropertyType.BINARY) { Binary report = p.getBinary(); LOGGER.debug("retrieveReport: PDF size = "+report.getSize()); return report.getStream(); } else { LOGGER.error("retrieveReport: report not found for URI="+reportUri+" at node="+path); throw new ContentNotFoundException(this, "retrieveReport", reportUri); } } catch (javax.jcr.RepositoryException e) { LOGGER.error("retrieveReport: Exception from the uderlying repository", e); throw new RepositoryPersistenceException(this, "retrieveReport", e, new Object[]{reportUri}); } }