-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Runtime
-
Tags:
Sample remote test in placefulservice:
public void testDBAnnotation() throws Exception {
DocumentModel root = _getRootDocument();
DocumentModel file = new DocumentModelImpl(root.getPathAsString(),
"file", "File");
file = _createChildDocument(file);
DBAnnotatableDocument adoc = file.getAdapter(DBAnnotatableDocument.class);
SubscriptionConfig config = new SubscriptionConfig();
config.setId("xxx");
config.setEvent("publish");
adoc.setAnnotation("SubscriptionConfig", "val1");
}
leads to:
java.lang.NullPointerException
at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.findAdapter(DocumentModelImpl.java:454)
at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getAdapter(DocumentModelImpl.java:429)
...
which happens in:
private <T> T findAdapter(Class<T> itf) {
DocumentAdapterService svc = (DocumentAdapterService) NXRuntime
.getRuntime().getComponent(DocumentAdapterService.NAME);
of DocumentModelImpl.java in org.nuxeo.ecm.core.api.impl
server.log:
2007-02-27 14:51:19,443 INFO [org.nuxeo.ecm.core.api.adapter.DocumentAdapterService] Registered document adapter factorynull: interface org.nuxeo.ecm.platform.ec.placeful.DBAnnotatableDocument
The same NPE happens in standard remote tests in TestAPI.java in
// TODO: fix and reenable.
public void testDocumentAdapter() throws Exception
which is btw disabled at the moment.