ArrayIndexOutOfBoundsException: Maximum array size reached
Tuesday, 30 October 2018 · 3 messages
HP
Han (US), Paul P30 Oct 2018 15:06 #
Hello,
We encountered the below error when using this API:
archive:extract-to($tempDirPath, file:read-binary($zipFilePath)). The zip file size is 51396593 and the inflated file size is 2796146027. Please let me know if you need additional information. We expect our data files to be at least 10 times bigger than these numbers.
POST failed with response 400: Improper use? Potential bug? Your feedback is welcome:Contact: basex-talk at mailman.uni-konstanz.de<mailto:basex-talk at mailman.uni-konstanz.de>
Version: BaseX 9.0.2
Java: Oracle Corporation, 1.8.0_121
OS: Linux, amd64
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached.
at org.basex.util.Array.newSize(Array.java:238)
at org.basex.util.Array.newSize(Array.java:227)
at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32)
at java.io.OutputStream.write(OutputStream.java:116)
at org.basex.query.func.archive.ArchiveIn.read(ArchiveIn.java:77)
at org.basex.query.func.archive.ArchiveExtractTo.item(ArchiveExtractTo.java:40)
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:48)
at org.basex.query.scope.MainModule.iter(MainModule.java:118)
at org.basex.query.QueryContext.iter(QueryContext.java:330)
at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
at org.basex.core.cmd.AQuery.query(AQuery.java:100)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:257)
at org.basex.http.rest.RESTCmd.run(RESTCmd.java:105)
at org.basex.http.rest.RESTQuery.query(RESTQuery.java:69)
at org.basex.http.rest.RESTQuery.run0(RESTQuery.java:37)
at org.basex.http.rest.RESTCmd.run(RESTCmd.java:70)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.core.Command.execute(Command.java:116)
at org.basex.http.rest.RESTServlet.run(RESTServlet.java:27)
at org.basex.http.BaseXServlet.service(BaseXServlet.java:59)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:419)
at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:169)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)Regards,
Paul
CG
Christian Grün30 Oct 2018 15:24 #
Hi Paul,
I have optimized the implementation of
archive:extract-to. Archive contents will now be directly output to the local file system [1,2].
Best,
Christian
[1] http://files.basex.org/releases/latest/
[2] https://github.com/BaseXdb/basex/commit/8de6dceb2b7f9c56afa6c258a5f2a3c094fec937Quoted text · Paul P · 19 lines
On Tue, Oct 30, 2018 at 3:07 PM Han (US), Paul P <Paul.P.Han at boeing.com> wrote: > > Hello, > > We encountered the below error when using this API: archive:extract-to($tempDirPath, file:read-binary($zipFilePath)). The zip file size is 51396593 and the inflated file size is 2796146027. Please let me know if you need additional information. We expect our data files to be at least 10 times bigger than these numbers. > > POST failed with response 400: Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 9.0.2 > Java: Oracle Corporation, 1.8.0_121 > OS: Linux, amd64 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached. > at org.basex.util.Array.newSize(Array.java:238) > at org.basex.util.Array.newSize(Array.java:227) > at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32) > at java.io.OutputStream.write(OutputStream.java:116) > at org.basex.query.func.archive.ArchiveIn.read(ArchiveIn.java:77) > at org.basex.query.func.archive.ArchiveExtractTo.item(ArchiveExtractTo.java:40)
HP
Han (US), Paul P30 Oct 2018 16:51 #
Hi Christian,
I have verified your changes. Thank you so much for quick response.
Regards,
Paul
Quoted text · Christian Grün · 33 lines
-----Original Message----- From: Christian Grün [mailto:christian.gruen at gmail.com] Sent: Tuesday, October 30, 2018 7:24 AM To: Han (US), Paul P <Paul.P.Han at boeing.com> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] ArrayIndexOutOfBoundsException: Maximum array size reached Hi Paul, I have optimized the implementation of archive:extract-to. Archive contents will now be directly output to the local file system [1,2]. Best, Christian [1] http://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/commit/8de6dceb2b7f9c56afa6c258a5f2a3c094fec937 On Tue, Oct 30, 2018 at 3:07 PM Han (US), Paul P <Paul.P.Han at boeing.com> wrote: > > Hello, > > We encountered the below error when using this API: archive:extract-to($tempDirPath, file:read-binary($zipFilePath)). The zip file size is 51396593 and the inflated file size is 2796146027. Please let me know if you need additional information. We expect our data files to be at least 10 times bigger than these numbers. > > POST failed with response 400: Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 9.0.2 > Java: Oracle Corporation, 1.8.0_121 > OS: Linux, amd64 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached. > at org.basex.util.Array.newSize(Array.java:238) > at org.basex.util.Array.newSize(Array.java:227) > at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32) > at java.io.OutputStream.write(OutputStream.java:116) > at org.basex.query.func.archive.ArchiveIn.read(ArchiveIn.java:77) > at > org.basex.query.func.archive.ArchiveExtractTo.item(ArchiveExtractTo.ja > va:40)
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery