Btw, you should take a look at the Job Module
http://extensions.xwiki.org/xwiki/bin/view/Extension/Job+Module which
provides a clean way to perform, in a background thread, tasks that
access the XWiki model.
Hope this helps,
Marius
On Wed, Nov 12, 2014 at 2:45 PM, Thomas Mortagne
<thomas.mortagne(a)xwiki.com> wrote:
Could you copy the complete error, you should have a
more detailed cause.
On Wed, Nov 12, 2014 at 11:39 AM, Stefan Bernsdorf
<gruener.heinrich(a)web.de> wrote:
Hi,
I created a Macro in xwiki.
In this macro a server process is started that tries to read attachments.
For this, I created a XWikiCOntext to access the Wiki.
This is the code:
XWikiStubContextProvider
prov=Utils.getComponent(XWikiStubContextProvider.class);
prov.initialize(template);
XWikiContext con=prov.createStubContext();
con.setUser("XWiki.TestProcess", true);
con.setVirtual(true);
Unfortunately it is not possible to access the attachment content using this
context.
The following error is thrown:
com.xpn.xwiki.XWikiException: Error number 3231 in 3: Exception while
loading attachment myseedfile.dgn of document
microtest_oto.Templates_Test-Stefan
at
com.xpn.xwiki.store.XWikiHibernateAttachmentStore.loadAttachmentContent(XWikiHibernateAttachmentStore.java:233)
at
com.xpn.xwiki.doc.XWikiDocument.loadAttachmentContent(XWikiDocument.java:4600)
at
com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:576)
at
org.centauron.xwiki.help.XWikiAttachmentCopy.doCommand(XWikiAttachmentCopy.java:79)
....
Any help would be appreciated.
Regards, Stefan.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users