Hi Users,
I tried to use the xwiki-platform-tool-packager-plugin maven plugin to
import wiki pages into xwiki. However I get following error:
% mvn org.xwiki.platform:xwiki-platform-tool-packager-plugin:3.1:import
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building de.hierlmeier.xwiki.testpages
[INFO] task-segment:
[org.xwiki.platform:xwiki-platform-tool-packager-plugin:3.1:import]
[INFO]
------------------------------------------------------------------------
[INFO] [xwiki-packager-plugin:import {execution: default-cli}]
2011-12-12 15:29:00,854 [main] WARN iPropertiesConfigurationSource -
Failed to load configuration file [/WEB-INF/xwiki.properties]. Using
default configuration values. Internal error [null]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to import XWiki documents
Embedded error: Failed to load component
[com.xpn.xwiki.store.XWikiStoreInterface] for hint [null]
...
The following exception occured during the import (printed out with
maven -X):
[DEBUG] Configuring mojo
'org.xwiki.platform:xwiki-platform-tool-packager-plugin:3.1:import' -->
[DEBUG] (f) databaseName = xwiki
[DEBUG] (f) hibernateConfig = c:\xwiki\WEB-INF\hibernate.cfg.xml
[DEBUG] (f) sourceDirectory = C:\Users\rh\xwiki\src\documents
[DEBUG] -- end configuration --
[INFO] [xwiki-packager-plugin:import {execution: default-cli}]
2011-12-12 15:44:54,378 [main] WARN iPropertiesConfigurationSource -
Failed to load configuration file [/WEB-INF/xwiki.properties]. Using
default configuration values. Internal error [null]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to import XWiki documents
Embedded error: Failed to load component
[com.xpn.xwiki.store.XWikiStoreInterface] for hint [null]
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to import
XWiki documents
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to
import XWiki documents
at com.xpn.xwiki.tool.backup.ImportMojo.execute(ImportMojo.java:62)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: java.lang.RuntimeException: Failed to load component
[com.xpn.xwiki.store.XWikiStoreInterface] for hint [null]
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:645)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:762)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:710)
at
com.xpn.xwiki.tool.backup.AbstractPackager.createXWikiContext(AbstractPackager.java:108)
at
com.xpn.xwiki.tool.backup.Importer.importDocuments(Importer.java:62)
at com.xpn.xwiki.tool.backup.ImportMojo.execute(ImportMojo.java:60)
... 19 more
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed
to lookup component [role = [com.xpn.xwiki.store.XWikiStoreInterface]
hint = [default]]
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:369)
at
org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:126)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:643)
... 24 more
Caused by: java.lang.NullPointerException
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.initialize(XWikiHibernateBaseStore.java:99)
at
org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:437)
at
org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:360)
... 26 more
I assume that I need additional configuration options in my pom. So far
I have configured the following options:
<plugins>
<plugin>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-tool-packager-plugin</artifactId>
<version>3.1</version>
<configuration>
<hibernateConfig>c:/xwiki/WEB-INF/hibernate.cfg.xml</hibernateConfig>
<sourceDirectory>src/documents</sourceDirectory>
</configuration>
</plugin>
</plugins>
What is missing?
Richard