BusinessAdapter not available in REST call

Hello,

Using nuxeo IDE, I've created a Document Adapter extending BusinessAdapter to be available in REST calls. If nuxeo server is launched from the IDE, then the adapter is not found from REST and raise :

org.nuxeo.ecm.webengine.WebException: Unable to find [MyAdapter] adapter

at org.nuxeo.ecm.restapi.server.jaxrs.adapters.BOAdapter.getAdapter(BOAdapter.java:142)
at org.nuxeo.ecm.restapi.server.jaxrs.adapters.BOAdapter.doGetAdapterOnList(BOAdapter.java:98)
at org.nuxeo.ecm.restapi.server.jaxrs.adapters.BOAdapter.doGetAdapter(BOAdapter.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Is it a known issue ? Are there some fix ?

Thanks,

Youri

0 votes

0 answers

1038 views

ANSWER

Hi,

Did you register your adapter server side as mentioned here : http://doc.nuxeo.com/display/NXDOC/Java+Automation+Client#JavaAutomationClient-managing-business-objectsManagingBusinessObjects ?

Have you tried the IDE wizard to create Adapter?

So for instance you should have:

<?xml version="1.0"?>
<component name="org.nuxeo.bo.adapters">

  <extension target="org.nuxeo.ecm.core.api.DocumentAdapterService"
    point="adapters">

    <adapter 
      class="org.nuxeo.bo.MyAdapter" factory="org.nuxeo.bo.Factory" />
    </extension>
    </component>

And your contribution should be mentioned in your MANIFEST.MF.

Don't hesitate to give feedback about the documentation issue or else.

Thanks

03/14/2014

Hi,

Sorry, I should have been clearer. Yes, I did use the IDE's wizard to create the Adapter. The extension file is there, and correctly referenced in the MANIFEST. Furthermore, I've checked that the Adapter is available as a standard DocumentModel adapter : DocumentModel.getAdapter(MyAdapter.class) return a correct result. BUT, not found in a REST call.

If I manually build the plugin JAR, install it in the "plugins" directory of the server, and launch it, then the Adaptor is available in a REST call.

It seems the BO adaptor is not visible when the server is launched from the IDE.

03/14/2014