error while sendin http PUt to creat a new page in xwiki with REST api -


i want send page xwiki

$ curl -u admin:admin -x put --data-binary "@newpage.xml" -h "content-type: application/xml" http://localhost:8082/xwiki/rest/wikis/xwiki/spaces/main/pages/newpage

my xml page that:

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <page xmlns="http://www.xwiki.org">      <title>hello world</title>     <syntax>xwiki/2.0</syntax>     <content>this new page</content></page> 

but commands return huge code error ,anyone knows thye reason why , information sending content work without problem

error:

org.restlet.ext.jaxrs.internal.exceptions.convertrepresentationexception:   not convert message body org.xwiki.rest.model.jaxb.page @ org.restlet.ext.jaxrs.internal.exceptions.convertrepresentationexcept ion.object(convertrepresentationexception.java:58)at org.restlet.ext.jaxrs.internal.wrappers.params.entitygetter.getvalue(entitygetter.java:115)at org.restlet.ext.jaxrs.internal.wrappers.params.parameterlist.get(parameterlist.java:1090)at org.restlet.ext.jaxrs.internal.wrappers.abstractmethodwrapper.internalinvoke(abstractmethodwrapper.java:169)at org.restlet.ext.jaxrs.internal.wrappers.resourcemethod.invoke(resourcemethod.java:291)at org.restlet.ext.jaxrs.jaxrsrestlet.invokemethod(jaxrsrestlet.java:1043)     @ org.restlet.ext.jaxrs.jaxrsrestlet.handle(jaxrsrestlet.java:792)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.router.dohandle(router.java:500)     @ org.restlet.routing.router.handle(router.java:740)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.engine.application.statusfilter.dohandle(statusfilter.java:154)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.engine.chainhelper.handle(chainhelper.java:114)     @ org.restlet.engine.application.applicationhelper.handle(applicationhelper.java:75)     @ org.restlet.application.handle(application.java:391)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.router.dohandle(router.java:500)     @ org.restlet.routing.router.handle(router.java:740)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.routing.router.dohandle(router.java:500)     @ org.restlet.routing.router.handle(router.java:740)     @ org.restlet.routing.filter.dohandle(filter.java:159)     @ org.restlet.routing.filter.handle(filter.java:206)     @ org.restlet.engine.chainhelper.handle(chainhelper.java:114)     @ org.restlet.component.handle(component.java:391)     @ org.restlet.server.handle(server.java:491)     @ org.restlet.engine.serverhelper.handle(serverhelper.java:74)     @ org.restlet.engine.http.httpserverhelper.handle(httpserverhelper.java:153)     @ org.restlet.ext.servlet.serverservlet.service(serverservlet.java:1031)     @ javax.servlet.http.httpservlet.service(httpservlet.java:790)     @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:769)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1667)     @ org.xwiki.wysiwyg.server.filter.xwikicontextinitializationfilter.dofilter(xwikicontextinitializationfilter.java:85)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1650)     @ org.xwiki.container.servlet.filters.internal.sethttpheaderfilter.dofilter(sethttpheaderfilter.java:63)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1650)     @ com.xpn.xwiki.plugin.webdav.xwikidavfilter.dofilter(xwikidavfilter.java:66)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1650)     @ org.xwiki.container.servlet.filters.internal.savedrequestrestorerfilter.dofilter(savedrequestrestorerfilter.java:208)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1650)     @ org.xwiki.container.servlet.filters.internal.setcharacterencodingfilter.dofilter(setcharacterencodingfilter.java:111)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1650)     @ org.xwiki.resource.servlet.routingfilter.dofilter(routingfilter.java:137)     @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1650)     @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:583)     @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:143)     @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:577)     @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:223)     @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1125)     @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:515)     @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:185)     @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1059)     @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141)     @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215)     @ org.eclipse.jetty.server.handler.handlercollection.handle(handlercollection.java:110)     @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97)     @ org.eclipse.jetty.server.server.handle(server.java:497)     @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:311)     @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:248)     @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:540)     @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:610)     @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:539)     @ java.lang.thread.run(unknown source)caused by: java.io.ioexception: not unmarshal org.xwiki.rest.model.jaxb.page     @ org.restlet.ext.jaxrs.internal.provider.jaxbprovider.readfrom(jaxbprovider.java:197)     @ org.restlet.ext.jaxrs.internal.wrappers.provider.singletonprovider.readfrom(singletonprovider.java:304)     @ org.restlet.ext.jaxrs.internal.wrappers.params.entitygetter.getvalue(entitygetter.java:109)     ... 75 more 

thanks everyone

finally done with

$ curl -x put -u admin:admin -t "@newpage.xml" -h "content-type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/ spaces/main/pages/newppage


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -