You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Christian Sprecher <ki...@gmail.com> on 2011/12/28 21:38:14 UTC

SysXML content importer

Hi all

I am trying to import a JCR System XML (see attached sample.xml), using
this curl-command:

curl -F:operation=import -F:contentType=xml -F:name=secaudit
-F:contentFile=@sample.xml http://localhost:8080/test --user admin:admin

(test resource has been created, sample.xml created from launchpad)

This results in a exception:

28.12.2011 21:02:46.199 *ERROR* [0:0:0:0:0:0:0:1 [1325102566157] POST /test
HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ImportOperation
Exception during response processing. java.lang.NullPointerException
        at
org.apache.jackrabbit.core.NodeImpl.resolveRelativePropertyPath(NodeImpl.java:191)
        at
org.apache.jackrabbit.core.NodeImpl.hasProperty(NodeImpl.java:2723)
        at
org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:311)
        at
org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription.create(XmlReader.java:456)
        at
org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parseInternal(XmlReader.java:271)
        at
org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parse(XmlReader.java:185)
        at
org.apache.sling.jcr.contentloader.internal.DefaultContentImporter.importContent(DefaultContentImporter.java:108)
        at
org.apache.sling.servlets.post.impl.operations.ImportOperation.doRun(ImportOperation.java:150)
        at
org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:92)
        at
org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:242)
....

What am I doing wrong here?

Thx in advance

Chris

Re: SysXML content importer

Posted by Christian Sprecher <ki...@gmail.com>.
Hi Eric

Unfortunately I cannot reproduce the error anymore :/.

The solution was to create a OSGI bundle, with the exact same content as
sling-initial-content, and it worked like a charm. This is imho anyways the
best solution, so I am quite happy atm.

Re your proposal about using the Jackrabbit mechanism: I don't think this
works for my use case, since one of the sling instances is running in the
Jelastic cloud, and I want to do everything via http, i.e. curl :).

Cheers

Chris

On Tue, Jan 10, 2012 at 5:07 PM, Eric Norman <er...@gmail.com>wrote:

> What kind of errors are you seeing?  Is it running out of memory?  Can you
> break the import into smaller chunks?
>
> If this is a backup/restore scenario, you may be able to use the guidelines
> from jackrabbit to migrate your data.  See
> http://wiki.apache.org/jackrabbit/BackupAndMigration
>
> Regards,
> Eric
>
> On Thu, Dec 29, 2011 at 1:09 AM, Christian Sprecher <kindofwhat@gmail.com
> >wrote:
>
> > Hi Eric
> >
> > Thanks, it is working. But there still are other problems with importing
> > larger datasets via system xml and curl. What is best practise regarding
> > importing larger (some megs...) datasets into sling? Should I generate an
> > OSGI bundle?
> >
> > Cheers
> >
> > Chris
> >
> > On Wed, Dec 28, 2011 at 11:47 PM, Eric Norman <eric.d.norman@gmail.com
> > >wrote:
> >
> > > If I recall correctly, I believe the :contentType value for that system
> > > view sample file should be jcr.xml instead of xml.
> > >
> > > On Wed, Dec 28, 2011 at 12:38 PM, Christian Sprecher
> > > <ki...@gmail.com>wrote:
> > >
> > > > Hi all
> > > >
> > > > I am trying to import a JCR System XML (see attached sample.xml),
> using
> > > > this curl-command:
> > > >
> > > > curl -F:operation=import -F:contentType=xml -F:name=secaudit
> > > > -F:contentFile=@sample.xml http://localhost:8080/test --user
> > admin:admin
> > > >
> > > > (test resource has been created, sample.xml created from launchpad)
> > > >
> > > > This results in a exception:
> > > >
> > > > 28.12.2011 21:02:46.199 *ERROR* [0:0:0:0:0:0:0:1 [1325102566157] POST
> > > > /test HTTP/1.1]
> > > > org.apache.sling.servlets.post.impl.operations.ImportOperation
> > Exception
> > > > during response processing. java.lang.NullPointerException
> > > >         at
> > > >
> > >
> >
> org.apache.jackrabbit.core.NodeImpl.resolveRelativePropertyPath(NodeImpl.java:191)
> > > >         at
> > > > org.apache.jackrabbit.core.NodeImpl.hasProperty(NodeImpl.java:2723)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:311)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription.create(XmlReader.java:456)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parseInternal(XmlReader.java:271)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parse(XmlReader.java:185)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.jcr.contentloader.internal.DefaultContentImporter.importContent(DefaultContentImporter.java:108)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.servlets.post.impl.operations.ImportOperation.doRun(ImportOperation.java:150)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:92)
> > > >         at
> > > >
> > >
> >
> org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:242)
> > > > ....
> > > >
> > > > What am I doing wrong here?
> > > >
> > > > Thx in advance
> > > >
> > > > Chris
> > > >
> > >
> >
>

