Ok, I've found the problem. Nothing to do with XWiki or MySQL, the heap of Tomcat was too low. I've increased the -Xmx and it works fine.
 
Antonio 

 
2008/2/16, Antonio Goncalves <antonio.mailing@gmail.com>:
Hi everybody,
 
I'm bringing this issue back but it still doesn't work. This is what I'm doing :
 
I'm starting everything from scratch : new database completly empty and a fresh XWiki 1.2.2.7518 on a fresh Tomcat 5.5.26 and a 5.0.41 MySQL (with a 5.1.5 driver). Just after installing XWiki, I try to import my 6Mb xar file that I've exported from a XWiki 1.0. I select my file, click on Upload and I end up with a "Java Heap Space Out Of Memory Exception" without any stack trace. Notice that it breaks even before showing the page allowing me to select the file.
 
Here is how I've checked that MySQL could handle 6Mb : SHOW SESSION VARIABLES like max_allowed_packet';  and  SHOW GLOBAL VARIABLES like 'max_allowed_packet';  Both results are 16Mb (max_allowed_packet = 16776192). I don't know how to get the value max_upload_size from XWiki.Preferences but following what Vincent said and http://jira.xwiki.org/jira/browse/XE-145  it should be set to 32Mb. In terms of size (MySQL and XWiki) it looks like it can handle 6Mb.
 
I have several archives. So I've tried with a 2.2Mb xar file. It also breaks but the behaviour is different. After clicking on upload, XWiki shows me the page allowing me to choose from a file (this page doesn't even appear with the 6Mb file). But then it breaks with a more explicit stack trace (as follow).
 
Any idea ?
Antonio
Error number 0 in 11: Uncaught exception
Wrapped Exception: Java heap space
com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception
Wrapped Exception: Java heap space
	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:164)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:595)


Wrapped Exception:

java.lang.OutOfMemoryError: Java heap space
	at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
	at java.lang.StringBuffer.append(StringBuffer.java:225)
	at org.suigeneris.jrcs.rcs.impl.Node.toText(Node.java:720)
	at org.suigeneris.jrcs.rcs.Archive.toString(Archive.java:914)
	at org.suigeneris.jrcs.rcs.Archive.toString(Archive.java:686)
	at org.suigeneris.jrcs.rcs.Archive.toByteArray(Archive.java:723)
	at com.xpn.xwiki.doc.XWikiAttachmentArchive.getArchive(XWikiAttachmentArchive.java:79)
	at com.xpn.xwiki.doc.XWikiAttachmentArchive.getArchive(XWikiAttachmentArchive.java:68)
	at com.xpn.xwiki.doc.XWikiAttachment.toXML(XWikiAttachment.java:309)
	at com.xpn.xwiki.doc.XWikiDocument.toXMLDocument(XWikiDocument.java:2191)
	at com.xpn.xwiki.doc.XWikiDocument.toXML(XWikiDocument.java:2086)
	at com.xpn.xwiki.doc.XWikiDocument.toFullXML(XWikiDocument.java:2055)
	at com.xpn.xwiki.doc.XWikiDeletedDocument.setDocument(XWikiDeletedDocument.java:182)
	at com.xpn.xwiki.doc.XWikiDeletedDocument.(XWikiDeletedDocument.java:85)
	at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore.saveToRecycleBin(XWikiHibernateRecycleBinStore.java:54)
	at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3262)
	at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3254)
	at com.xpn.xwiki.plugin.packaging.Package.installDocument(Package.java:560)
	at com.xpn.xwiki.plugin.packaging.Package.install(Package.java:525)
	at com.xpn.xwiki.plugin.packaging.PackageAPI.install(PackageAPI.java:197)
	at com.xpn.xwiki.web.ImportAction.render(ImportAction.java:89)
	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:148)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
 


 
2008/1/21, Vincent Massol <vincent@massol.net>:
Hi Antonio,

On Jan 21, 2008, at 11:56 AM, Antonio Goncalves wrote:

Hi all,
 
I'm trying to upgrade XWiki from 1.0 to 1.2. The problem comes when I want to import my .xar file (6Mb) and get a Java Heap Space Out Of Memory Exception.
 
I've checked your admin page http://www.xwiki.org/xwiki/bin/view/FAQ/Howtoincreasethemaximumattachmentsize  and it looks like for my problem (file < 10Mb), only MySQL should be changed. So I've changed the max_allowed_packet parameter but the problem still occurs. I don't have anything in Tomcat or MySQL logs, which is a bit strange. The only trace I get is the one bellow. It looks like Lucene breaks because of the file upload not working. Any idea ? How could I get more details in the log ?

 
There are 2 places where to make changes when you want to import a large XAR:
1) the mysql config as you said,
2) the XWikiPreferences object. Before 1.2 it had a max of 1MB if I recall correctly. In 1.2 we've upgraded it to 30MB I believe. However if you're using your old XWikiPreferences object then you'll have th max_upload_size set to the old value.

 

 
Now regarding lucene I don't understand why this the import has anything to do with lucene but there's probably something I don't know here...

 
Try changing the max file upload parameter in your xwikipreferences and try the upload again.

 
-Vincent

 
Thanks,
 
Antonio
 
[http://localhost:8080/xwiki/bin/upload/XWiki/Import] [http-8080-Processor25] ERROR lucene.IndexUpdater             - invalid parameters given to add: XWiki.Import, null,
{grouplist={xwiki:XWiki.XWikiGuest=[], xwiki:xwiki:XWiki.XWikiGuest=[]}, fileuploadlist=[name=null, StoreLocation=D:\Servers\Tomcat\apache-tomcat-5.5.23\temp\upload_662feb76_117990b87e0__8000_00000000.tmp, size=77bytes, isFormField=true
, FieldName=xredirect, name=null, StoreLocation=D:\Servers\Tomcat\apache-tomcat-5.5.23\temp\upload_662feb76_117990b87e0__8000_00000001.tmp,
size=20bytes, isFormField=true, FieldName=filename, name=Backup2008-01-20.xar , StoreLocation=D:\Servers\Tomcat\apache-tomcat-5.5.23\temp\upl
oad_662feb76_117990b87e0__8000_00000002.tmp, size=6639095bytes, isFormField=false, FieldName=filepath], msg=com.xpn.xwiki.web.XWikiMessageTo
ol@1171e30, util=com.xpn.xwiki.util.Util@bf1a4a, baseskin=albatross, tdoc=XWiki.Import, ajax=false, locale=fr, doc= XWiki.Import, mainxwiki=x
wiki, skin=albatross, message=javaheapspace, fileuploadplugin=com.xpn.xwiki.plugin.fileupload.FileUploadPlugin@571cc4, vcontext=org.apache.v
elocity.VelocityContext@1219665}
 

_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users




--
--
Antonio Goncalves (antonio.goncalves@gmail.com)
Software architect

Paris JUG leader : www.parisjug.org
Web site : www.antoniogoncalves.org
Blog: jroller.com/agoncal
LinkedIn: www.linkedin.com/in/agoncal



--
--
Antonio Goncalves (antonio.goncalves@gmail.com)
Software architect

Paris JUG leader : www.parisjug.org
Web site : www.antoniogoncalves.org
Blog: jroller.com/agoncal
LinkedIn: www.linkedin.com/in/agoncal