Hello ,
I've a small problem with a fresh install of xwiki 6.1 on solaris (tomcat, oracle).
When I try to see the deleted attachments from the 'xwiki list of documents ', I
got this error (see bellow).
There is just 2 deleted doc in the table;
I tried to save the page with admin account (who has programming rights), still the
same.
Any idea?
BR
Patrick
Failed to execute the [velocity] macro
org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for
content [#if(!$xwiki.hasProgrammingRights())
{{warning}}This document requires programming rights and needs to be saved by an
administrator of this Wiki{{/warning}}
#else
#set($dateFormat = 'yyyy MMMM d, HH:mm')
#if(!$request.list)
$xwiki.ssx.use('XWiki.DeletedAttachments')##
$xwiki.jsx.use('XWiki.DeletedAttachments', {'minify' :
'false'})##
##
#set($columns = ['datt.filename', 'datt.docName', 'datt.date',
'datt.deleter', 'actions'])
#set($columnProperties = {
'datt.filename' : { 'type' : 'text', 'size' : 10 },
'datt.docName' : { 'type' : 'text', 'size' : 10 },
'datt.date' : { 'type' : 'date', 'filterable' :
false },
'datt.deleter' : { 'type' : 'text', 'size' : 10 },
'actions' : { 'type' : 'text', 'filterable' :
false, 'sortable' : false }
})##
#set($options = {
'url' : "$xwiki.getURL('XWiki.DeletedAttachments',
'view', 'list=1&xpage=plain&outputSyntax=plain')",
'callback' : 'XWiki.index.trash.attachments.displayEntry',
'translationPrefix' : 'platform.index.trashAttachments.'
})##
##
##
##
{{html wiki="true" clean="false"}}
<div class="hidden">
#livetable('attachmentTrash' $columns $columnProperties $options)
</div>
{{/html}}
{{html wiki="true" clean="false"}}
<noscript>
#set($deletedAttachments = $services.query.hql('select count(datt.id) from
DeletedAttachment as datt').execute().get(0))
#if($deletedAttachments == 0)
{{info}}$services.localization.render('platform.index.trashAttachmentsEmpty'){{/info}}
#else
#macro(displayDeletedAttachment $id)
#set($datt = $xwiki.getDeletedAttachment("$id"))
#set($originalAttachment = $datt.getAttachment())
#set($originalDocument = $xwiki.getDocument($datt.docName))
<tr>
<td><a
href="$originalDocument.getAttachmentRevisionURL($originalAttachment.filename,
$originalAttachment.version, "rid=${datt.id}").replaceAll('&',
'&')">$escapetool.xml($datt.filename)</a></td>
<td><a
href="$originalDocument.getURL()">$escapetool.xml($originalDocument.plainTitle)
($escapetool.xml(${originalDocument.fullName}))</a></td>
<td>$xwiki.formatDate($datt.getDate(), $dateFormat)</td>
<td>$xwiki.getUserName($datt.getDeleter())</td>
<td class="itemActions">
#if($datt.canDelete())
<a href="${originalDocument.getAttachmentURL($datt.filename,
'delattachment',
"trashId=${datt.id}&xredirect=$escapetool.url($!request.getRequestURI())?$escapetool.url($!request.getQueryString())")}"
class="tool delete"
title="$services.localization.render('platform.index.trashAttachmentsActionsDeleteTooltip')">$services.localization.render('platform.index.trashAttachmentsDeleteText')</a>
#end
</td>
</tr>
#end
##
#if("$!{request.view}" == '')
#set($queryParams = '')
#else
#set($queryParams = "view=$!{escapetool.url($request.view)}")
#end
#set($paginationParameters = {
'totalItems' : $services.query.hql('select count(datt.id) from
DeletedAttachment as datt').execute().get(0),
'defaultItemsPerPage' : 15,
'url' : $doc.getURL('view', $queryParams)
})
#pagination($paginationParameters)
<table id="searchResults" class="xwiki-livetable
xwiki-livetable-display">
<thead class="xwiki-livetable-display-header"><tr>
<th scope="col" class="xwiki-livetable-display-header-text
selected
asc">$services.localization.render('platform.index.trashAttachments.datt.filename')</th>
<th scope="col"
class="xwiki-livetable-display-header-text">$services.localization.render('platform.index.trashAttachments.datt.docName')</th>
<th scope="col"
class="xwiki-livetable-display-header-text">$services.localization.render('platform.index.trashAttachments.datt.date')</th>
<th scope="col"
class="xwiki-livetable-display-header-text">$services.localization.render('platform.index.trashAttachments.datt.deleter')</th>
<th scope="col"
class="xwiki-livetable-display-header-text">$services.localization.render('platform.index.trashAttachments.actions')</th>
</tr></thead>
<tbody class="xwiki-livetable-display-body">
#set ($query = $services.query.hql('select datt.id from DeletedAttachment as datt
order by datt.filename asc'))
#foreach($item in
$query.setLimit($paginationParameters.itemsPerPage).setOffset($paginationParameters.firstItem).execute())
#displayDeletedAttachment($item)
#end
</tbody>
</table>
#set($discard = $paginationParameters.put('position', 'bottom'))
#pagination($paginationParameters)
#end ## deletedAttachments != 0
</noscript>
{{/html}}##
#else ## request.list
##
============================================================================================
## This page is called from live table via Ajax with the argument xpage=plain. It returns
a
## set of results serialized in JSON.
## @programming This service page needs to be saved by a user with the programming access
level
## to work as expected
##
============================================================================================
#if("$!{request.get('xpage')}" == 'plain')
$response.setContentType('application/json')
#set($offset = $mathtool.toInteger($request.get('offset')))
## offset starts from 0 in velocity and 1 in javascript
#set($offset = $offset - 1)
#if (!$offset || $offset < 0)
#set ($offset = 0)
#end
#set($limit = $mathtool.toInteger($request.get('limit')))
#if (!$limit)
#set ($limit = 15)
#end
#set($filenameFilter = $request.get('datt.filename'))
#set($docNameFilter = $request.get('datt.docName'))
#set($deleterFilter = $request.get('datt.deleter'))
#set($sql = '')
#if("$!{filenameFilter}" != '')
#set($sql = "and lower(datt.filename) like
'%${filenameFilter.trim().toLowerCase()}%' ")
#end
#if("$!{docNameFilter}" != '')
#set($sql = "and lower(datt.docName) like
'%${docNameFilter.trim().toLowerCase()}%' ")
#end
#if("$!{deleterFilter}" != '')
#set($sql = $sql + "and lower(datt.deleter) like
'%${deleterFilter.trim().toLowerCase()}%' ")
#end
#if("$!{request.sort}" != '')
#set($order = $request.sort)
#else
#set($order = 'datt.id')
#end
#if("$!{request.dir}" != '')
#set($dir = $request.dir)
#else
#set($dir = 'asc')
#end
#set($selectSql = "select datt.id, $order from DeletedAttachment as datt where 1=1
" + $sql + " order by $order $dir")
#set($countSql = "select count(*) from DeletedAttachment as datt where 1=1 " +
$sql)
#set($items =
$services.query.hql($selectSql).setLimit($limit).setOffset($offset).execute())
#set($totalItems = $services.query.hql($countSql).execute().get(0))
#set($returnedItems = $items.size())
## ==============================================
## json starts
## ==============================================
{
"totalrows": $totalItems,
"returnedrows": $returnedItems,
"offset": ${mathtool.add($offset, 1)},
"reqNo": ${request.reqNo},
"query" : "$selectSql",
"rows": [
#foreach($item in $items)
#set($datt = $xwiki.getDeletedAttachment("$item.get(0)"))
#if($velocityCount > 1) , #end
{
#set($originalAttachment = $datt.getAttachment())
#set($originalDocument = $xwiki.getDocument($datt.docName))
"filename" : "$escapetool.javascript($datt.filename)",
"docName" : "$escapetool.javascript($datt.docName)",
"title" :
"$escapetool.javascript($originalDocument.plainTitle)",
"url" :
"$originalDocument.getAttachmentRevisionURL($originalAttachment.filename,
$originalAttachment.version, "rid=${datt.id}")",
"documentUrl" : "$originalDocument.getURL()",
"canDelete" : $datt.canDelete(),
"deleteUrl" : "$originalDocument.getAttachmentURL($datt.filename,
'delattachment',
"trashId=${datt.id}&form_token=$!{services.csrf.getToken()}")",
"canRestore" : $datt.canRestore(),
"alreadyExists" : #if($originalDocument.getAttachment($datt.filename)) true
#else false #end,
"restoreUrl" :
"$originalDocument.getAttachmentURL($datt.filename)",
"date" : "$xwiki.formatDate($datt.date, $dateFormat)",
"deleter" : "$escapetool.javascript($datt.deleter)",
"deletername" :
"$escapetool.javascript($xwiki.getUserName($datt.deleter, false))",
"deleterurl" : "$xwiki.getURL($datt.deleter, 'view')"
}
#end
]}
## ==============================================
## json ended
## ==============================================
#end## xpage=plain
#end## request.list
#end## hasProgramR]
at
org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:131)
at
org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:50)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(AbstractScriptMacro.java:286)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:182)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
at
org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:200)
at
org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:140)
at
org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:175)
at org.xwiki.rendering.internal.macro.html.HTMLMacro.renderWikiSyntax(HTMLMacro.java:271)
at org.xwiki.rendering.internal.macro.html.HTMLMacro.execute(HTMLMacro.java:154)
at org.xwiki.rendering.internal.macro.html.HTMLMacro.execute(HTMLMacro.java:73)
at
org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:200)
at
org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:140)
at
org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:175)
at
org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:94)
at
org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:252)
at
org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:125)
at
org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:55)
at
org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:80)
at
org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:38)
at
org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:113)
at
org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:50)
at
org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:67)
at
org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:41)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:981)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:960)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:991)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:606)
at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:131)
at
com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluate(DefaultPrivilegedTemplateRenderer.java:147)
at
com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluateTemplate(DefaultPrivilegedTemplateRenderer.java:84)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1622)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1562)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:801)
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:131)
at
com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluate(DefaultPrivilegedTemplateRenderer.java:147)
at
com.xpn.xwiki.internal.template.DefaultPrivilegedTemplateRenderer.evaluateTemplate(DefaultPrivilegedTemplateRenderer.java:84)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1622)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:179)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:357)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:148)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:126)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id
[xwiki:Main.AllDocs]
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:247)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187)
at
org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:124)
... 116 more
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method
'getAttachment' in class com.xpn.xwiki.api.DeletedAttachment threw exception
java.lang.OutOfMemoryError: Java heap space at xwiki:Main.AllDocs[line 42, column 34]
at
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:261)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228)
... 118 more
Caused by: java.lang.OutOfMemoryError: Java heap space