Re: SysXML content importer

Posted by Eric Norman <er...@gmail.com>.
What kind of errors are you seeing?  Is it running out of memory?  Can you
break the import into smaller chunks?

If this is a backup/restore scenario, you may be able to use the guidelines
from jackrabbit to migrate your data.  See
http://wiki.apache.org/jackrabbit/BackupAndMigration

Regards,
Eric

On Thu, Dec 29, 2011 at 1:09 AM, Christian Sprecher <ki...@gmail.com>wrote:

> Hi Eric
>
> Thanks, it is working. But there still are other problems with importing
> larger datasets via system xml and curl. What is best practise regarding
> importing larger (some megs...) datasets into sling? Should I generate an
> OSGI bundle?
>
> Cheers
>
> Chris
>
> On Wed, Dec 28, 2011 at 11:47 PM, Eric Norman <eric.d.norman@gmail.com
> >wrote:
>
> > If I recall correctly, I believe the :contentType value for that system
> > view sample file should be jcr.xml instead of xml.
> >
> > On Wed, Dec 28, 2011 at 12:38 PM, Christian Sprecher
> > <ki...@gmail.com>wrote:
> >
> > > Hi all
> > >
> > > I am trying to import a JCR System XML (see attached sample.xml), using
> > > this curl-command:
> > >
> > > curl -F:operation=import -F:contentType=xml -F:name=secaudit
> > > -F:contentFile=@sample.xml http://localhost:8080/test --user
> admin:admin
> > >
> > > (test resource has been created, sample.xml created from launchpad)
> > >
> > > This results in a exception:
> > >
> > > 28.12.2011 21:02:46.199 *ERROR* [0:0:0:0:0:0:0:1 [1325102566157] POST
> > > /test HTTP/1.1]
> > > org.apache.sling.servlets.post.impl.operations.ImportOperation
> Exception
> > > during response processing. java.lang.NullPointerException
> > >         at
> > >
> >
> org.apache.jackrabbit.core.NodeImpl.resolveRelativePropertyPath(NodeImpl.java:191)
> > >         at
> > > org.apache.jackrabbit.core.NodeImpl.hasProperty(NodeImpl.java:2723)
> > >         at
> > >
> >
> org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:311)
> > >         at
> > >
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription.create(XmlReader.java:456)
> > >         at
> > >
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parseInternal(XmlReader.java:271)
> > >         at
> > >
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parse(XmlReader.java:185)
> > >         at
> > >
> >
> org.apache.sling.jcr.contentloader.internal.DefaultContentImporter.importContent(DefaultContentImporter.java:108)
> > >         at
> > >
> >
> org.apache.sling.servlets.post.impl.operations.ImportOperation.doRun(ImportOperation.java:150)
> > >         at
> > >
> >
> org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:92)
> > >         at
> > >
> >
> org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:242)
> > > ....
> > >
> > > What am I doing wrong here?
> > >
> > > Thx in advance
> > >
> > > Chris
> > >
> >
>

Re: SysXML content importer

Posted by Christian Sprecher <ki...@gmail.com>.
Hi Eric

