[xwiki-devs] Export/Import batch mode

Thomas Mortagne thomas.mortagne at xwiki.com
Wed Jul 2 18:02:11 CEST 2008


On Wed, Jul 2, 2008 at 5:55 PM, Amedeo <acannone at imolinfo.it> wrote:
>
> Since the problem is caused by version 1.5M2 of XWiki cache service that is a
> plexus component, is possible to checkout a previous revision of XWiki
> sources?
> In other words, there is a tag for checking out a previous revision of all
> the modules configured in the svn:externals definition of
> http://svn.xwiki.org/svnroot/xwiki/trunks?

You can find the 1.4 branch version of xwiki-core at
http://svn.xwiki.org/svnroot/xwiki/xwiki-platform/core/branches/xwiki-core-1.4/

>
>
>
> Amedeo wrote:
>>
>> I follow your suggestion but now I have this error:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/codehaus/plexus/ContainerConfiguration
>> Caused by: java.lang.ClassNotFoundException:
>> org.codehaus.plexus.ContainerConfiguration
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>>
>> Do you know where is the class ContainerConfiguration?
>> I search in the maven repository and in the xwiki sources but I'm not able
>> to find it.
>>
>>
>>
>> Thomas Mortagne wrote:
>>>
>>> On Mon, Jun 30, 2008 at 8:59 PM,  <acannone at imolinfo.it> wrote:
>>>> Invoking directly the class  com.xpn.xwiki.tool.backup.ExporterMain I
>>>> have the following Exception:
>>>>
>>>> Exception in thread "main" java.lang.RuntimeException: Component manager
>>>> has not been initialized before lookup for
>>>> [org.xwiki.cache.CacheFactory] for hint [default]
>>>>        at com.xpn.xwiki.web.Utils.getComponent(Utils.java:553)
>>>>        at com.xpn.xwiki.XWiki.getCacheFactory(XWiki.java:5130)
>>>>        at
>>>> com.xpn.xwiki.store.XWikiCacheStore.initCache(XWikiCacheStore.java:86)
>>>>        at
>>>> com.xpn.xwiki.store.XWikiCacheStore.initCache(XWikiCacheStore.java:80)
>>>>        at
>>>> com.xpn.xwiki.store.XWikiCacheStore.<init>(XWikiCacheStore.java:62)
>>>>        at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:675)
>>>>        at com.xpn.xwiki.XWiki.<init>(XWiki.java:618)
>>>>        at com.xpn.xwiki.XWiki.<init>(XWiki.java:612)
>>>>        at
>>>> com.xpn.xwiki.tool.backup.AbstractPackager.createXWikiContext(AbstractPackager.java:73)
>>>>        at
>>>> com.xpn.xwiki.tool.backup.Exporter.exportDocuments(Exporter.java:53)
>>>>        at
>>>> com.xpn.xwiki.tool.backup.ExporterMain.main(ExporterMain.java:57)
>>>
>>> This error is because you are trying to use XWiki Platform without
>>> initializing it. This particular error is about plexuw component
>>> manager needed because since versio 1.5M2 XWiki cache service is a
>>> plexus component. You should look at shared-test
>>> (trunks//xwiki-platform-tools/xwiki-shared-tests/src/main/java/com/xpn/xwiki/test/AbstractXWikiComponentTestCase.java)
>>> project for a way to create and initialize one you will need the
>>> plexus.xml also in shared-tests. You could directly extends
>>> AbstractXWikiComponentTestCase like unit tests do but it's... for unit
>>> tests and extends junit, jmock etc.
>>>
>>>>
>>>> Any ideas or suggestions?
>>>>
>>>> I have the previous error calling a script that contains something like
>>>> this:
>>>> java -classpath $XWIKICLASSPATH com.xpn.xwiki.tool.backup.ExporterMain
>>>> /home/acannone/xwiki/prova/export xwiki
>>>> /home/acannone/xwiki/prova/hibernate.cfg.xml
>>>>
>>>> There is someone that can tell me how to invoke and configure the maven
>>>> packager plugin in my example?
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>> Thomas Mortagne wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I doubt there is any java level documentation on import/export but you
>>>>> can look at some good examples of how to use packager plugin :
>>>>>  - com.xpn.xwiki.web.ExportAction#exportXAR(XWikiContext)
>>>>>  - com.xpn.xwiki.web.ImportAction#render(XWikiContext)
>>>>>
>>>>> On Mon, May 5, 2008 at 3:19 PM, Lorenzo Manzoni <lmanzoni at imolinfo.it>
>>>>> wrote:
>>>>>> I would like to execute an export of all/some of the wiki pages in a
>>>>>>  batch mode (ex. with a script and a java program).
>>>>>>  In the same way I would like to execute an import.
>>>>>>  Is there an easy way to do this?
>>>>>>
>>>>>>  Looking forward in the xwiki sources I found two classes that seem to
>>>>>> do
>>>>>>  what I want:
>>>>>>
>>>>>>     * com.xpn.xwiki.tool.backup.ExporterMain
>>>>>>     * com.xpn.xwiki.tool.backup.ImporterMain
>>>>>>
>>>>>>  Both classes are in the maven plugin called xwiki-packager-plugin.
>>>>>>  Is there any documentation that explain how use that plugin?
>>>>>>
>>>>>>
>>>>>>  thanks,
>>>>>>  Lorenzo
>>>>>>  _______________________________________________
>>>>>>  devs mailing list
>>>>>>  devs at xwiki.org
>>>>>>  http://lists.xwiki.org/mailman/listinfo/devs
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thomas Mortagne
>>>>> _______________________________________________
>>>>> devs mailing list
>>>>> devs at xwiki.org
>>>>> http://lists.xwiki.org/mailman/listinfo/devs
>>>>>
>>>>>
>>>> Quoted from:
>>>> http://www.nabble.com/Export-Import-batch-mode-tp17061634p17062120.html
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Thomas Mortagne
>>> _______________________________________________
>>> devs mailing list
>>> devs at xwiki.org
>>> http://lists.xwiki.org/mailman/listinfo/devs
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Re%3A-Export-Import-batch-mode-tp18210860p18240863.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> devs mailing list
> devs at xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs
>



-- 
Thomas Mortagne


More information about the devs mailing list