Hi,
I wrote a java batch allowing to acces XWIKI.
This batch was okay with 1.5.2 XWiki release but it's not working with
1.7.1 XWiki release.
I don't understand where is my problem and need your help...
Here is a part of my java code :
-------------------------------------------------------------------------------------------
private ComponentManager componentManager = null;
/**
* @return a configured Component Manager (which uses the plexus.xml file in
the test resources directory) which can then be put in the XWiki Context
for testing.
*/
public ComponentManager getComponentManager() throws Exception {
if (this.componentManager == null) {
DefaultContainerConfiguration configuration = new
DefaultContainerConfiguration();
configuration.setContainerConfiguration("/plexus.xml");
DefaultPlexusContainer container = new
DefaultPlexusContainer(configuration);
this.componentManager = new PlexusComponentManager(container);
}
return this.componentManager;
}
/**
* Constructeur de BatchWikiAccess
* @throws Exception
*/
public BatchWikiAccess() throws Exception {
String rootPath =
Thread.currentThread().getContextClassLoader().getResource("").getPath();
// Recuperation du fichier de proprietes xwiki
FileInputStream fileInputStream = getInputStream(rootPath +
"xwiki.properties");
XWikiConfig conf = null;
try {
conf = new XWikiConfig(fileInputStream);
conf.setProperty("xwiki.store.hibernate.path", rootPath +
"hibernatedev.cfg.xml");
Utils.setComponentManager(getComponentManager());
wiki = new com.xpn.xwiki.XWiki(conf, new XWikiContext());
} catch (Throwable e) {
Logger.getLogger(this.getClass()).error("o !!! Pb grave lors du runtime : "
+ e.getMessage());
throw new Exception("o !!! Pb grave lors du runtime : " + e.getMessage());
}
}
-------------------------------------------------------------------------------------------
I have a runtime error while execute line :
wiki = new com.xpn.xwiki.XWiki(conf, new XWikiContext());
Thanks in advance for help.
If someone has a better way to access XWIKI in batch mode; it good to !
Julien