Thanks, it is working. But there still are other problems with importing
larger datasets via system xml and curl. What is best practise regarding
importing larger (some megs...) datasets into sling? Should I generate an
OSGI bundle?

Cheers

Chris

On Wed, Dec 28, 2011 at 11:47 PM, Eric Norman <er...@gmail.com>wrote:

> If I recall correctly, I believe the :contentType value for that system
> view sample file should be jcr.xml instead of xml.
>
> On Wed, Dec 28, 2011 at 12:38 PM, Christian Sprecher
> <ki...@gmail.com>wrote:
>
> > Hi all
> >
> > I am trying to import a JCR System XML (see attached sample.xml), using
> > this curl-command:
> >
> > curl -F:operation=import -F:contentType=xml -F:name=secaudit
> > -F:contentFile=@sample.xml http://localhost:8080/test --user admin:admin
> >
> > (test resource has been created, sample.xml created from launchpad)
> >
> > This results in a exception:
> >
> > 28.12.2011 21:02:46.199 *ERROR* [0:0:0:0:0:0:0:1 [1325102566157] POST
> > /test HTTP/1.1]
> > org.apache.sling.servlets.post.impl.operations.ImportOperation Exception
> > during response processing. java.lang.NullPointerException
> >         at
> >
> org.apache.jackrabbit.core.NodeImpl.resolveRelativePropertyPath(NodeImpl.java:191)
> >         at
> > org.apache.jackrabbit.core.NodeImpl.hasProperty(NodeImpl.java:2723)
> >         at
> >
> org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:311)
> >         at
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription.create(XmlReader.java:456)
> >         at
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parseInternal(XmlReader.java:271)
> >         at
> >
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parse(XmlReader.java:185)
> >         at
> >
> org.apache.sling.jcr.contentloader.internal.DefaultContentImporter.importContent(DefaultContentImporter.java:108)
> >         at
> >
> org.apache.sling.servlets.post.impl.operations.ImportOperation.doRun(ImportOperation.java:150)
> >         at
> >
> org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:92)
> >         at
> >
> org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:242)
> > ....
> >
> > What am I doing wrong here?
> >
> > Thx in advance
> >
> > Chris
> >
>

Re: SysXML content importer

Posted by Eric Norman <er...@gmail.com>.
If I recall correctly, I believe the :contentType value for that system
view sample file should be jcr.xml instead of xml.

On Wed, Dec 28, 2011 at 12:38 PM, Christian Sprecher
<ki...@gmail.com>wrote:

> Hi all
>
> I am trying to import a JCR System XML (see attached sample.xml), using
> this curl-command:
>
> curl -F:operation=import -F:contentType=xml -F:name=secaudit
> -F:contentFile=@sample.xml http://localhost:8080/test --user admin:admin
>
> (test resource has been created, sample.xml created from launchpad)
>
> This results in a exception:
>
> 28.12.2011 21:02:46.199 *ERROR* [0:0:0:0:0:0:0:1 [1325102566157] POST
> /test HTTP/1.1]
> org.apache.sling.servlets.post.impl.operations.ImportOperation Exception
> during response processing. java.lang.NullPointerException
>         at
> org.apache.jackrabbit.core.NodeImpl.resolveRelativePropertyPath(NodeImpl.java:191)
>         at
> org.apache.jackrabbit.core.NodeImpl.hasProperty(NodeImpl.java:2723)
>         at
> org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:311)
>         at
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription.create(XmlReader.java:456)
>         at
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parseInternal(XmlReader.java:271)
>         at
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parse(XmlReader.java:185)
>         at
> org.apache.sling.jcr.contentloader.internal.DefaultContentImporter.importContent(DefaultContentImporter.java:108)
>         at
> org.apache.sling.servlets.post.impl.operations.ImportOperation.doRun(ImportOperation.java:150)
>         at
> org.apache.sling.servlets.post.AbstractSlingPostOperation.run(AbstractSlingPostOperation.java:92)
>         at
> org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:242)
> ....
>
> What am I doing wrong here?
>
> Thx in advance
>
> Chris
>