Configuration Clarification

I am setting up XWIKI to evaluate and wanted to clarify three configuration points on using MySQL please

  1. Adding the MySQL JDBC Driver jar to the WAR file - do I unpackage the WAR file and add the jar file to the location WEB-INF/lib?

  2. Tell XWiki to use MySql - is the file to amend in WEB-INF/hibernate.cfg.xml in the unpackaged WAR file?

  3. Do I package up the WAR file again and then where do I run it from?

Thanks in advance

Hi,

to use the war package you need to have a webapplication server running, like tomcat.

Just search for “#your webapps server# install xwiki” on Google and you should find something, e.g. http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/

Also here are some hints regarding MySQL:

http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationMySQL/

The install pages have tons of important hints also.

Maybe for a simple evaluation the demo package or zip package is better suited. See xwiki.org Downloads section.

Best regards

rbr

Thanks rbr. Yes I have the Tomcat setup now and unpackaged the WAR file and found the MySQL connector but its a zip and not a jar and not sure if simply changing the extension to .jar will be enough

It’s not enough to rename it. It should be a zip containing a jar. You need to unzip the zip to get the jar. Then place the jar in the lib folder. If there is no jar make sure that you did not download the source zip

Ah!! Thanks again rbr. learning as I go but your advice is good. I changed the file extension from zip to jar but I noticed the icon did not change and when I copied to the lib directory it was still a compressed file and NOT a JAR executable so deleted it. Then from your guidance I found the jar file within the zip - thanks. I have updated the hibernate.cfg file now too so just to rebuild the WAR file and deploy in Tomcat

You don’t need to/should not rebuild the WAR package. Just copy the extracted package to webapps/xwiki folder. As described in the tomcat installation doc linked to above.

Please read the documents very carefully and follow them closely else you will see problems that are easy to avoid.

Hmm, almost worked. I enetered the following URL (my tomcat is setup with port 7777 and I kept the WAR folder name of xwiki-9.11.5)

http://localhost:7777/xwiki-9.11.5/bin/view/Main

It initially stated “initialising xWiki” and got to about 15% then the following error was displayed

Failed to extract Entity Resource Reference from URL [http://localhost:7777/xwiki-9.11.5/bin/view/Main]

The server encountered an unexpected condition that prevented it from fulfilling the request.

Thanks so far for you help

Again: Please follow the documentation closely, which tells you to use a folder xwiki. So the error may be caused by the “wrong” folder name.
Also please review the server log which you will find in tomcatfolder/logs/catalina.out . There should be some hints why it failed.

Thanks again rbr. The output in the browser and the Tomcat command window hinted at two things. One was “could not create the connection pool”. So I added all the mappings in the MySQL property tags in the hibernate.cfg file and this got the initialisation to 92%. Then it fails again. There was still different out put in the console and browser but when I looked in the catalina logs as you suggested there was only one which was concerning the JDBC not liking the “GMT time zone”. Searched the web and I added the following to the JDBC URL in the hibernate.cfg

?serverTimezone=GMT

Then it initialised and I was able to set up an admin user and install an Xwiki flavour.

Thanks again