[
https://issues.apache.org/jira/browse/JCR-4192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
DilipKumar S reopened JCR-4192:
-------------------------------
Hi Julien,
Code used for storing report. This inturn called CreateContentNode.
@Override
public void storeFileContent(URI uri, Map<String, ?> metadata,
InputStream fileIn) throws RepositoryException {
Session session = null;
try {
String path = uri2xpath(uri);
session = openReadWriteSession();
createContentNode(uri, metadata, session);
Node root = session.getRootNode();
Node newNode = root.getNode(path);
// set the node type to file
//and set the content of the file
Node reportNode = newNode.addNode(FILE_NODE,
NodeType.NT_FILE);
Node fileNode = reportNode.addNode(Node.JCR_CONTENT,
NodeType.NT_RESOURCE);
ValueFactory valueFactory = session.getValueFactory();
Binary b = valueFactory.createBinary(fileIn);
fileNode.setProperty(Property.JCR_DATA, b);
session.save();
} finally {
if (session != null) {
session.logout();
}
}
}
> Issue with retriving reports fromJackRabbit Repository
> ------------------------------------------------------
>
> Key: JCR-4192
> URL: https://issues.apache.org/jira/browse/JCR-4192
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Reporter: DilipKumar S
> Priority: Trivial
> Attachments: SourceCode & logs.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> One of our client has reported that they are unable to retrieve the reports
> stored in the JackRabbit repository. As per our analysis, we could see the
> below error is thrown from the JackRabbit content repository service.
> ============
> ERROR:
> 2017-09-22 08:58:10,035 | ERROR | defaultWIMFileBasedRealm/advisor | | |
> WebContainer : 7 | c.o.r.s.ContentRepositoryService | retrieveReport:
> *Exception from the uderlying repository*
> *javax.jcr.PathNotFoundException: aaa/report/G3604320170922732872*
> at org.apache.jackrabbit.core.NodeImpl$8.perform(NodeImpl.java:2167)
> ~[jackrabbit-core.jar:2.8.0]
> at org.apache.jackrabbit.core.NodeImpl$8.perform(NodeImpl.java:2161)
> ~[jackrabbit-core.jar:2.8.0]
> at
> org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
> ~[jackrabbit-core.jar:2.8.0]
> at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
> ~[jackrabbit-core.jar:2.8.0]
> at org.apache.jackrabbit.core.NodeImpl.getNode(NodeImpl.java:2161)
> ~[jackrabbit-core.jar:2.8.0]
> at
> com.odcgroup.repository.service.ContentRepositoryService.retrieveReportAsStream(ContentRepositoryService.java:109)
> ~[repository-impl.jar:TAP/8.1.06]
> ===========
> I've added the source code of storing and retrieval of the reports as well
> the error log in the attachment.
> We need to know the cause of the error, due to which the user has failed to
> retrieve the reports.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)